/blocks/head - Polkadot

This endpoint returns the most recent block, including its extrinsics, events grouped by phase, and author. The finalized head can be requested with the finalized 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/blocks/head).

Endpoint

httpGET /blocks/head

Query Parameters

ParameterTypeRequiredDescription
finalizedbooleanNoReturn the latest finalized block instead of the best block
eventDocsbooleanNoInclude event documentation
extrinsicDocsbooleanNoInclude extrinsic documentation

Request

bashcurl --location 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/blocks/head'

example.js

javascriptconst response = await fetch('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/blocks/head');
const data = await response.json();
console.log(data);

example.py

pythonimport requests

response = requests.get('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/blocks/head')
print(response.json())

Response

json{
  "number": "6754362",
  "hash": "0x255bc00927df8d33d561792635cbc6bde480a0a505eef5ff28630ece3fc15b32",
  "parentHash": "0x570e3f417a41646d9b978bf2ac3d68be48bb0f73082825f438af58a37cfe0ef8",
  "stateRoot": "0x176c67eca385c24403ba774550ff75dcfa652d6d6cf2d2ecbccf56e513db601c",
  "extrinsicsRoot": "0xada254ef8321e28a6667ad75659be6464944174bd5540667da94590a0a4a596f",
  "authorId": "15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5",
  "extrinsics": [],
  "onInitialize": {
    "events": []
  },
  "onFinalize": {
    "events": []
  },
  "finalized": true
}

Response Fields

FieldTypeDescription
numberstringBlock number
hashstringBlock hash
authorIdstringBlock author (validator)
extrinsicsarrayDecoded extrinsics with their events
finalizedbooleanWhether the block is finalized

Use Cases

  • Block Explorers: Render the latest block with decoded extrinsics
  • Indexing: Ingest blocks without decoding SCALE manually
  • Event Monitoring: Watch events emitted per block
  • Finality Tracking: Follow the finalized head