API Reference

eth_getBlockByHash - Base

Returns information about a block by block hash.

Parameters

  • DATA, 32 Bytes - Hash of a block.
  • Boolean - If true it returns the full transaction objects, if false only the hashes of the transactions.
params: [ "0xeb3bad6c11ff198037c7ab15779294030a3883a06a816f2784589d3a486e5b75", true, ];

Returns

Object - A block object with the following fields, or null when no block was found:

  • number: QUANTITY - the block number. null when its pending block.
  • hash: DATA, 32 Bytes - hash of the block. null when its pending block.
  • parentHash: DATA, 32 Bytes - hash of the parent block.
  • nonce: DATA, 8 Bytes - hash of the generated proof-of-work. null when its pending block.
  • sha3Uncles: DATA, 32 Bytes - SHA3 of the uncles data in the block.
  • logsBloom: DATA, 256 Bytes - the bloom filter for the logs of the block. null when its pending block.
  • transactionsRoot: DATA, 32 Bytes - the root of the transaction trie of the block.
  • stateRoot: DATA, 32 Bytes - the root of the final state trie of the block.
  • receiptsRoot: DATA, 32 Bytes - the root of the receipts trie of the block.
  • miner: DATA, 20 Bytes - the address of the beneficiary to whom the mining rewards were given.
  • difficulty: QUANTITY - integer of the difficulty for this block.
  • totalDifficulty: QUANTITY - integer of the total difficulty of the chain until this block.
  • extraData: DATA - the "extra data" field of this block.
  • size: QUANTITY - integer the size of this block in bytes.
  • gasLimit: QUANTITY - the maximum gas allowed in this block.
  • gasUsed: QUANTITY - the total used gas by all transactions in this block.
  • timestamp: QUANTITY - the unix timestamp for when the block was collated.
  • transactions: Array - Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter.
  • uncles: Array - Array of uncle hashes.

Example

Request

curl --location 'https://base-testnet.unifra.io/v1/{your-api-key}' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": [ "0xeb3bad6c11ff198037c7ab15779294030a3883a06a816f2784589d3a486e5b75", true ], "id": "123" }'
URL: https://eth-mainnet.unifra.io/v1/your-api-key RequestType: POST Body: { "jsonrpc":"2.0", "method":"eth_getBlockByHash", "params":["0xc0f4906fea23cf6f3cce98cb44e8e1449e455b28d684dfa9ff65426495584de6", true], "id":0 }

Result

