eth_getBlockByNumber

Returns information about a block by block number.

Parameters

Object NameRequiredTypeDetail
BLOCK PARAMETERString/ObjectA hex code of an integer that represents the block number, "latest", "earliest" , "pending" , or hash of a block. The hash of a block is an object specified as: {"blockHash": "\<hash_value>"}. Learn more here.
SHOW TRANSACTION DETAILSBooleanIf set true , it returns the full transaction objects; if set false , it returns only the transaction hashes.
"params": [
    "0xdce69b",
    true
]

Result

A block object, or null when 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_getBlockByNumber","params":["0xdce69b", 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": [
            {
                "accessList": [
                    {
                        "address": "0x132a6e4fd04b862a83bf95127d23be2c3ab28502",
                        "storageKeys": [
                            "0x9c04773acff4c5c42718bd0120c72761f458e43068a3961eb935577d1ed4effb",
                            "0x0000000000000000000000000000000000000000000000000000000000000008",
                            "0x0000000000000000000000000000000000000000000000000000000000000000",
                            "0x0000000000000000000000000000000000000000000000000000000000000004",
                            "0x0000000000000000000000000000000000000000000000000000000000000002"
                        ]
                    },
                    {
                        "address": "0x9ab7bb7fdc60f4357ecfef43986818a2a3569c62",
                        "storageKeys": [
                            "0x4f3d32a6466af317ba79d742bd642e0d05f4bcf70dfcc7b30862a4cf8e7bc1ca",
                            "0xd7fa724607f0099a23af608d4349fa746ec3dc5c61ec2cb8c207e33f2fb2263d"
                        ]
                    },
                    {
                        "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                        "storageKeys": [
                            "0x37556f0fb4e18aeca81b9fcd32bc0671f82ce7ed07cafcc2b74f15592cd1044a",
                            "0x773a7876937c5ed0f82d77c27cb4373ce23050c0426752349794d61a1fbf51c6",
                            "0x99884f3adc166cb6bcbe49586c2a7fa85a9a620dd0f05f3f129d14caaeacb523"
                        ]
                    },
                    {
                        "address": "0x5c596c6a65f628fc1090853d8eb1927651e9d9b2",
                        "storageKeys": [
                            "0x000000000000000000000000000000000000000000000000000000000000000c",
                            "0x0000000000000000000000000000000000000000000000000000000000000008",
                            "0x0000000000000000000000000000000000000000000000000000000000000006",
                            "0x0000000000000000000000000000000000000000000000000000000000000007",
                            "0x0000000000000000000000000000000000000000000000000000000000000009",
                            "0x000000000000000000000000000000000000000000000000000000000000000a"
                        ]
                    }
                ],
                "blockHash": "0x03512aadeff977a656714df25a7733958b89d94416f921f87d564bbcaf4109b8",
                "blockNumber": "0xdce69b",
                "chainId": "0x1",
                "from": "0x26ccc3a2052be5898d60683c7bb621047153bb19",
                "gas": "0x3a41f",
                "gasPrice": "0xbf1083598",
                "hash": "0x50c0c9fa8dc7bc959291132f6896ce03bec8fd10595d6c0275ea50dd8a89fa51",
                "input": "0x0000000efb24ab7a5c596c6a65f628fc1090853d8eb1927651e9d9b20000000000000000132a6e4fd04b862a83bf95127d23be2c3ab28502002710000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000009ab7bb7fdc60f4357ecfef43986818a2a3569c62000000000000000005e14d4fd67bc1da00000000000000898ec62c43354b51e800000000000000000000000000000000000000000000000005fb6da2043de4e6",
                "maxFeePerGas": "0xbf1083598",
                "maxPriorityFeePerGas": "0xbf1083598",
                "nonce": "0x9267",
                "r": "0xf1e380635c9e4755c9887d5efc62288315c5e0385fe6ea9198d47b45d1ede14b",
                "s": "0x5e320e5ded60d5a7ee255461db1d83b6377b078f209a687e155a76a8c93f36b0",
                "to": "0x000000000035b5e5ad9019092c665357240f594e",
                "transactionIndex": "0x0",
                "type": "0x2",
                "v": "0x0",
                "value": "0x0"
            },
            {
                "accessList": [],
                "blockHash": "0x03512aadeff977a656714df25a7733958b89d94416f921f87d564bbcaf4109b8",
                "blockNumber": "0xdce69b",
                "chainId": "0x1",
                "from": "0xc7e51b9d14ce8a2767d4df462af56923064e2e36",
                "gas": "0xb6c7",
                "gasPrice": "0xb4d281f96",
                "hash": "0x09cc9bf33d43ac8b5bbf52c1ab3c2a15d62f2f2a62cacb8b060083708a923623",
                "input": "0xa22cb4650000000000000000000000002cd3357a6be1c8c132edafa022dae0c82379e4c30000000000000000000000000000000000000000000000000000000000000001",
                "maxFeePerGas": "0xef9c21629",
                "maxPriorityFeePerGas": "0x59682f00",
                "nonce": "0x59",
                "r": "0x27a4c28947cfa5c7fdc236cd3977071780171cadb5b6ad2a761cca654aebaf12",
                "s": "0xf1c1a957ac3ccf8e6665446c982193b8313f479dd6ed270e5d06e3a9e02a422",
                "to": "0x66fca7555cd481545a5e66ba9a2bec1e256f98e7",
                "transactionIndex": "0x1",
                "type": "0x2",
                "v": "0x1",
                "value": "0x0"
            },
            ...
            {
                "accessList": [],
                "blockHash": "0x03512aadeff977a656714df25a7733958b89d94416f921f87d564bbcaf4109b8",
                "blockNumber": "0xdce69b",
                "chainId": "0x1",
                "from": "0xcad621da75a66c7a8f4ff86d30a2bf981bfc8fdd",
                "gas": "0x15f90",
                "gasPrice": "0xb40ad0728",
                "hash": "0x88d81eac11fd22b6989853783a71089105cef5ad833dd333dab6798de51c8224",
                "input": "0x",
                "maxFeePerGas": "0x284097ada3",
                "maxPriorityFeePerGas": "0x4ced1692",
                "nonce": "0x5d28c",
                "r": "0xf6cd03300634527b38bfd7c486464d2c394c2b99ad7a2bd285d3962d7eac4790",
                "s": "0x4a851500e7c1005c95a277d6e2e77ab881b6e69ac2a70d9a919423f47d327679",
                "to": "0x6df89d582292d1f4e9c10fa943ae0af83df0c048",
                "transactionIndex": "0xa2",
                "type": "0x2",
                "v": "0x1",
                "value": "0x1231a1aa73c000"
            },
            {
                "accessList": [],
                "blockHash": "0x03512aadeff977a656714df25a7733958b89d94416f921f87d564bbcaf4109b8",
                "blockNumber": "0xdce69b",
                "chainId": "0x1",
                "from": "0x8d056d457a52c4daf71cef45f540a040c143ea05",
                "gas": "0x5208",
                "gasPrice": "0xb2f5aba96",
                "hash": "0xd91d9b6e27ffa8fc5112893ad5d4552462ef6cec375097eab50d34f811718c65",
                "input": "0x",
                "maxFeePerGas": "0x105020b779",
                "maxPriorityFeePerGas": "0x3b9aca00",
                "nonce": "0x4019",
                "r": "0x2a0354e64fd787b1430b03601857f1e8975059902082b1b18bcf0eaf1b9c6011",
                "s": "0x418482a1977bec327ce2fc6338707c738dd9d32587850e6bbf3972bdde2876f5",
                "to": "0x4998c445825416e65115ba8d206d5d612d07b654",
                "transactionIndex": "0xa3",
                "type": "0x2",
                "v": "0x0",
                "value": "0xb3a925a64aa000"
            }
        ],
        "transactionsRoot": "0xe410e5887b3cdc9767024b2489569d8a68f76639d531b738ce5242e1ab53982e",
        "uncles": []
    }
}
Language
Click Try It! to start a request and see the response here!