Kaia

Kaia

eth_getBlockByNumber

eth_getBlockByNumber returns the full block matching a given height or tag. It's the most common way to fetch block-level data — used by explorers, indexers, monitoring stacks, and anything that needs to walk the chain backwards or forwards.

Parameters

#NameTypeDescription
1blockstringBlock number in hex, or a tag: latest, earliest, pending, safe, finalized.
2includeTxbooleantrue returns full transaction objects in transactions[]. false returns only transaction hashes.

The second argument is a real boolean, not the string "true" / "false" — your client should serialize it as true. The playground does this automatically.

Response shape (abbreviated)

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"number": "0x14a3b27",
"hash": "0x...",
"parentHash": "0x...",
"timestamp": "0x67b1234",
"miner": "0x...",
"gasUsed": "0xa8c2f0",
"gasLimit": "0x1c9c380",
"baseFeePerGas": "0x12a05f200",
"transactions": [
"0x...",
"0x..."
]
}
}

When includeTx: true, each entry in transactions[] is a full object: from, to, value, gas, maxFeePerGas, maxPriorityFeePerGas, input, nonce, r/s/v, accessList, and so on. The response gets large — for a popular block, expect 500–1500 KB.

Tips for indexers

  1. Don't request full tx objects unless you need them. If you only care about hashes (you'll fetch receipts separately), pass includeTx: false — bandwidth drops 5-10×.
  2. Use eth_getBlockReceipts instead of N + 1 calls. When you want the receipts of every tx in a block, one eth_getBlockReceipts call beats N eth_getTransactionReceipt calls.
  3. Combine with finalized for safety. For systems of record, query against the finalized tag — those blocks can't be reorged.

See also

Parameters

number or tag

true → full tx objects, false → tx hashes

curl https://kaia.therpc.io \
-X POST \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_getBlockByNumber","params":["latest",false]}'

Ready to call this in production?

Free tier covers personal projects. Pay-as-you-go scales without a card.