/runtime/metadata - Polkadot

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

httpGET /runtime/metadata

Query Parameters

ParameterTypeRequiredDescription
versionintegerNoMetadata version to return (for example, 14 or 15)
atstringNoBlock height or hash to query at

Request

bashcurl --location 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/runtime/metadata?version=15'

example.js

javascriptconst 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

pythonimport requests

response = requests.get('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/runtime/metadata?version=15')
print(response.json())

Response

json{
  "magicNumber": 1635018093,
  "metadata": {
    "v15": {
      "pallets": [
        {
          "name": "System",
          "index": 0
        },
        {
          "name": "Balances",
          "index": 5
        }
      ]
    }
  }
}

Response Fields

FieldTypeDescription
magicNumberintegerMetadata magic number
metadataobjectDecoded 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