eth_getBlockByHash

Returns information about a block by hash.

Parameters

Object NameRequiredTypeDetail
BLOCK HASHStringHash of the block.
SHOW TRANSACTION DETAILSBooleanIf set true, it returns the full transaction objects in the block; if set false, it returns only the transaction hashes in the block.
"params": [
    "0x03512aadeff977a656714df25a7733958b89d94416f921f87d564bbcaf4109b8",
    false
]

Result

A block object, or null if no block found.

Result Fields

KeyTypeDetail
difficultyStringA hex code of an integer that represents the difficulty for this block.
extraDataStringThe "extra data" field of this block.
gasLimitStringA hex code of an integer that represents the maximum gas allowed in this block.
gasUsedStringA hex code of an integer that represents the total used gas by all transactions in this block.
hashStringHash of the block. null if the returned block is a pending block.
logsBloomStringThe bloom filter for the logs of the block. null if the returned block is a pending block.
minerStringAddress of the beneficiary to whom the mining rewards were given.
nonceStringHash of the generated proof-of-work. null if the returned block is a pending block.
numberStringA hex code of an integer that represents the block number. null if the returned block is a pending block.
parentHashStringHash of the parent block.
receiptsRootStringThe root of the receipts trie of the block.
sha3UnclesStringSHA3 of the uncles data in the block.
sizeStringA hex code of an integer that represents the size of this block in bytes.
stateRootStringThe root of the final state trie of the block.
timestampIntegerThe unix timestamp for when the block was collated.
totalDifficultyStringA hex code of an integer that represents the difficulty of the chain until this block.
transactionsArrayArray of transactions objects or array of transactions hashes, depending on the parameter value of SHOW TRANSACTION DETAILS
transactionsRootStringThe root of the transaction trie of the block.
unclesArrayArray of uncle hashes.

Example

Request

curl <your-endpoint> \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"eth_getBlockByHash","params":["0x03512aadeff977a656714df25a7733958b89d94416f921f87d564bbcaf4109b8", false],"id":0}'

Return

{
    "id": 0,
    "jsonrpc": "2.0",
    "result": {
        "baseFeePerGas": "0xaf3bff096",
        "difficulty": "0x2e241d0b086e63",
        "extraData": "0xe4b883e5bda9e7a59ee4bb99e9b1bc491321",
        "gasLimit": "0x1cb8de9",
        "gasUsed": "0xa7550e",
        "hash": "0x03512aadeff977a656714df25a7733958b89d94416f921f87d564bbcaf4109b8",
        "logsBloom": "0xbdac614029c05a215409b082aa990635b802d02a3844252828884e53972cc8a4033781acb085524d981c51880d2923e03b27bfd1dc0aa804b6249a708baca83e4462d4b7645089e9ddc3200811240c7423b43ad6da4e6e623a50bc09dd0b0fa5f68a8717227b0982ca6080590b2198cb1c76d910611414c4072cbeb244581614382510a2536412dd015d301d80080c190016c301c111c43c27af04cb08b0e80137cc218d25ac28a7090541b9c827820f882038d222b202b8b9df03071e501c147a09b2e7c190088518bc882ac5c46810644443019c0ac510e35965d216cae319247e29893bc45142a0159aa0211d1a8191c623423a8c17d096c0cda165293291",
        "miner": "0x829bd824b016326a401d083b33d092293333a830",
        "mixHash": "0xec1fb3ff8ac2ef1d2dd5ef71c5fbe7b8761aa1e7e6b7535ca576f0d8f0ebb30d",
        "nonce": "0x8d893eef1a4db275",
        "number": "0xdce69b",
        "parentHash": "0xfb24ab7afbe08621ffb62ed0e484beb7bac0c772c4af8edb3863a3ccda658c32",
        "receiptsRoot": "0xcd47fc085c567e83b3e1744bd1db57af00a25fb4440f3edc99218ea1b30eefcb",
        "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
        "size": "0xee9b",
        "stateRoot": "0x0608fba73076094e871fd1659f2b91ffcf2d0a67d578125d8f8253ff8eb11269",
        "timestamp": "0x624221e6",
        "totalDifficulty": "0x98464bf12831affd09f",
        "transactions": [
            "0x50c0c9fa8dc7bc959291132f6896ce03bec8fd10595d6c0275ea50dd8a89fa51",
            "0x09cc9bf33d43ac8b5bbf52c1ab3c2a15d62f2f2a62cacb8b060083708a923623",
            "0xff5fe55c6ad2aa34acd62d46b2623e756357dcb57f6a4fe7e9e820c23f778c34",
            "0x8f4dddafffd049e33000ccdd8eedd9dae100f53e655f4874c6c1298c83e00a4d",
            "0xf6f504bda56c4f376569d60af072f6f744f49ede4ea26d2ffb73fdf24b090dd9",
            ...
            "0xc0fdf5cefdb0a586f4b25472341fd92e7658d25f31740177ab051eca34f7fcd7",
            "0x2a8113c68c1655d42eadf2910621d75372d8445cb82c27eb34bb7858d330a97e",
            "0xcc42f07d4f238fe9402d875c492209f34c46b703e812d21f79bdca6b86923167",
            "0x88d81eac11fd22b6989853783a71089105cef5ad833dd333dab6798de51c8224",
            "0xd91d9b6e27ffa8fc5112893ad5d4552462ef6cec375097eab50d34f811718c65"
        ],
        "transactionsRoot": "0xe410e5887b3cdc9767024b2489569d8a68f76639d531b738ce5242e1ab53982e",
        "uncles": []
    }
}
Language
Click Try It! to start a request and see the response here!