/runtime/metadata - Polkadot
Example code for the /runtime/metadata REST method. Complete guide on how to use /runtime/metadata REST in GetBlock Web3 documentation.
This endpoint returns the runtime metadata as decoded JSON. The metadata version can be selected with the version query parameter.
Endpoint
GET /runtime/metadataQuery Parameters
Parameter
Type
Required
Description
version
integer
No
Metadata version to return (for example, 14 or 15)
at
string
No
Block height or hash to query at
Request
curl --location 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/runtime/metadata?version=15'const response = await fetch('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/runtime/metadata?version=15');
const data = await response.json();
console.log(data);import requests
response = requests.get('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/runtime/metadata?version=15')
print(response.json())Response
{
"magicNumber": 1635018093,
"metadata": {
"v15": {
"pallets": [
{
"name": "System",
"index": 0
},
{
"name": "Balances",
"index": 5
}
]
}
}
}Response Fields
Field
Type
Description
magicNumber
integer
Metadata magic number
metadata
object
Decoded runtime metadata, keyed by version
Use Cases
SDK Bootstrapping: Load decoded metadata without SCALE parsing
Pallet Discovery: Enumerate pallets, calls, and storage
Type Registries: Build type registries from metadata
Tooling: Generate typed bindings from metadata
Last updated
Was this helpful?