blockchain - Stable

Returns block metadata (headers) for a range of heights, newest first. The range is capped at 20 blocks per call.

Method

blockchain

Parameters

ParameterTypeDescription
minHeightstringLowest block height in the range
maxHeightstringHighest block height in the range

Example

bashexport STABLE_TM=https://shared.ap-southeast-1.getblock.io/<ACCESS-TOKEN>/

# JSON-RPC over HTTP (POST)
curl -X POST "${STABLE_TM}" -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0", "id": "getblock.io", "method": "blockchain", "params": {"minHeight": "31378800", "maxHeight": "31378820"}}'

# URI over HTTP (GET)
curl "${STABLE_TM}blockchain?minHeight=31378800&maxHeight=31378820"

Response

json{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": {
        "last_height": "31378844",
        "block_metas": [
            {
                "block_id": {
                    "hash": "A1B2..."
                },
                "header": {
                    "height": "31378820",
                    "time": "2026-06-01T10:31:22Z"
                },
                "num_txs": "3"
            }
        ]
    }
}

Response Fields

FieldTypeDescription
last_heightstringCurrent chain tip height
block_metasarrayBlock headers in the requested range, newest first

Use Cases

  • Range scan: Pull a window of recent block headers

Error Handling

ErrorMessageDescription
-32600 / Invalid requestInvalid requestThe JSON-RPC envelope was malformed
-32602 / Invalid paramsInvalid paramsA parameter was missing or of the wrong type
403 / RBAC: access deniedAccess deniedThe GetBlock access token is missing or incorrect