> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# eth_getBlockByNumber | Optimism

> Optimism API method that retrieves a block's information by its number. The block number is a sequential identifier for each block in the blockchain.

Optimism API method that retrieves a block's information by its number. The block number is a sequential identifier for each block in the blockchain.

## Parameters

* `blockNumber` — the number of the block to retrieve, encoded as a hexadecimal string. For example, `0x6f5f828` represents block number 116783144.
* `fullTransactionObjects` — a boolean indicating whether to return full transaction objects or only their hashes. If `true`, full transaction objects are returned; if `false`, only the hashes of the transactions are returned.

## Response

* `result` — an object containing the block's information, including the block number, timestamp, transactions, and more. If `fullTransactionObjects` is `true`, this will include detailed information about each transaction in the block.

## Use case

The `eth_getBlockByNumber` method is useful for applications that need to retrieve specific blocks from the blockchain based on their block number. This can include block explorers, wallets, or any application that requires detailed information about a particular block or its transactions.


## OpenAPI

````yaml openapi/optimism_node_api/eth_getBlockByNumber.json POST /efb0a5eccd2caa5135eb54eba6f7f300
openapi: 3.0.0
info:
  title: eth_getBlockByNumber example
  version: 1.0.0
  description: This is an API example for eth_getBlockByNumber.
servers:
  - url: https://optimism-mainnet.core.chainstack.com
security: []
paths:
  /efb0a5eccd2caa5135eb54eba6f7f300:
    post:
      tags:
        - Ethereum Operations
      summary: eth_getBlockByNumber
      operationId: getBlockByNumber
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  type: string
                  default: '2.0'
                method:
                  type: string
                  default: eth_getBlockByNumber
                id:
                  type: integer
                  default: 1
                params:
                  type: array
                  items:
                    anyOf:
                      - type: string
                        default: '0x6ecf0b4'
                      - type: boolean
                        default: true
                  default:
                    - '0x6ecf0b4'
                    - true
      responses:
        '200':
          description: The block information by number
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: object

````