{ "jsonrpc": "2.0", "id": "123", "result": { "baseFeePerGas": "0x32", "difficulty": "0x0", "extraData": "0x", "gasLimit": "0x17d7840", "gasUsed": "0x40071", "hash": "0xeb3bad6c11ff198037c7ab15779294030a3883a06a816f2784589d3a486e5b75", "logsBloom": "0x00000000000000000000000080000000000000000000000000040000000001000000000000000000000000100000000000000000000000000020008000200000000000000000800000000008000008000000000000840000000400008000400000000000020000000000002000000800000000000008000000004010000004000000000000000000001000000000000040000001002010080000000000000000020000000004800000000000000000000000000000000000000000000000000000000402000000000004002000020000000000000000001000000000000020000010000000000000000000400000000000040000000280400000000000000000", "miner": "0x4200000000000000000000000000000000000011", "mixHash": "0xddca007e92a342933f03d8e4c04a52e343482397e936db763120394afac48f7e", "nonce": "0x0000000000000000", "number": "0x5c7f4a", "parentHash": "0x3ace77200c08d3b11d194853331028489d6e6b3e31495a20ad566ac0da40cc62", "receiptsRoot": "0x6fbf6e70013d1efe095e1e28a3d55a63564fc5b872d0d5a77988aa56c7f78fec", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x6d9", "stateRoot": "0xf2b32d978bf7de363f4afa21980c9785a5aaf44093afe31a5aae25e09e36cf08", "timestamp": "0x64926ba4", "totalDifficulty": "0x0", "transactions": [ { "blockHash": "0xeb3bad6c11ff198037c7ab15779294030a3883a06a816f2784589d3a486e5b75", "blockNumber": "0x5c7f4a", "from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001", "gas": "0xf4240", "gasPrice": "0x0", "hash": "0x137e56a4c4af32f936d0e1b3245e0a7b0c985134a8e980d15f05d34611516a9e", "input": "0x015d8eb900000000000000000000000000000000000000000000000000000000008c96250000000000000000000000000000000000000000000000000000000064926b64000000000000000000000000000000000000000000000000000000000000fad2d05dd8de9e677e4473f72d091497d91d3c80776449ff1fc66f4e19d96a4f05ad000000000000000000000000000000000000000000000000000000000000000200000000000000000000000073b4168cc87f35cc239200a20eb841cded23493b000000000000000000000000000000000000000000000000000000000000083400000000000000000000000000000000000000000000000000000000000f4240", "nonce": "0x5c7f49", "to": "0x4200000000000000000000000000000000000015", "transactionIndex": "0x0", "value": "0x0", "type": "0x7e", "v": "0x0", "r": "0x0", "s": "0x0", "sourceHash": "0xf87e33ff0fc8e2d2c9c5e96256ff33a4be3190d8a477a8b876f2ae83d9d13adb", "mint": "0x0" }, { "blockHash": "0xeb3bad6c11ff198037c7ab15779294030a3883a06a816f2784589d3a486e5b75", "blockNumber": "0x5c7f4a", "from": "0x416edc1a6e2c1e63dce679abe4d5309ac9cc3609", "gas": "0x2e108", "gasPrice": "0x77359432", "maxFeePerGas": "0x7735943e", "maxPriorityFeePerGas": "0x77359400", "hash": "0x9eeb510b292a1a3edd490fba2276661f6d626f0a10d1e8d83e58720ff0590013", "input": "0xf305d7190000000000000000000000006440c59d7c7c108d3bb90e4bdeee8262c975858a000000000000000000000000000000000000000000000001a055690d9db800000000000000000000000000000000000000000000000000019e4080d911690000000000000000000000000000000000000000000000000000000f5e0a500e6e81000000000000000000000000416edc1a6e2c1e63dce679abe4d5309ac9cc36090000000000000000000000000000000000000000000000000000000064927044", "nonce": "0x4f", "to": "0xbe92671bdd1a1062e1a9f3be618e399fb5facace", "transactionIndex": "0x1", "value": "0xf71cf304c40c0", "type": "0x2", "accessList": [], "chainId": "0x14a33", "v": "0x1", "r": "0xd2f4a1c8658e4a079380b38b7f548c7aa7bbdab6aee260971a5e8141895b0492", "s": "0x32e24a486b0cec63443ab12f645e33b488474ad1f31e5e30d24c66a25c534aeb" }, { "blockHash": "0xeb3bad6c11ff198037c7ab15779294030a3883a06a816f2784589d3a486e5b75", "blockNumber": "0x5c7f4a", "from": "0xca1be10b07ee0723efcd57ac13543e3bb965e131", "gas": "0x26326", "gasPrice": "0x59682f32", "maxFeePerGas": "0x59682f32", "maxPriorityFeePerGas": "0x59682f32", "hash": "0x3a5b766747035f993b1287e7192315a0f797bf1cf65cba398ffe09042447c317", "input": "0x18cbafe5000000000000000000000000000000000000000000000001158e460913d0000000000000000000000000000000000000000000000000000000027f6bb70495f500000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000ca1be10b07ee0723efcd57ac13543e3bb965e1310000000000000000000000000000000000000000000000000000000064926a620000000000000000000000000000000000000000000000000000000000000002000000000000000000000000b37a5498a6386b253fc30863a41175c3f9c0723b0000000000000000000000004200000000000000000000000000000000000006", "nonce": "0x59", "to": "0xbe92671bdd1a1062e1a9f3be618e399fb5facace", "transactionIndex": "0x2", "value": "0x0", "type": "0x2", "accessList": [], "chainId": "0x14a33", "v": "0x0", "r": "0xca6ec88a005354e70f0c9d2936343bd678ac02d5117d8cc37259068c1a357639", "s": "0x2d69830f1e0b777516c5cffc645ccc81a60a869ec219cb77798098931cb6e889" }, { "blockHash": "0xeb3bad6c11ff198037c7ab15779294030a3883a06a816f2784589d3a486e5b75", "blockNumber": "0x5c7f4a", "from": "0x96fd481e0d14db5c9dacb562d9a1495ea8fc201c", "gas": "0xb412", "gasPrice": "0x59682f32", "maxFeePerGas": "0x59682f3c", "maxPriorityFeePerGas": "0x59682f00", "hash": "0x4ed997867867ddd789954ed8b6ff9a2217d4b1014e8917dee15299b375d8d59b", "input": "0x095ea7b3000000000000000000000000db8726189978d09d8c8a449eda6c72a1e2eb228e0000000000000000000000000000000000000000000000001eaaac75fec121cd", "nonce": "0xe", "to": "0xf032de94fd586c71b2d1ad62b64c000fe7ae9e47", "transactionIndex": "0x3", "value": "0x0", "type": "0x2", "accessList": [], "chainId": "0x14a33", "v": "0x1", "r": "0x97b3695b06fab6a7046214d59949e474a503bf0cb5ec9333b7ab3420b20315c6", "s": "0x258bf68c8b528d7238edefb342911f50ad1c246331bf6e99b3d93bcd3e5b4f6e" } ], "transactionsRoot": "0xecc134f37556787f2bb2ed7fb4f5e656e1bb63974859898848300e464b9fb4c3", "uncles": [] } }

🚧

The below parameter inputs do not work, please reference the section above instead.

Path Params
string
required
Body Params
json
Defaults to { "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": [ "0xeb3bad6c11ff198037c7ab15779294030a3883a06a816f2784589d3a486e5b75", true ], "id": "123" }
Responses

Language
Click Try It! to start a request and see the response here! Or choose an example:
application/json