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

header - Cosmos

Example code for the header JSON-RPC method. Complete guide on how to use header JSON-RPC in GetBlock Web3 documentation.

Returns the block header at a specific height. Lighter alternative to block when you only need header data (chain id, height, time, hashes) without the full transaction list.

Parameters

Parameter
Type
Required
Description

height

integer

No

Block height (decimal). Defaults to the latest block

Request Example

# JSON-RPC over HTTP POST (canonical)
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/header' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "header",
    "params": {
        "height": 23456789
    },
    "id": "getblock.io"
}'

# URI over HTTP GET (alternate, for simple methods)
curl --location --request GET 'https://go.getblock.io/<ACCESS-TOKEN>/header?height=23456789'

Response Example

Response Parameters

Field
Type
Description

result.header.chain_id

string

Chain ID

result.header.height

string

Block height

result.header.time

string

ISO 8601 block timestamp

result.header.data_hash

string

Hash of the block's transactions

result.header.app_hash

string

Hash of the application state after this block

result.header.proposer_address

string

Validator address that proposed this block

Use Cases

  • Lightweight chain-tip polling without fetching full block bodies

  • Header-only indexing in resource-constrained environments

  • Detecting reorgs by header chain reconciliation

Error Handling

Status Code
Error Message
Cause

404

Not Found

Missing or invalid <ACCESS-TOKEN>

-32602

Invalid params

Request parameters are missing or malformed

-32603

Internal error

Server-side error while processing the request

429

Too Many Requests

Rate limit exceeded for your plan

SDK Integration

Last updated

Was this helpful?