For the complete documentation index, see llms.txt. This page is also available as Markdown.

/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.

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

GET /pallets/{palletId}/storage/{storageItemId}

Path Parameters

Parameter
Type
Description

palletId

string

Pallet name or index, such as staking

storageItemId

string

Storage item name, such as ledger

Query Parameters

Parameter
Type
Required
Description

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'
example.js
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);
example.py
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

Field
Type
Description

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?