eth_getBlockByNumber - Ethereum
eth_getBlockByNumber on Ethereum: returns a block by its number. Parameters, response and request example for the RPC Fast endpoint.
Returns a block by its number.
Parameters
block(string) — Block number as hex, or a tag:latest,earliest,pending,safe,finalizedfullTransactions(boolean) —truefor full transaction objects,falsefor hashes only
Returns
The block, as a block object: number, hash, parentHash, timestamp, miner, gasLimit, gasUsed, baseFeePerGas, stateRoot, transactionsRoot, receiptsRoot, logsBloom, transactions and other header fields; null if the block is unknown.
Example
Request
curl https://eth-mainnet.rpcfast.com/?api_key=<API_KEY> \
-X POST -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_getBlockByNumber","params":["0x192a337",false]}'Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"hash": "0xcb340ea929c555563cdb3c6db683fc96c6d015d0119c691c40f980b8b61c3eff",
"parentHash": "0x5c91eb3885f35bbc1030957ffc73667311a42961aae7b32fb587bb78d94bb77c",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"miner": "0xfb74767c1ce1aada0a0e114441173b57f8c1571b",
"stateRoot": "0x49d7f3b70a44b5d6a73cc8517dafc15317ee0bbdd2cb966c180d6c8ef90b310a",
"transactionsRoot": "0x2e4eaf40cc16020ad537f54a6bed6fd067a5676a1d05d2cf3dbefed7a2e9b117",
"receiptsRoot": "0x0b46bf68928863698d63585e63b3ab472f192374672ae3fb83e591da927587be",
"logsBloom": "0x0020040001060000004481288411c20208008208000410002800000100159d4000006001654003050014020048021500121060a10c06e25200040008002042…",
"difficulty": "0x0",
"number": "0x192a337",
"gasLimit": "0x3938700",
"gasUsed": "0x3659e5",
"timestamp": "0x6af38ef3",
"extraData": "0x457572656b612028657572656b616275696c6465722e78797a29",
"mixHash": "0x508d84d11d4e1bbdaac8efed45365a07f83b772038624753979a93eec10a9006",
"nonce": "0x0000000000000000",
"baseFeePerGas": "0x5c39819",
"withdrawalsRoot": "0x523bd2c74674dfefa5adae75a901b66293b0acdbc2888183a661a3810bb7ce67",
"blobGasUsed": "0x0",
"excessBlobGas": "0xacb6d9e",
"parentBeaconBlockRoot": "0x9afc863c7d41306e3364de3b5115145dc9f1b15a58da9f046f01de01faad7924",
"requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"size": "0x49f2",
"uncles": [],
"transactions": [
"0x20f6cbee4067a1b977016915b689e742f665158de4b631341a6877dac372ca14",
"0x258128dca08e888fcffd46f914ff4d39a0d92d97fafd682d21157cdeec9494e4",
"0x281a956dc1fda5e2f160b27d84a16f6c4415f3c53c64a873c1f75a3ddb75077a",
"… 40 more"
],
"withdrawals": [
{
"index": "0x8eb465b",
"validatorIndex": "0x4dbb2",
"address": "0xb9d7934878b5fb9610b3fe8a5e441e8fad7e293f",
"amount": "0xc0536d"
},
{
"index": "0x8eb465c",
"validatorIndex": "0x4dbb3",
"address": "0xb9d7934878b5fb9610b3fe8a5e441e8fad7e293f",
"amount": "0xc08209"
},
{
"index": "0x8eb465d",
"validatorIndex": "0x4dbb4",
"address": "0xb9d7934878b5fb9610b3fe8a5e441e8fad7e293f",
"amount": "0xc06204"
},
"… 13 more"
]
}
}See Compute Units for the price of this method on Ethereum.
Last updated