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

# Get the latest block number

> Returns the latest block number as a hex-encoded string in a JSON-RPC 2.0 response.




## OpenAPI

````yaml /openapi-specs/pro-api-v11.yaml get /legacy/block/eth-block-number
openapi: 3.0.0
info:
  contact:
    email: info@blockscout.com
  title: Blockscout
  version: 11.0.3
servers:
  - url: http://localhost/api
    variables: {}
security: []
tags:
  - name: blocks
  - name: transactions
  - name: addresses
  - name: internal-transactions
  - name: tokens
  - name: token-transfers
  - name: smart-contracts
  - name: config
  - name: main-page
  - name: search
  - name: stats
  - name: csv-export
  - name: account-abstraction
  - name: withdrawals
  - name: advanced-filters
  - name: arbitrum
  - name: legacy
  - name: optimism
  - name: mud
  - name: celo
  - name: scroll
  - name: zilliqa
paths:
  /legacy/block/eth-block-number:
    get:
      tags:
        - legacy
      summary: Get the latest block number
      description: >
        Returns the latest block number as a hex-encoded string in a JSON-RPC
        2.0 response.
      operationId: BlockScoutWeb.API.Legacy.BlockController.eth_block_number
      parameters:
        - description: >-
            JSON-RPC request id echoed back in the response. Defaults to 1 when
            omitted.
          in: query
          name: id
          schema:
            anyOf:
              - type: integer
                x-struct: null
                x-validate: null
              - type: string
                x-struct: null
                x-validate: null
            x-struct: null
            x-validate: null
        - description: API key for rate limiting or for sensitive endpoints
          in: query
          name: apikey
          required: false
          schema:
            type: string
            x-struct: null
            x-validate: null
        - description: Secret key for getting access to restricted resources
          in: query
          name: key
          required: false
          schema:
            type: string
            x-struct: null
            x-validate: null
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  id:
                    anyOf:
                      - type: integer
                        x-struct: null
                        x-validate: null
                      - type: string
                        x-struct: null
                        x-validate: null
                    description: >-
                      Echoes the request id. When the client omits it, the
                      server echoes integer `1`.
                    x-struct: null
                    x-validate: null
                  jsonrpc:
                    description: JSON-RPC protocol version, always `2.0`.
                    enum:
                      - '2.0'
                    type: string
                    x-struct: null
                    x-validate: null
                  result:
                    allOf:
                      - $ref: '#/components/schemas/EthBlockNumberResult'
                    description: Endpoint-specific payload.
                    x-struct: null
                    x-validate: null
                required:
                  - jsonrpc
                  - result
                  - id
                type: object
                x-struct: null
                x-validate: null
          description: Latest block number
      callbacks: {}
components:
  schemas:
    EthBlockNumberResult:
      description: >-
        Hex-encoded latest block number on the chain. Nullable in the schema for
        defensive reasons; always present in practice.
      nullable: true
      pattern: ^0x[0-9a-fA-F]+$
      title: EthBlockNumberResult
      type: string
      x-struct: Elixir.BlockScoutWeb.Schemas.API.Legacy.EthBlockNumberResult
      x-validate: null

````