Docs
Supported ChainsKusamaSubstrate APIState Methods

state_getStorage - Kusama RPC Method

Query storage values on Kusama. Essential for reading chain state for parachain experimentation, early feature deployment, and production-grade testing with real value.

Returns a storage entry at a specific key on Kusama.

Why Kusama? Build on Polkadot's canary network for real-world testing with live economic conditions with 7-day governance cycles (vs 1 month on Polkadot), lower bonding requirements, live KSM token economy, and first-to-market feature testing.

Use Cases

  • State queries - Read on-chain storage values
  • Account balances - Query account data for parachain experimentation, early feature deployment, and production-grade testing with real value
  • Pallet storage - Access runtime storage items
  • Historical state - Query state at specific blocks

Request Parameters

Request
keyString

Storage key (hex-encoded)

blockHashString

Block hash for historical query

Response Body

Response

Code Examples

Bash
curl  \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "state_getStorage",
    "params": [""],
    "id": 1
  }'
JavaScript
import { ApiPromise, WsProvider } from '@polkadot/api';

const provider = new WsProvider('');
const api = await ApiPromise.create({ provider });

// Query account balance
const account = '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY';
const accountInfo = await api.query.system.account(account);
console.log('Free balance:', accountInfo.data.free.toString());

// Query at specific block
const blockHash = '0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3';
const historicalBalance = await api.query.system.account.at(blockHash, account);
console.log('Historical balance:', historicalBalance.data.free.toString());

await api.disconnect();
Python
import requests

def get_storage(key, block_hash=None):
    url = ''
    params = [key] if block_hash is None else [key, block_hash]

    payload = {
        'jsonrpc': '2.0',
        'method': 'state_getStorage',
        'params': params,
        'id': 1
    }

    response = requests.post(url, json=payload)
    return response.json()['result']

# Query :code storage (runtime wasm)
storage_key = ''
value = get_storage(storage_key)
print(f'Storage value: {value[:66]}...' if value else 'None')

On this page