> ## 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 Latest Block Number (JSON-RPC Format)

> Mimics Ethereum JSON RPC's eth_blockNumber



## OpenAPI

````yaml /openapi-specs/pro-rpc-api-universal.json get /v2/api?module=block&action=eth_block_number
openapi: 3.1.0
info:
  title: 'Blockscout API: RPC and ETH RPC'
  version: 2.0.0
  description: >
    Blockscout's Etherscan-compatible RPC API and standard ETH JSON-RPC methods,
    served from the multichain Blockscout API.


    ## Base URL


    All requests go to `https://api.blockscout.com`. Choose the network with
    `chain_id` (for example `1` for Ethereum or `8453` for Base).


    ## Authentication


    A Blockscout API key is required on every request, including the free tier.
    Get one at [dev.blockscout.com](https://dev.blockscout.com).

    Send it as the `apikey` query parameter or as an `Authorization: Bearer
    YOUR_KEY` header. See [API rate
    limits](https://docs.blockscout.com/rate-limits) for plan limits.


    Requests without a key are not served: the API responds with HTTP `402`. To
    call without an API key, pay per call with [x402
    payments](https://docs.blockscout.com/devs/x402-payments).


    ## RPC API (module and action)


    Etherscan-style requests. Pass `chain_id`, `module` and `action`:


    ```

    https://api.blockscout.com/v2/api?chain_id=1&module=account&action=balance&address=0x...&apikey=YOUR_KEY

    ```


    The same calls are also available at
    `https://api.blockscout.com/{chain_id}/api?module=...&action=...`.


    ## ETH RPC API (JSON-RPC)


    Standard Ethereum JSON-RPC methods use `POST` requests:


    ```

    POST https://api.blockscout.com/{chain_id}/json-rpc

    Content-Type: application/json

    Authorization: Bearer YOUR_KEY


    {"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}

    ```


    ## Migrating from Etherscan


    Replace the base URL with `https://api.blockscout.com/v2/api` and rename
    `chainid` to `chain_id`. Module and action names are the same for most
    calls.
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  contact:
    name: Blockscout Community
    url: https://discord.gg/blockscout
servers:
  - url: https://api.blockscout.com
security:
  - bearerAuth: []
  - apiKeyAuth: []
tags:
  - name: Account
    description: Account-related endpoints
  - name: Block
    description: Block-related endpoints
  - name: Contract
    description: Smart contract-related endpoints
  - name: Logs
    description: Event logs endpoints
  - name: Stats
    description: Network statistics endpoints
  - name: Token
    description: Token-related endpoints
  - name: Transaction
    description: Transaction-related endpoints
  - name: ETH RPC
    description: Ethereum JSON-RPC compatible endpoints
externalDocs:
  url: https://docs.blockscout.com/devs/apis/rpc
paths:
  /v2/api?module=block&action=eth_block_number:
    get:
      tags:
        - Block
      summary: Get Latest Block Number (JSON-RPC Format)
      description: Mimics Ethereum JSON RPC's eth_blockNumber
      operationId: eth-block-number
      parameters:
        - $ref: '#/components/parameters/chain_id_query'
        - $ref: '#/components/parameters/module_block'
        - $ref: '#/components/parameters/action_eth_block_number'
      responses:
        '200':
          description: Latest block number retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    example: '2.0'
                  result:
                    type: string
                    description: Block number in hex format
                    example: '0x103538a'
                  id:
                    type: integer
                    example: 1
          headers:
            x-credits-remaining:
              description: >-
                Number of credits remaining in your plan. Resets daily on the
                free plan, monthly otherwise.
              schema:
                type: integer
            x-ratelimit-limit:
              description: >-
                Available requests per second with your plan. Returns -1 on
                internal error.
              schema:
                type: integer
            x-ratelimit-remaining:
              description: >-
                Remaining rate limit based on your queries. Returns -1 on
                internal error.
              schema:
                type: integer
            x-ratelimit-reset:
              description: >-
                Time in milliseconds until the rate limit resets. Returns -1 on
                internal error.
              schema:
                type: integer
      externalDocs:
        url: https://docs.blockscout.com/devs/apis/rpc/block
components:
  parameters:
    chain_id_query:
      name: chain_id
      in: query
      required: true
      description: The ID of the blockchain
      schema:
        type: string
      example: '1'
    module_block:
      name: module
      in: query
      required: true
      schema:
        type: string
        enum:
          - block
      description: Module name (must be 'block')
    action_eth_block_number:
      name: action
      in: query
      required: true
      schema:
        type: string
        enum:
          - eth_block_number
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      description: API key passed as a Bearer token in the Authorization header.
      scheme: bearer
      type: http
    apiKeyAuth:
      description: API key passed as the `apikey` query parameter.
      in: query
      name: apikey
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.