Ethereum
eth_getBlockByHash
eth_getBlockByHash returns the full block that matches a 32-byte hash on Ethereum mainnet. A block hash uniquely pins one block, so unlike a height it survives reorgs cleanly — the hash either exists in your view of the chain or it doesn't. The response carries the header (parent hash, timestamp, miner/proposer, state and receipts roots), the EIP-1559 baseFeePerGas, gas metrics, the post-Merge withdrawals list, and either full transaction objects or just their hashes depending on the second argument. Send it to https://ethereum.therpc.io/YOUR_API_KEY (chain ID 1, native coin ETH). An unknown hash yields null.
Use cases
- Resolve a hash you already hold. A transaction receipt or a log entry hands you a
blockHash; this turns it into the full block context. - Reorg detection. Store the hash you saw for a height, then later ask the node for that same height — if the canonical hash differs, that slot reorged and you reindex from there.
- Pull header detail for one block. Read the validator withdrawals, gas used vs limit, base fee, and the various roots for a specific canonical block without scanning a range.
Parameters
| # | Name | Type | Required | Description |
|---|---|---|---|---|
| 1 | blockHash | string (hex) | Yes | The hash of the block to retrieve. |
| 2 | includeTransactions | boolean | Yes | When true, transactions[] contains full transaction objects. When false, only hashes. |
Response
| Type | Description |
|---|---|
| object | null | Block object with fields: number, hash, parentHash, timestamp, miner, gasUsed, gasLimit, baseFeePerGas, transactions, uncles, withdrawals, stateRoot, receiptsRoot, transactionsRoot, logsBloom, extraData, size, difficulty, totalDifficulty, mixHash, nonce, sha3Uncles. Returns null if no block was foun |
Example request
Try it live in the Ethereum playground.
Errors & troubleshooting
| Code | Message | Cause |
|---|---|---|
-32602 | Invalid params | Block hash is malformed or not 32 bytes. |
Common pitfalls
- The second argument is a real boolean. Passing the string
"true"makes some nodes reject the request or treat it as false — send JSONtrue/false, not quoted text. - With the flag set to
true, a full mainnet block packed with Uniswap and transfer activity can push the response past 1 MB. Stream or fetch hashes only and pull transactions on demand if bandwidth matters. - An unknown or non-canonical hash returns
null, not an error. Null-check before reading.numberor.transactions, or you'll throw on a missing block.
Supported networks
- Mainnet — Chain ID: 1
- Sepolia — Chain ID: 11155111
See also
- eth_getBlockByNumber
- eth_getBlockReceipts
- eth_getTransactionByHash
- eth_getBlockTransactionCountByHash
Parameters
0x-prefixed 32-byte block hash
true = full tx objects, false = tx hashes only