Skip to main content

eth_getBlockByNumber

Returns information about a block 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. Before the merge transition is finalized, any call querying for finalized or safe block MUST be responded to with -39001: Unknown block error

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. Before the merge transition is finalized, any call querying for finalized or safe block MUST be responded to with -39001: Unknown block error

Allowed values: earliest finalized safe latest pending


Hydrated transactions boolean required


Result

Block information null or object


Show Option 1 Not Found (null) null

Not Found (null) fields

Block information null

Not Found (null)


Show Option 2 Block object object

Block object fields

Block information object

Block object


Show Block information object

Block information fields

  • hash string required

    Hash

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


  • parentHash string required

    Parent block hash

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


  • sha3Uncles string required

    Ommers hash

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


  • miner string required

    Coinbase

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


  • stateRoot string required

    State root

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


  • transactionsRoot string required

    Transactions root

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


  • receiptsRoot string required

    Receipts root

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


  • logsBloom string required

    Bloom filter

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


  • difficulty string

    Difficulty

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


  • number string required

    Number

    Match pattern: ^0x(0|[1-9a-f][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]*)$


  • timestamp string required

    Timestamp

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


  • extraData string required

    Extra data

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


  • mixHash string required

    Mix hash

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


  • nonce string required

    Nonce

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


  • baseFeePerGas string

    Base fee per gas

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


  • withdrawalsRoot string

    Withdrawals root

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


  • blobGasUsed string

    Blob gas used

    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]*)$


  • parentBeaconBlockRoot string

    Parent Beacon Block Root

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


  • size string required

    Block size

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


  • transactions array<string> or array<object> required


    Show Option 1 Transaction hashes array

    Transaction hashes fields

    transactions array<string> required

    32 byte hex value

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


    Show Option 2 Full transactions array

    Full transactions fields

    transactions object or object or object or object or object required


    Show Option 1 Signed 7702 Transaction object

    Signed 7702 Transaction fields

    transactions array<object> required

    Signed 7702 Transaction


    Show transactions object

    transactions fields

    • type string required

      type

      Match pattern: ^0x4$


    • nonce string required

      nonce

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


    • to string required

      to address

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


    • gas string required

      gas limit

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


    • value string required

      value

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


    • input string required

      input data

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


    • maxPriorityFeePerGas string required

      Maximum fee per gas the sender is willing to pay to miners in wei

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


    • maxFeePerGas string required

      The maximum total fee per gas the sender is willing to pay (includes the network / base fee and miner / priority fee) in wei

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


    • gasPrice string

      The effective gas price paid by the sender in wei. For transactions not yet included in a block, this value should be set equal to the max fee per gas. This field is DEPRECATED, please transition to using effectiveGasPrice in the receipt object going forward.

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


    • accessList array<object> required

      EIP-2930 access lists


      Show accessList object

      accessList fields

      EIP-2930 access lists

      • address string required

        hex encoded address

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


      • storageKeys array<string> required

        32 byte hex value

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


      • additionalProperties false


    • chainId string required

      Chain ID that this transaction is valid on

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


    • authorizationList array<object> required

      List of authorizations for the transaction


      Show authorizationList object

      authorizationList fields

      List of authorizations for the transaction

      • chainId string required

        Chain ID on which this transaction is valid

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


      • nonce string required

        nonce

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


      • address string required

        hex encoded address

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


      • yParity string required

        The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature

        Match pattern: ^0x([0-9a-fA-F]?){1,2}$


      • r string required

        r

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


      • s string required

        s

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


      • additionalProperties true


    • yParity string required

      The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature.

      Match pattern: ^0x([0-9a-fA-F]?){1,2}$


    • v string

      For backwards compatibility, v is optionally provided as an alternative to yParity. This field is DEPRECATED and all use of it should migrate to yParity.

      Match pattern: ^0x([0-9a-fA-F]?){1,2}$


    • r string required

      r

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


    • s string required

      s

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


    • additionalProperties true


    Show Option 2 Signed 4844 Transaction object

    Signed 4844 Transaction fields

    transactions array<object> required

    Signed 4844 Transaction


    Show transactions object

    transactions fields

    • type string required

      type

      Match pattern: ^0x3$


    • nonce string required

      nonce

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


    • to string required

      to address

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


    • gas string required

      gas limit

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


    • value string required

      value

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


    • input string required

      input data

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


    • maxPriorityFeePerGas string required

      Maximum fee per gas the sender is willing to pay to miners in wei

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


    • maxFeePerGas string required

      The maximum total fee per gas the sender is willing to pay (includes the network / base fee and miner / priority fee) in wei

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


    • maxFeePerBlobGas string required

      The maximum total fee per gas the sender is willing to pay for blob gas in wei

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


    • gasPrice string

      The effective gas price paid by the sender in wei. For transactions not yet included in a block, this value should be set equal to the max fee per gas. This field is DEPRECATED, please transition to using effectiveGasPrice in the receipt object going forward.

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


    • accessList array<object> required

      EIP-2930 access list


      Show accessList object

      accessList fields

      EIP-2930 access list

      • address string required

        hex encoded address

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


      • storageKeys array<string> required

        32 byte hex value

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


      • additionalProperties false


    • blobVersionedHashes array<string> required

      List of versioned blob hashes associated with the transaction's EIP-4844 data blobs

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


    • chainId string required

      Chain ID that this transaction is valid on

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


    • yParity string required

      The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature.

      Match pattern: ^0x([0-9a-fA-F]?){1,2}$


    • v string

      For backwards compatibility, v is optionally provided as an alternative to yParity. This field is DEPRECATED and all use of it should migrate to yParity.

      Match pattern: ^0x([0-9a-fA-F]?){1,2}$


    • r string required

      r

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


    • s string required

      s

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


    • additionalProperties true


    Show Option 3 Signed 1559 Transaction object

    Signed 1559 Transaction fields

    transactions array<object> required

    Signed 1559 Transaction


    Show transactions object

    transactions fields

    • type string required

      type

      Match pattern: ^0x2$


    • nonce string required

      nonce

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


    • to null or string


      Show Option 1 Contract Creation (null) null

      Contract Creation (null) fields

      to null

      Contract Creation (null)


      Show Option 2 Address string

      Address fields

      to string

      Address

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


    • gas string required

      gas limit

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


    • value string required

      value

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


    • input string required

      input data

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


    • maxPriorityFeePerGas string required

      Maximum fee per gas the sender is willing to pay to miners in wei

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


    • maxFeePerGas string required

      The maximum total fee per gas the sender is willing to pay (includes the network / base fee and miner / priority fee) in wei

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


    • gasPrice string required

      The effective gas price paid by the sender in wei. For transactions not yet included in a block, this value should be set equal to the max fee per gas. This field is DEPRECATED, please transition to using effectiveGasPrice in the receipt object going forward.

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


    • accessList array<object> required

      EIP-2930 access list


      Show accessList object

      accessList fields

      EIP-2930 access list

      • address string required

        hex encoded address

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


      • storageKeys array<string> required

        32 byte hex value

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


      • additionalProperties false


    • chainId string required

      Chain ID that this transaction is valid on.

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


    • yParity string required

      The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature.

      Match pattern: ^0x([0-9a-fA-F]?){1,2}$


    • v string

      For backwards compatibility, v is optionally provided as an alternative to yParity. This field is DEPRECATED and all use of it should migrate to yParity.

      Match pattern: ^0x([0-9a-fA-F]?){1,2}$


    • r string required

      r

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


    • s string required

      s

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


    • additionalProperties true


    Show Option 4 Signed 2930 Transaction object

    Signed 2930 Transaction fields

    transactions array<object> required

    Signed 2930 Transaction


    Show transactions object

    transactions fields

    • type string required

      type

      Match pattern: ^0x1$


    • nonce string required

      nonce

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


    • to null or string


      Show Option 1 Contract Creation (null) null

      Contract Creation (null) fields

      to null

      Contract Creation (null)


      Show Option 2 Address string

      Address fields

      to string

      Address

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


    • gas string required

      gas limit

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


    • value string required

      value

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


    • input string required

      input data

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


    • gasPrice string required

      The gas price willing to be paid by the sender in wei

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


    • accessList array<object> required

      EIP-2930 access list


      Show accessList object

      accessList fields

      EIP-2930 access list

      • address string required

        hex encoded address

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


      • storageKeys array<string> required

        32 byte hex value

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


      • additionalProperties false


    • chainId string required

      Chain ID that this transaction is valid on.

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


    • yParity string required

      The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature.

      Match pattern: ^0x([0-9a-fA-F]?){1,2}$


    • v string

      For backwards compatibility, v is optionally provided as an alternative to yParity. This field is DEPRECATED and all use of it should migrate to yParity.

      Match pattern: ^0x([0-9a-fA-F]?){1,2}$


    • r string required

      r

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


    • s string required

      s

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


    • additionalProperties true


    Show Option 5 Signed Legacy Transaction object

    Signed Legacy Transaction fields

    transactions array<object> required

    Signed Legacy Transaction


    Show transactions object

    transactions fields

    • type string required

      type

      Match pattern: ^0x0$


    • nonce string required

      nonce

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


    • to null or string


      Show Option 1 Contract Creation (null) null

      Contract Creation (null) fields

      to null

      Contract Creation (null)


      Show Option 2 Address string

      Address fields

      to string

      Address

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


    • gas string required

      gas limit

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


    • value string required

      value

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


    • input string required

      input data

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


    • gasPrice string required

      The gas price willing to be paid by the sender in wei

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


    • chainId string

      Chain ID that this transaction is valid on.

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


    • v string required

      v

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


    • r string required

      r

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


    • s string required

      s

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


    • additionalProperties true


  • withdrawals array<object>

    Validator withdrawal


    Show withdrawals object

    withdrawals fields

    • index string required

      index of withdrawal

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


    • validatorIndex string required

      index of validator that generated withdrawal

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


    • address string required

      recipient address for withdrawal value

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


    • amount string required

      value contained in withdrawal

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


    • additionalProperties false


  • uncles array<string> required

    32 byte hex value

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


  • requestsHash string

    EIP-7685 requests hash

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


  • additionalProperties true


