Linea
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
| # | Name | Type | Description |
|---|---|---|---|
| 1 | block | string | Block number in hex, or a tag: latest, earliest, pending, safe, finalized. |
| 2 | includeTx | boolean | true 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)
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
- 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×. - Use
eth_getBlockReceiptsinstead of N + 1 calls. When you want the receipts of every tx in a block, oneeth_getBlockReceiptscall beats Neth_getTransactionReceiptcalls. - Combine with
finalizedfor safety. For systems of record, query against thefinalizedtag — those blocks can't be reorged.
See also
- eth_getBlockByHash — same data, looked up by hash.
- eth_getBlockReceipts — all receipts in a block in one call.
- eth_blockNumber — fetch the current chain height to choose which block to read.
Parameters
number or tag
true → full tx objects, false → tx hashes