Returns information about a block by number.


Command Shell
curl https://bsc-<network>
-H "Content-Type: application/json"
-d "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockByNumber\",\"params\": [\"0x6F3225\", false],\"id\":1}"
curl -X POST 'https://bsc-<network>' \
-H 'Content-Type: application/json' \
--data-raw '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params": ["0x6F3225", false],"id":1}'
  1. 1.
    BLOCK PARAMETER - An int block number in the form of hex, appended with 0x such as 0x6D7FE0, or pre-defined strings latest, earliest, pending.
  2. 2.
    SHOW TRANSACTION DETAILS FLAG - A boolean parameter. When true, returns the full transaction information of each transaction hash included within the block. When false, only returns transaction hashes within the block.
Web3API's Composer accepts int block numbers, which will be auto-converted to a hex representation before being sent to a node.
Result Fields
BLOCK - A block object, or null when no block was found with the number specified.
Within the block object, the following block information are available.
  1. 1.
    difficulty: integer of the difficulty for this block.
  2. 2.
    extraData: the "extra data" field of this block.
  3. 3.
    gasLimit: the maximum gas allowed in this block.
  4. 4.
    gasUsed: the total used gas by all transactions in this block.
  5. 5.
    hash: 32 Bytes - hash of the block. Null when the returned block is the pending block.
  6. 6.
    logsBloom: 256 Bytes - the bloom filter for the logs of the block. Null when the returned block is the pending block.
  7. 7.
    miner: 20 Bytes - the address of the beneficiary to whom the mining rewards were given.
  8. 8.
    mixHash -
  9. 9.
    nonce: 8 Bytes - hash of the generated proof-of-work. Null when the returned block is the pending block.
  10. 10.
    number: the block number. Null when the returned block is the pending block.
  11. 11.
    parentHash: 32 Bytes - hash of the parent block.
  12. 12.
    receiptsRoot: 32 Bytes - the root of the receipts trie of the block.
  13. 13.
    sha3Uncles: 32 Bytes - SHA3 of the uncles data in the block.
  14. 14.
    size: integer the size of this block in bytes.
  15. 15.
    stateRoot: 32 Bytes - the root of the final state trie of the block.
  16. 16.
    timestamp: the unix timestamp for when the block was collated.
  17. 17.
    totalDifficulty: integer of the total difficulty of the chain until this block.
  18. 18.
    transactions: Array - Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter.
  19. 19.
    transactionsRoot: 32 Bytes - the root of the transaction trie of the block.
  20. 20.
    uncles: an Array of uncle hashes.