Returns information about a block by block number.
Supported on both BNB Smart Chain and opBNB Chain.
API Endpoint
The format of a BNB Smart Chain endpoint:
https://bsc-mainnet.nodereal.io/v1/{{apiKey}}
https://bsc-testnet.nodereal.io/v1/{{apiKey}}
The format of an opBNB Chain endpoint:
https://opbnb-mainnet.nodereal.io/v1/{{apiKey}}
https://opbnb-testnet.nodereal.io/v1/{{apiKey}}
Parameters
blockNumber/tag
- string - The block number in hexadecimal format or the string latest, earliest, pending, safe or finalizedtransaction detail flag
- boolean - (default: false) The method returns the full transaction objects when this value is true otherwise, it returns only the hashes of the transactions
Returns
object
- A block object, or null when no block was founddifficulty
- The integer of the difficulty for this block encoded as a hexadecimalextraData
- The “extra data” field of this blockgasLimit
- The maximum gas allowed in this block encoded as a hexadecimalgasUsed
- The total used gas by all transactions in this block encoded as a hexadecimalhash
- The block hash of the requested block. null if pendinglogsBloom
- The bloom filter for the logs of the block. null if pendingminer
- The address of the beneficiary to whom the mining rewards were givenmixHash
- A string of a 256-bit hash encoded as a hexadecimalnonce
- The hash of the generated proof-of-work. null if pendingnumber
- The block number of the requested block encoded as a hexadecimal. null if pendingparentHash
- The hash of the parent blockreceiptsRoot
- The root of the receipts trie of the blocksha3Uncles
- The SHA3 of the uncles data in the blocksize
- The size of this block in bytes as an Integer value encoded as hexadecimalstateRoot
- The root of the final state trie of the blocktimestamp
- The unix timestamp for when the block was collatedtotalDifficulty
- The integer of the total difficulty of the chain until this block encoded as a hexadecimaltransactions
- An array of transaction objects - please see eth_getTransactionByHash for exact shapetransactionsRoot
- The root of the transaction trie of the blockuncles
- An array of uncle hashes
Example
Request
curl https://bsc-mainnet.nodereal.io/v1/{{apiKey}} \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_getBlockByNumber","params":["0xc5043f",false],"id":1,"jsonrpc":"2.0"}'