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

> Monad API method that returns the number of transactions in a block matching the given block number. Use it on Monad via Chainstack.

Monad API method that returns the number of transactions in a block matching the given block number. This method allows you to quickly check the transaction count for any block by its number.

## Parameters

* `quantity|tag` — the block number as a hexadecimal string, or one of the following block tags:
  * `latest` — the most recent block in the canonical chain
  * `earliest` — the genesis block
  * `pending` — the pending state/transactions

## Response

* `result` — the number of transactions in the block, encoded as hexadecimal.

## `eth_getBlockTransactionCountByNumber` code examples

<CodeGroup>
  ```javascript ethers.js theme={"system"}
  const { ethers } = require("ethers");

  const provider = new ethers.JsonRpcProvider("CHAINSTACK_NODE_URL");

  async function getBlockTransactionCount() {
    const blockNumber = "latest"; // Or use hex like "0x1234"
    const count = await provider.send("eth_getBlockTransactionCountByNumber", [blockNumber]);
    console.log(`Transaction count: ${parseInt(count, 16)}`);
  }

  getBlockTransactionCount();
  ```

  ```python web3.py theme={"system"}
  from web3 import Web3

  node_url = "CHAINSTACK_NODE_URL"

  web3 = Web3(Web3.HTTPProvider(node_url))
  count = web3.eth.get_block_transaction_count('latest')
  print(f'Transaction count: {count}')
  ```
</CodeGroup>

## Use case

A practical use case for `eth_getBlockTransactionCountByNumber` is analyzing network throughput over time by sampling transaction counts across multiple blocks, which helps understand network congestion patterns.


## OpenAPI

````yaml openapi/monad_node_api/blocks_info/eth_getBlockTransactionCountByNumber.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_getBlockTransactionCountByNumber
      operationId: eth_getBlockTransactionCountByNumber
      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_getBlockTransactionCountByNumber
                params:
                  type: array
                  items:
                    type: string
                  default:
                    - latest
      responses:
        '200':
          description: The number of transactions in the block.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: string

````