/pallets/{palletId}/storage/{storageItemId} - Polkadot
Example code for the /pallets/{palletId}/storage/{storageItemId} REST method. Complete guide on how to use/pallets/{palletId}/storage/{storageItemId} REST in GetBlock Web3 documentation.
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.
Endpoint
GET /pallets/{palletId}/storage/{storageItemId}Path Parameters
palletId
string
Pallet name or index, such as staking
storageItemId
string
Storage item name, such as ledger
Query Parameters
keys[]
array
No
Keys for map or double-map storage items
at
string
No
Block height or hash to query at
Request
curl --location 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/pallets/staking/storage/ledger?keys[]=15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5'const 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);import requests
response = requests.get('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/pallets/staking/storage/ledger?keys[]=15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5')
print(response.json())Response
Response Fields
pallet
string
Pallet name
storageItem
string
Storage item name
keys
array
Resolved keys used to read the item
value
object
The 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
Last updated
Was this helpful?