/pallets/{palletId}/storage/{storageItemId} - Polkadot

This endpoint returns the decoded value of a storage item in a pallet, resolving the required keys. It removes the need to compute storage keys or decode SCALE manually.

On GetBlock's unified endpoint, Asset Hub is the default network. To call this endpoint against the Relaychain, add an /rc prefix to the path (for example, /rc/pallets/{palletId}/storage/{storageItemId}).

Endpoint

httpGET /pallets/{palletId}/storage/{storageItemId}

Path Parameters

ParameterTypeDescription
palletIdstringPallet name or index, such as staking
storageItemIdstringStorage item name, such as ledger

Query Parameters

ParameterTypeRequiredDescription
keys[]arrayNoKeys for map or double-map storage items
atstringNoBlock height or hash to query at

Request

bashcurl --location 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/pallets/staking/storage/ledger?keys[]=15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5'

example.js

javascriptconst response = await fetch('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/pallets/staking/storage/ledger?keys[]=15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5');
const data = await response.json();
console.log(data);

example.py

pythonimport requests

response = requests.get('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/pallets/staking/storage/ledger?keys[]=15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5')
print(response.json())

Response

json{
  "at": {
    "hash": "0x255bc00927df8d33d561792635cbc6bde480a0a505eef5ff28630ece3fc15b32",
    "height": "6754362"
  },
  "pallet": "staking",
  "palletIndex": "7",
  "storageItem": "ledger",
  "keys": [
    "15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5"
  ],
  "value": {
    "stash": "15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5",
    "total": "100000000000",
    "active": "100000000000"
  }
}

Response Fields

FieldTypeDescription
palletstringPallet name
storageItemstringStorage item name
keysarrayResolved keys used to read the item
valueobjectThe decoded storage value

Use Cases

  • Decoded Reads: Read pallet storage without SCALE decoding
  • Staking Data: Read a nominator's ledger
  • Governance: Read referenda or preimage storage
  • Custom Pallets: Read parachain-specific storage items