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

/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

GET /blocks/{blockId}

Path Parameters

Parameter
Type
Description

blockId

string

Block number or block hash

Query Parameters

Parameter
Type
Required
Description

eventDocs

boolean

No

Include event documentation

extrinsicDocs

boolean

No

Include extrinsic documentation

Request

curl --location 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/blocks/6754362'
example.js
const response = await fetch('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/blocks/6754362');
const data = await response.json();
console.log(data);
example.py
import requests

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

Response

{
  "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

Field
Type
Description

number

string

Block number

hash

string

Block hash

extrinsics[].method

object

The pallet and call of each extrinsic

extrinsics[].success

boolean

Whether the extrinsic succeeded

extrinsics[].events

array

Events 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

Last updated

Was this helpful?