Fetches blocks for one or more block numbers in a single request. Use the same x-cache-id pattern as other JSON routes.
Endpoint
POST https://storage.lineage.to/block_by_num
Headers
| Header | Type | Description |
|---|---|---|
x-cache-id | string | Idempotency / cache key. Must match the documented pattern (32 lowercase hex characters, e.g. ^[a-z0-9]{32}$). The response id matches this value. |
Request body
JSON array of block numbers (non-negative integers).
[0, 1, 42]
Example
curl -sS -X POST "https://storage.lineage.to/block_by_num" \ -H "Content-Type: application/json" \ -H "x-cache-id: 0123456789abcdef0123456789abcdef" \ -d '[0,1,2]'
Responses
200 and 400 for success and bad input. On success, content contains block material; full block objects can be large (header, merkle data, transaction id list, etc.). Some nodes return a top-level list of block objects; others wrap them in an object (see example).
Envelope fields (typical)
id— idempotency id (matchesx-cache-id).status— one ofSuccess,Error, orPending.reason— human-readable detail; especially useful for errors.route— logical route name for the call.content— payload; shape depends on the operation.
Example success payload
{
"id": "0123456789abcdef0123456789abcdef",
"status": "Success",
"reason": "Blocks returned",
"route": "block_by_num",
"content": {
"blocks": [
{
"height": 0,
"block_hash": "<hex>",
"tx_ids": [ "<tx-id>" ],
"header": {}
}
]
}
}Example error envelope (typical 400)
{
"id": null,
"status": "Error",
"reason": "Bad Request",
"route": null,
"content": null
}