eth_getBlockByNumber

Returns information about a block by block number.

Parameters

  1. QUANTITY|TAG - integer of a block number, or the string "earliest", "latest" or "pending", as in the default block parameter.
  2. BOOLEAN - If true it returns the full transaction objects, if false only the hashes of the transactions.
curl https://ethereum-mainnet-rpc.allthatnode.com/8U3JLUhzIDg3GShvy9hkCCSYkLGc11kj \
--request POST \
--header "Content-Type: application/json" \
--data '{
    "jsonrpc":"2.0",
    "id":1,
    "method":"eth_getBlockByNumber",
    "params":[
       "0x1b434",
       true
    ]
}'

Returns

  • Object - A block object, 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.
{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "difficulty": "0x40b2af4ef00",
        "extraData": "0x476574682f76312e302e312d38326566323666362f6c696e75782f676f312e34",
        "gasLimit": "0x2fefd8",
        "gasUsed": "0x5208",
        "hash": "0xac802f6265e1485906ac7e0c0e34c3ccc387a3d75ddb6842b571fb9fc5985517",
        "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "miner": "0xe6a7a1d47ff21b6321162aea7c6cb457d5476bca",
        "mixHash": "0x99f7d9fa0249066780c7805f6f6af44113cd587659fdb4805f4d53c2c45d2f48",
        "nonce": "0x0e03aca1bc98d365",
        "number": "0x1b434",
        "parentHash": "0x947e6f0592cd5fc4bc21c4cdf4ab77890faf091128fed5dfc666f3bbec255f73",
        "receiptsRoot": "0xb4e6598c13d51f18b9749b8a04e5ce097833ff0a2ce48a2eb38bc4d3361f5ff6",
        "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
        "size": "0x296",
        "stateRoot": "0xe2c02709f7abe280875daa6ad1604b2c6716f1833d9e65ac74196bc23d462719",
        "timestamp": "0x55d490c9",
        "totalDifficulty": "0x30a2cdae54440ca",
        "transactions": [
            {
                "blockHash": "0xac802f6265e1485906ac7e0c0e34c3ccc387a3d75ddb6842b571fb9fc5985517",
                "blockNumber": "0x1b434",
                "from": "0xb2cc35a981a37f727c203350f78142cecb16fb45",
                "gas": "0x61a8",
                "gasPrice": "0xd6b187d36",
                "hash": "0xbe7bfb6dc5935a59c97676d140537ecff0f28cbf5e9b34574c66e75efc70bd72",
                "input": "0x",
                "nonce": "0x4",
                "to": "0x34fdf2118f88a297b3750fad5eeb307808d08378",
                "transactionIndex": "0x0",
                "value": "0x4ed369e7f4380000",
                "type": "0x0",
                "v": "0x1c",
                "r": "0x88a1c924f7ed115f90d30148835ed2e09777d10fcc5c0be7f34a53f2c83bb8ad",
                "s": "0x36a6f66261a4bd3f313757005d42fd261b3b483ae536f66883003f52f8bb8d2f"
            }
        ],
        "transactionsRoot": "0x6b5dbbb65acc18b17eb312f1ea873562d6f17596c294cde2acdbf673e311afa2",
        "uncles": []
    }
}

Try Yourself

Language
Click Try It! to start a request and see the response here!