---
updatedAt: 2025-09-18T22:06:30.000Z
agentTools:
  projectIndex: https://docs.nodereal.io/llms.txt
---

# eth_getBlockByNumber

Returns information about a block by block number.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "eth_getBlockByNumber - optimism",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://opt-mainnet.nodereal.io/v1"
    }
  ],
  "paths": {
    "/{apiKey}": {
      "post": {
        "operationId": "eth-getblockbynumber-optimism",
        "x-readme": {
          "explorer-enabled": false,
          "samples-languages": [
            "javascript",
            "curl",
            "python",
            "go"
          ]
        },
        "summary": "eth_getBlockByNumber",
        "description": "Returns information about a block by block number.",
        "parameters": [
          {
            "name": "apiKey",
            "in": "path",
            "schema": {
              "type": "string",
              "default": "1659dfb40aa24bbb8153a677b98064d7"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer",
                        "default": 1
                      },
                      "jsonrpc": {
                        "type": "string",
                        "default": "2.0"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "method": {
                        "type": "string",
                        "default": "eth_getBlockByNumber",
                        "enum": [
                          "eth_getBlockByNumber"
                        ]
                      },
                      "params": {
                        "type": "array",
                        "description": "1. String - Either the hex value of a **block number** OR One of the following **block tags**: \n    * `pending` - A sample next block built by the client on top of latest and containing the set of transactions usually taken from local mempool. Intuitively, you can think of these as blocks that have not been mined yet.\n    * `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.\n    * `safe` - The most recent crypto-economically secure block, cannot be re-orged outside of manual intervention driven by community coordination. Intuitively, this block is “unlikely” to be re-orged. **Only available on Ethereum Mainnet and Goerli**.\n    * `finalized` - The most recent crypto-economically secure block, that has been accepted by >2/3 of validators. Cannot be re-orged outside of manual intervention driven by community coordination. Intuitively, this block is very unlikely to be re-orged. **Only available on Ethereum Mainnet and Goerli**.\n    * `earliest` - The lowest numbered block the client has available. Intuitively, you can think of this as the first block created.\n2. Boolean - If `true` it returns the full transaction objects, if `false` only the hashes of the transactions. Defaults to `false`.\n",
                        "minItems": 2,
                        "maxItems": 2,
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Returns a block object with the following fields, or null when no block was found.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "jsonrpc": {
                          "type": "string"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "properties": {
                        "result": {
                          "allOf": [
                            {
                              "type": "object",
                              "properties": {
                                "nonce": {
                                  "type": "string",
                                  "description": "8 Bytes - hash of the generated proof-of-work. null when its pending block."
                                },
                                "hash": {
                                  "type": "string",
                                  "description": "32 Bytes - hash of the block. null when its pending block."
                                }
                              }
                            },
                            {
                              "type": "object",
                              "description": "A block object with the following fields, or null when no block was found.",
                              "properties": {
                                "number": {
                                  "type": "string",
                                  "description": "the block number. null when its pending block."
                                },
                                "parentHash": {
                                  "type": "string",
                                  "description": "32 Bytes - hash of the parent block."
                                },
                                "sha3Uncles": {
                                  "type": "string",
                                  "description": "32 Bytes - SHA3 of the uncles data in the block."
                                },
                                "logsBloom": {
                                  "type": "string",
                                  "description": "256 Bytes - the bloom filter for the logs of the block. null when its pending block."
                                },
                                "transactionsRoot": {
                                  "type": "string",
                                  "description": "32 Bytes - the root of the transaction trie of the block."
                                },
                                "stateRoot": {
                                  "type": "string",
                                  "description": "32 Bytes - the root of the final state trie of the block."
                                },
                                "receiptsRoot": {
                                  "type": "string",
                                  "description": "32 Bytes - the root of the receipts trie of the block."
                                },
                                "miner": {
                                  "type": "string",
                                  "description": "20 Bytes - the address of the beneficiary to whom the mining rewards were given."
                                },
                                "difficulty": {
                                  "type": "string",
                                  "description": "integer of the difficulty for this block."
                                },
                                "totalDifficulty": {
                                  "type": "string",
                                  "description": "integer of the total difficulty of the chain until this block."
                                },
                                "extraData": {
                                  "type": "string",
                                  "description": "the \"extra data\" field of this block."
                                },
                                "size": {
                                  "type": "string",
                                  "description": "integer the size of this block in bytes."
                                },
                                "gasLimit": {
                                  "type": "string",
                                  "description": "the maximum gas allowed in this block."
                                },
                                "gasUsed": {
                                  "type": "string",
                                  "description": "the total used gas by all transactions in this block."
                                },
                                "timestamp": {
                                  "type": "string",
                                  "description": "the unix timestamp for when the block was collated."
                                },
                                "transactions": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  },
                                  "description": "Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter."
                                },
                                "uncles": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  },
                                  "description": "Array of uncle hashes."
                                }
                              }
                            }
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```