Errors

Error code: 4444

  • code

    4444

  • message

    Pruned history unavailable

Examples

eth_getBlockByNumber example

Request

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

Response

{
"number": "0x68b3",
"hash": "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c",
"mixHash": "0x24900fb3da77674a861c428429dce0762707ecb6052325bbd9b3c64e74b5af9d",
"parentHash": "0x1f68ac259155e2f38211ddad0f0a15394d55417b185a93923e2abe71bb7a4d6d",
"nonce": "0x378da40ff335b070",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"logsBloom": "0x00000000000000100000004080000000000500000000000000020000100000000800001000000004000001000000000000000800040010000020100000000400000010000000000000000040000000000000040000000000000000000000000000000400002400000000000000000000000000000004000004000000000000840000000800000080010004000000001000000800000000000000000000000000000000000800000000000040000000020000000000000000000800000400000000000000000000000600000400000000002000000000000000000000004000000000000000100000000000000000000000000000000000040000900010000000",
"transactionsRoot": "0x4d0c8e91e16bdff538c03211c5c73632ed054d00a7e210c0eb25146c20048126",
"stateRoot": "0x91309efa7e42c1f137f31fe9edbe88ae087e6620d0d59031324da3e2f4f93233",
"receiptsRoot": "0x68461ab700003503a305083630a8fb8d14927238f0bc8b6b3d246c0c64f21f4a",
"miner": "0xb42b6c4a95406c78ff892d270ad20b22642e102d",
"difficulty": "0x66e619a",
"extraData": "0xd583010502846765746885676f312e37856c696e7578",
"size": "0x334",
"gasLimit": "0x47e7c4",
"gasUsed": "0x37993",
"timestamp": "0x5835c54d",
"uncles": [],
"transactions": [
"0xa0807e117a8dd124ab949f460f08c36c72b710188f01609595223b325e58e0fc",
"0xeae6d797af50cb62a596ec3939114d63967c374fa57de9bc0f4e2b576ed6639d"
],
"baseFeePerGas": "0x7",
"withdrawalsRoot": "0x7a4ecf19774d15cf9c15adf0dd8e8a250c128b26c9e2ab2a08d6c9c8ffbd104f",
"withdrawals": [
{
"index": "0x0",
"validatorIndex": "0x9d8c0",
"address": "0xb9d7934878b5fb9610b3fe8a5e441e8fad7e293f",
"amount": "0x11a33e3760"
}
],
"blobGasUsed": "0x0",
"excessBlobGas": "0x0",
"parentBeaconBlockRoot": "0x95c4dbd5b19f6fe3cbc3183be85ff4e85ebe75c5b4fc911f1c91e5b7a554a685"
}