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

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

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/runtime/metadata).

Endpoint

GET /runtime/metadata

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