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

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

Monad API method that returns the number of transactions in a block matching the given block hash. This method is useful for quickly determining the transaction count without retrieving the entire block data.

## Parameters

* `data` — the 32-byte hash of the block.

## Response

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

## `eth_getBlockTransactionCountByHash` code examples

<CodeGroup>
  ```javascript ethers.js theme={"system"}
  const { ethers } = require("ethers");

  const provider = new ethers.JsonRpcProvider("CHAINSTACK_NODE_URL");

  async function getBlockTransactionCount() {
    const blockHash = "0xf3cf930f1b4d9637134d09f126c57c30c3f4f40edf10ba502486b26d14b4f944";
    const count = await provider.send("eth_getBlockTransactionCountByHash", [blockHash]);
    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))
  block_hash = "0xf3cf930f1b4d9637134d09f126c57c30c3f4f40edf10ba502486b26d14b4f944"
  count = web3.eth.get_block_transaction_count(block_hash)
  print(f'Transaction count: {count}')
  ```
</CodeGroup>

## Use case

A practical use case for `eth_getBlockTransactionCountByHash` is monitoring network activity by tracking transaction counts in specific blocks, or validating block data integrity when you have a known block hash.


## OpenAPI

````yaml openapi/monad_node_api/blocks_info/eth_getBlockTransactionCountByHash.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_getBlockTransactionCountByHash
      operationId: eth_getBlockTransactionCountByHash
      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_getBlockTransactionCountByHash
                params:
                  type: array
                  items:
                    type: string
                  default:
                    - >-
                      0xf3cf930f1b4d9637134d09f126c57c30c3f4f40edf10ba502486b26d14b4f944
      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

````