/blocks - Polkadot
This endpoint returns a range of blocks in a single call, decoded like /blocks/{blockId}. The range is limited to keep responses bounded.
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).
Endpoint
GET /blocksQuery Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| range | string | Yes | Inclusive block-number range, such as 0-1 |
Request
bashcurl --location 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/blocks?range=6754360-6754362'example.js
javascriptconst response = await fetch('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/blocks?range=6754360-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?range=6754360-6754362')
print(response.json())Response
json[
{
"number": "6754360",
"hash": "0xabc...",
"extrinsics": []
},
{
"number": "6754361",
"hash": "0xdef...",
"extrinsics": []
}
]Response Fields
| Field | Type | Description |
|---|---|---|
| [] | array | Array of decoded block objects, one per block in the range |
| [].number | string | Block number |
| [].hash | string | Block hash |
| [].extrinsics | array | Decoded extrinsics for the block |
Use Cases
- Batch Indexing: Ingest several blocks in one request
- Backfilling: Backfill a historical range efficiently
- Analytics: Scan a window of blocks for activity
- Reduced Round-Trips: Avoid per-block requests