block - NEAR Protocol

Returns detailed information about a block, selected by finality ("final"/"optimistic") or by block_id (height or hash).

Method

block

Parameters

The params object carries:

ParameterExampleDescription
finality"final"—

Example

bashexport NEAR_RPC=https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/

curl -X POST "${NEAR_RPC}" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0", "id": "getblock.io", "method": "block", "params": {"finality": "final"}}'

Response

json{
    "author": "figment.poolv1.near",
    "header": {
        "height": 152000000,
        "hash": "9MzuZ...",
        "prev_hash": "8Lk...",
        "timestamp_nanosec": "1780000000000000000",
        "gas_price": "100000000"
    },
    "chunks": [
        {
            "chunk_hash": "3xY...",
            "shard_id": 0,
            "gas_used": 1200000000000
        }
    ]
}

Response Fields

FieldTypeDescription
authorstringThe block producer's account id
headerobjectBlock header: height, hash, prev_hash, timestamp, gas price
chunksarrayChunk headers, one per shard

Use Cases

  • Block read: Fetch a block by height, hash, or finality
  • Chunk discovery: Read chunk_hash values to query individual chunks

Error Handling

ErrorMessageDescription
-32700 / Parse errorParse errorThe JSON request was malformed
-32601 / Method not foundMethod not foundThe method is unknown or disabled on this node version
HANDLER_ERRORRequested data not foundThe account, block, chunk, or transaction does not exist or is garbage-collected (use an archival node)
403 / RBAC: access deniedAccess deniedThe GetBlock access token is missing or incorrect