/blocks/{blockId} - Polkadot

This endpoint returns a block by its number or hash, with decoded extrinsics and events. It is the historical counterpart of /blocks/head.

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/{blockId}).

Endpoint

httpGET /blocks/{blockId}

Path Parameters

ParameterTypeDescription
blockIdstringBlock number or block hash

Query Parameters

ParameterTypeRequiredDescription
eventDocsbooleanNoInclude event documentation
extrinsicDocsbooleanNoInclude extrinsic documentation

Request

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

example.js

javascriptconst response = await fetch('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/blocks/6754362');
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/6754362')
print(response.json())

Response

json{
  "number": "6754362",
  "hash": "0x255bc00927df8d33d561792635cbc6bde480a0a505eef5ff28630ece3fc15b32",
  "authorId": "15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5",
  "extrinsics": [
    {
      "method": {
        "pallet": "balances",
        "method": "transferKeepAlive"
      },
      "signature": {
        "signer": {
          "id": "15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5"
        }
      },
      "nonce": "1233",
      "success": true,
      "events": [
        {
          "method": {
            "pallet": "balances",
            "method": "Transfer"
          }
        }
      ]
    }
  ],
  "onInitialize": {
    "events": []
  },
  "onFinalize": {
    "events": []
  }
}

Response Fields

FieldTypeDescription
numberstringBlock number
hashstringBlock hash
extrinsics[].methodobjectThe pallet and call of each extrinsic
extrinsics[].successbooleanWhether the extrinsic succeeded
extrinsics[].eventsarrayEvents emitted by the extrinsic

Use Cases

  • Historical Lookups: Fetch a past block by number or hash
  • Transaction Receipts: Read an extrinsic's success and events
  • Auditing: Inspect the calls in a historical block
  • Analytics: Aggregate on-chain activity by block