/runtime/spec - Polkadot
Example code for the /runtime/spec REST method. Complete guide on how to use /runtime/spec REST in GetBlock Web3 documentation.
This endpoint returns the runtime specification: the spec name and version, transaction version, and chain properties such as token symbol and decimals.
Endpoint
GET /runtime/specQuery Parameters
at
string
No
Block height or hash to query at
Request
curl --location 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/runtime/spec'const response = await fetch('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/runtime/spec');
const data = await response.json();
console.log(data);import requests
response = requests.get('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/runtime/spec')
print(response.json())Response
{
"at": {
"hash": "0x255bc00927df8d33d561792635cbc6bde480a0a505eef5ff28630ece3fc15b32",
"height": "6754362"
},
"authoringVersion": "0",
"transactionVersion": "26",
"implVersion": "0",
"specName": "polkadot",
"specVersion": "1002000",
"chainType": {
"live": null
},
"properties": {
"ss58Format": "0",
"tokenDecimals": [
"10"
],
"tokenSymbol": [
"DOT"
]
}
}Response Fields
specName
string
Runtime spec name (polkadot)
specVersion
string
Runtime spec version
transactionVersion
string
Transaction format version
properties
object
Chain properties (SS58 format, decimals, symbol)
Use Cases
Upgrade Detection: Detect runtime upgrades by specVersion
Transaction Signing: Read the transaction version
Chain Config: Read token decimals and SS58 format
Tooling: Configure SDKs against the runtime
Last updated
Was this helpful?