> ## 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 | Tempo

> Tempo API method that returns information about a block specified by its number or tag. eth_getBlockByNumber on Tempo via Chainstack.

Tempo API method that returns information about a block specified by its number or tag. This method can return full transaction objects or just transaction hashes depending on the second parameter.

Tempo blocks include additional fields not found in standard Ethereum blocks: `mainBlockGeneralGasLimit`, `sharedGasLimit`, and `timestampMillisPart` for sub-second precision.

## Parameters

* `blockNumber` — the block number (hex) or tag (`latest`, `earliest`, `pending`)
* `fullTransactions` — if `true`, returns full transaction objects; if `false`, returns only transaction hashes

## Response

* `result` — a block object, or `null` if no block was found:
  * `number` — the block number
  * `hash` — the block hash
  * `parentHash` — hash of the parent block
  * `timestamp` — block timestamp in seconds
  * `timestampMillisPart` — sub-second timestamp (0-999 ms), Tempo-specific
  * `transactions` — array of transaction objects or hashes
  * Additional Tempo fields for payment lanes gas limits

## `eth_getBlockByNumber` code examples

<CodeGroup>
  ```javascript ethers.js theme={"system"}
  const ethers = require('ethers');
  const NODE_URL = "CHAINSTACK_NODE_URL";
  const provider = new ethers.JsonRpcProvider(NODE_URL);

  const getBlockByNumber = async () => {
      const block = await provider.getBlock("latest");
      console.log(block);
    };

  getBlockByNumber();
  ```

  ```python web3.py theme={"system"}
  from web3 import Web3

  node_url = "CHAINSTACK_NODE_URL"

  web3 = Web3(Web3.HTTPProvider(node_url))
  block = web3.eth.get_block("latest")
  print(block)
  ```

  ```bash cURL theme={"system"}
  curl -X POST "CHAINSTACK_NODE_URL" \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["latest", false], "id": 1}'
  ```
</CodeGroup>


## OpenAPI

````yaml openapi/tempo_node_api/blocks_info/eth_getBlockByNumber.json POST /
openapi: 3.0.0
info:
  title: eth_getBlockByNumber Tempo example
  version: 1.0.0
  description: This is an API example for eth_getBlockByNumber for Tempo.
servers:
  - url: https://tempo-mainnet.core.chainstack.com/c3ce2925b51f1ed18719fe8a23bbdccf
security: []
paths:
  /:
    post:
      tags:
        - Blocks info
      summary: eth_getBlockByNumber
      operationId: tempo-eth-getBlockByNumber
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  type: string
                  default: '2.0'
                method:
                  type: string
                  default: eth_getBlockByNumber
                params:
                  type: array
                  items: {}
                  default:
                    - latest
                    - false
                  description: Block number (hex) or tag, and boolean for full transactions
                id:
                  type: integer
                  default: 1
      responses:
        '200':
          description: The block information
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: object
                    nullable: true
                    description: Block object or null if not found

````