Skip to main content

state_getKeysPaged RPC method

Retrieve keys that have a specified prefix, with support for pagination.

Parameters

StorageKey string REQUIRED

The key prefix to retrieve matching keys from

u32 integer REQUIRED

An unsigned 32-bit integer, specifying the number of results to include per page

StartKey string

This parameter is used for pagination, indicating the starting key to fetch results from. If not provided, the request will start from the beginning

BlockHash string

The hash of a specific block in the chain. Providing this parameter ensures that the keys are queried at the state corresponding to that block. If not provided, the request will use the latest block

Returns

result string

A string representing the retrieved keys with the specified prefix

Code Examples

curl https://api-polkadot.dwellir.com/<API-KEY> \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"state_getKeysPaged","params":[null, 2],"id":1,"jsonrpc":"2.0"}'