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

> Monad API method that returns information about a block by block number. This method allows you to retrieve detailed information about a specific block.

Monad API method that returns information about a block by block number. This method allows you to retrieve detailed information about a specific block, including its transactions.

## Parameters

* `quantity or tag` — the integer of a block number encoded as hexadecimal, or the string `latest`, `earliest`, or `pending`.
* `boolean` — if `true`, returns the full transaction objects; if `false`, returns only the hashes of the transactions.

## Response

* `result` — the block object, or `null` when no block was found:
  * `number` — the block number
  * `hash` — the block hash
  * `parentHash` — hash of the parent block
  * `nonce` — hash of the proof-of-work
  * `sha3Uncles` — SHA3 of the uncles data
  * `logsBloom` — the bloom filter for the logs
  * `transactionsRoot` — the root of the transaction trie
  * `stateRoot` — the root of the final state trie
  * `receiptsRoot` — the root of the receipts trie
  * `miner` — the address of the beneficiary
  * `difficulty` — integer of the difficulty
  * `totalDifficulty` — total difficulty of the chain until this block
  * `extraData` — extra data field
  * `size` — size of this block in bytes
  * `gasLimit` — maximum gas allowed in this block
  * `gasUsed` — total gas used by all transactions
  * `timestamp` — the unix timestamp for when the block was collated
  * `transactions` — array of transaction objects or hashes
  * `uncles` — array of uncle hashes

## `eth_getBlockByNumber` code examples

<CodeGroup>
  ```javascript ethers.js theme={"system"}
  const { ethers } = require("ethers");

  const provider = new ethers.JsonRpcProvider("CHAINSTACK_NODE_URL");

  async function getBlock() {
    const block = await provider.getBlock("latest");
    console.log(block);
  }

  getBlock();
  ```

  ```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)
  ```
</CodeGroup>

## Use case

A practical use case for `eth_getBlockByNumber` is retrieving block data for analysis, such as examining transaction volume, gas usage patterns, or timestamps for specific blocks.


## OpenAPI

````yaml openapi/monad_node_api/blocks_info/eth_getBlockByNumber.json POST /
openapi: 3.0.0
info:
  title: Monad Node API
  version: 1.0.0
  description: This is an API for interacting with a Monad node.
servers:
  - url: https://monad-testnet.core.chainstack.com/9c5b265f20b3ea5df4f54f70eb74b800
security: []
paths:
  /:
    post:
      tags:
        - Blocks info
      summary: eth_getBlockByNumber
      operationId: eth_getBlockByNumber
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  default: 1
                jsonrpc:
                  type: string
                  default: '2.0'
                method:
                  type: string
                  default: eth_getBlockByNumber
                params:
                  type: array
                  items:
                    anyOf:
                      - type: string
                        description: >-
                          Block number in hexadecimal format or 'latest',
                          'earliest', 'pending'
                      - type: boolean
                        description: >-
                          If true, returns full transaction objects; if false,
                          returns only transaction hashes
                  default:
                    - latest
                    - false
      responses:
        '200':
          description: The block information.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: object
                    nullable: true

````