Ethereum
Bereit, das in der Produktion aufzurufen?
Das Free-Tier deckt persönliche Projekte ab. Pay-as-you-go skaliert ohne Karte.
Ethereum
Das Free-Tier deckt persönliche Projekte ab. Pay-as-you-go skaliert ohne Karte.
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.
blockHash; this turns it into the full block context.| # | Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|---|
| 1 | blockHash | string (hex) | Ja | The hash of the block to retrieve. |
| 2 | includeTransactions | boolean | Ja | When true, transactions[] contains full transaction objects. When false, only hashes. |
| Typ | Beschreibung |
|---|---|
| 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 |
Try it live in the Ethereum playground.
| Code | Meldung | Ursache |
|---|---|---|
-32602 | Invalid params | Block hash is malformed or not 32 bytes. |
"true" makes some nodes reject the request or treat it as false — send JSON true/false, not quoted text.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.null, not an error. Null-check before reading .number or .transactions, or you'll throw on a missing block.Parameter
0x-prefixed 32-byte block hash
true = full tx objects, false = tx hashes only