eth_getBlockByNumber - Ethereum

eth_getBlockByNumber. Retrieves detailed information about a specific block on the Ethereum blockchain by its number

eth_getBlockByNumber - ethereum [Value: 24CU]
Retrieves detailed information about a specific block on the blockchain by its number
Use cases

Use cases

  • Verify transactions in a specific block
  • Compare block details for node sync
  • Monitor contract events for off-chain triggers
Constraints

Constraints

  • Response delays due to network latency
  • Slight data discrepancies until finality
  • Strain on resources with frequent requests
Get started
Unlock Access to 50+ chains
Boost your app's speed and reliability with dRPC - get your access API key

Language

Request
Examples
curl --request POST \
    --url https://eth.drpc.org \
    --header 'accept: application/json' \
    --header 'content-type: application/json' \
    --data '
{
 "id": 1,
 "jsonrpc": "2.0",
 "method": "eth_getBlockByNumber",
 "params": [
   "finalized",
   false
 ]
}
'
Copy
Response
200
{
  "jsonrpc": "2.0",
  "id": 0,
  "result": {
    "number": "0x1b4",
    "difficulty": "0x4ea3f27bc",
    "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32",
    "gasLimit": "0x1388",
    "gasUsed": "0x0",
    "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae",
    "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171",
    "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843",
    "nonce": "0x689056015818adbe",
    "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54",
    "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
    "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
    "size": "0x220",
    "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d",
    "timestamp": "0x55ba467c",
    "totalDifficulty": "0x78ed983323d",
    "transactions": [],
    "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
    "uncles": []
  }
}
Copy

Request params

idinteger
jsonrpcstring
methodstring
Parametersarray
array
blockNumberstring
The block number or tag ("latest", "earliest", "pending") at which to get the balance.
  • latest [default] - The most recent block in the blockchain (default).
  • safe - A block that has been validated by the beacon chain.
  • finalized - a block confirmed by over two-thirds of validators
  • earliest - A block approved by more than two-thirds of the validators.
  • pending - Transactions that have been broadcast but not yet included in a block.
transaction_detail_flagboolean
If set to true, returns the full transaction objects for all transactions in the block; if false, returns only the transaction hashes.

Response

200
The block object if the block is found, containing detailed information such as block hash, parent hash, miner, transactions, gas used, and more. If the block is not found, it returns null.

Response params

object
baseFeePerGasstring
Hexadecimal string of the base fee per gas. Not included for blocks before the EIP-1559 upgrade.
difficultyinteger
The block's difficulty level, encoded as a hexadecimal.
extraDatastring
Additional data field of the block.
gasLimitstring
Maximum gas allowed in the block, in hexadecimal.
gasUsedstring
Total gas used by all transactions in the block, in hexadecimal.
hashstring
Hash of the block, null if pending.
logsBloomstring
Bloom filter for the block's logs, null if pending.
minerstring
Address of the block's mining reward beneficiary.
mixHashstring
256-bit hash as a hexadecimal string.
noncestring
Proof-of-work hash, null if pending.
numberstring
Block number as a hexadecimal, null if pending.
parentHashstring
Hash of the parent block.
receiptsRootstring
Root of the block's receipts trie.
sha3Unclesstring
SHA3 hash of the block's uncles data.
sizestring
Size of the block in bytes, as a hexadecimal integer.
stateRootstring
Root of the block's final state trie.
timestampstring
UNIX timestamp of the block's collation.
totalDifficultystring
Total difficulty of the blockchain up to this block, in hexadecimal.
transactionsarray
List of transaction objects; refer to eth_getTransactionByHash for details.
transactionsRootstring
Root of the block's transaction trie.
unclesarray
List of uncle block hashes.