Skip to main content
Version: Next

eth_getHeaderByNumber

Returns the execution header of the given block. Header fields introduced by a fork MUST be omitted for headers that predate that fork. The result is `null` if the block is unknown or if the `pending` tag is requested.

Returns information about a block header by number.

Parameters (by position)​

Block string or string required


Show Option 1 Block number string

Block number fields​

Block string required

Block number

Match pattern: ^0x(0|[1-9a-f][0-9a-f]*)$


Show Option 2 Block tag string

Block tag fields​

earliest: The lowest numbered block the client has available; finalized: The most recent crypto-economically secure block, cannot be re-orged outside of manual intervention driven by community coordination; safe: The most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions; latest: The most recent block in the canonical chain observed by the client, this block may be re-orged out of the canonical chain even under healthy/normal conditions; pending: A sample next block built by the client on top of latest and containing the set of transactions usually taken from local mempool. If the safe or finalized tag cannot be resolved to a block, the method responds as it does for an unknown block.

Block string required

earliest: The lowest numbered block the client has available; finalized: The most recent crypto-economically secure block, cannot be re-orged outside of manual intervention driven by community coordination; safe: The most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions; latest: The most recent block in the canonical chain observed by the client, this block may be re-orged out of the canonical chain even under healthy/normal conditions; pending: A sample next block built by the client on top of latest and containing the set of transactions usually taken from local mempool. If the safe or finalized tag cannot be resolved to a block, the method responds as it does for an unknown block.

Allowed values: earliest finalized safe latest pending


Result​

Header information null or object


Show Option 1 Not Found (null) null

Not Found (null) fields​

Header information null

Not Found (null)


Show Option 2 Header object object

Header object fields​

Header information object

Header object


Show Header information object

Header information fields​

  • baseFeePerGas string

    Base fee per gas

    Match pattern: ^0x(0|[1-9a-f][0-9a-f]*)$


  • blobGasUsed string

    Blob gas used

    Match pattern: ^0x(0|[1-9a-f][0-9a-f]*)$


  • blockAccessListHash string

    EIP-7928 block access list hash

    Match pattern: ^0x[0-9a-f]{64}$


  • difficulty string required

    Difficulty

    Match pattern: ^0x(0|[1-9a-f][0-9a-f]*)$


  • excessBlobGas string

    Excess blob gas

    Match pattern: ^0x(0|[1-9a-f][0-9a-f]*)$


  • extraData string required

    Extra data

    Match pattern: ^0x[0-9a-f]*$


  • gasLimit string required

    Gas limit

    Match pattern: ^0x(0|[1-9a-f][0-9a-f]*)$


  • gasUsed string required

    Gas used

    Match pattern: ^0x(0|[1-9a-f][0-9a-f]*)$


  • hash string required

    Hash

    Match pattern: ^0x[0-9a-f]{64}$


  • logsBloom string required

    Bloom filter

    Match pattern: ^0x[0-9a-f]{512}$


  • miner string required

    Coinbase

    Match pattern: ^0x[0-9a-fA-F]{40}$


  • mixHash string required

    Mix hash

    Match pattern: ^0x[0-9a-f]{64}$


  • nonce string required

    Nonce

    Match pattern: ^0x[0-9a-f]{16}$


  • number string required

    Number

    Match pattern: ^0x(0|[1-9a-f][0-9a-f]*)$


  • parentBeaconBlockRoot string

    Parent Beacon Block Root

    Match pattern: ^0x[0-9a-f]{64}$


  • parentHash string required

    Parent block hash

    Match pattern: ^0x[0-9a-f]{64}$


  • receiptsRoot string required

    Receipts root

    Match pattern: ^0x[0-9a-f]{64}$


  • requestsHash string

    EIP-7685 requests hash

    Match pattern: ^0x[0-9a-f]{64}$


  • sha3Uncles string required

    Ommers hash

    Match pattern: ^0x[0-9a-f]{64}$


  • slotNumber string

    EIP-7843 slot number

    Match pattern: ^0x(0|[1-9a-f][0-9a-f]{0,15})$


  • stateRoot string required

    State root

    Match pattern: ^0x[0-9a-f]{64}$


  • timestamp string required

    Timestamp

    Match pattern: ^0x(0|[1-9a-f][0-9a-f]*)$


  • transactionsRoot string required

    Transactions root

    Match pattern: ^0x[0-9a-f]{64}$


  • withdrawalsRoot string

    Withdrawals root

    Match pattern: ^0x[0-9a-f]{64}$


  • additionalProperties false


Errors​

Error code: 4444

  • code

    4444

  • message

    Pruned history unavailable

Examples​

eth_getHeaderByNumber example

Request​

{
"params": [
"0x68b3"
]
}

Response​

{
"baseFeePerGas": "0x7",
"blobGasUsed": "0x0",
"difficulty": "0x66e619a",
"excessBlobGas": "0x0",
"extraData": "0xd583010502846765746885676f312e37856c696e7578",
"gasLimit": "0x47e7c4",
"gasUsed": "0x37993",
"hash": "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c",
"logsBloom": "0x00000000000000100000004080000000000500000000000000020000100000000800001000000004000001000000000000000800040010000020100000000400000010000000000000000040000000000000040000000000000000000000000000000400002400000000000000000000000000000004000004000000000000840000000800000080010004000000001000000800000000000000000000000000000000000800000000000040000000020000000000000000000800000400000000000000000000000600000400000000002000000000000000000000004000000000000000100000000000000000000000000000000000040000900010000000",
"miner": "0xb42b6c4a95406c78ff892d270ad20b22642e102d",
"mixHash": "0x24900fb3da77674a861c428429dce0762707ecb6052325bbd9b3c64e74b5af9d",
"nonce": "0x378da40ff335b070",
"number": "0x68b3",
"parentBeaconBlockRoot": "0x95c4dbd5b19f6fe3cbc3183be85ff4e85ebe75c5b4fc911f1c91e5b7a554a685",
"parentHash": "0x1f68ac259155e2f38211ddad0f0a15394d55417b185a93923e2abe71bb7a4d6d",
"receiptsRoot": "0x68461ab700003503a305083630a8fb8d14927238f0bc8b6b3d246c0c64f21f4a",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"stateRoot": "0x91309efa7e42c1f137f31fe9edbe88ae087e6620d0d59031324da3e2f4f93233",
"timestamp": "0x5835c54d",
"transactionsRoot": "0x4d0c8e91e16bdff538c03211c5c73632ed054d00a7e210c0eb25146c20048126",
"withdrawalsRoot": "0x7a4ecf19774d15cf9c15adf0dd8e8a250c128b26c9e2ab2a08d6c9c8ffbd104f"
}