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

Fantom API method that returns the number of transactions in a block specified by block hash. This information can be useful for analytics purposes.

<Check>
  **Get your own node endpoint today**

  [Start for free](https://console.chainstack.com/) and get your app to production levels immediately. No credit card required.

  You can sign up with your GitHub, X, Google, or Microsoft account.
</Check>

## Parameters

* `hash` — the block hash of the requested block.

## Response

* `quantity` — an integer value representing how many transactions are included in the block.

## `eth_getBlockTransactionCountByHash` code examples

<CodeGroup>
  ```javascript web3.js theme={"system"}
  const { Web3 } = require("web3");
  const NODE_URL = "CHAINSTACK_NODE_URL";
  const web3 = new Web3(NODE_URL);

  async function getTransactionsCount(blockHash) {
    const count = await web3.eth.getBlockTransactionCount(blockHash)
    console.log(count);
  }

  getTransactionsCount('0x0004358a000018587faea5158124f479fb25360d25029e662d336e3a3508ffb3')
  ```

  ```javascript ethers.js theme={"system"}
  const ethers = require('ethers');
  const NODE_URL = "CHAINSTACK_NODE_URL";
  const provider = new ethers.JsonRpcProvider(NODE_URL);

  const getTransactionsCount = async (blockHash) => {
      const count = await provider.send("eth_getBlockTransactionCountByHash", [blockHash]);
      console.log(count);
     };

     getTransactionsCount('0x0004358a000018587faea5158124f479fb25360d25029e662d336e3a3508ffb3');
  ```

  ```python web3.py theme={"system"}
  from web3 import Web3  
  node_url = "CHAINSTACK_NODE_URL" 

  web3 = Web3(Web3.HTTPProvider(node_url)) 
  print(web3.eth.get_block_transaction_count("0x0004358a000018587faea5158124f479fb25360d25029e662d336e3a3508ffb3"))
  ```
</CodeGroup>

## Use case

`eth_getBlockTransactionCountByHash` is a useful tool for analyzing transaction volume on the Fantom blockchain. On average, a new block is generated on the Fantom mainnet every 3 seconds, resulting in approximately 1,200 blocks per hour. Using a Web3 library, one can inspect the past 1,200 blocks starting from the latest block, retrieve the hash of each block, and use `eth_getBlockTransactionCountByHash` to find the number of transactions in each block.


## OpenAPI

````yaml /openapi/fantom_node_api/eth_getBlockTransactionCountByHash.json POST /4ab982aa70a7baead515ffdb5915df3f
openapi: 3.0.0
info:
  title: Fantom Node API
  version: 1.0.0
  description: This is an API for interacting with a Fantom node.
servers:
  - url: https://fantom-mainnet.core.chainstack.com
security: []
paths:
  /4ab982aa70a7baead515ffdb5915df3f:
    post:
      tags:
        - Blocks info
      summary: eth_getBlockTransactionCountByHash
      operationId: 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
                    title: Block hash
                    description: The block hash identifier.
                  default:
                    - >-
                      0x0004344d0000028b41ba91f2221f809b62389befbfe00e9f62c6c238336a32cd
      responses:
        '200':
          description: The block information
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: string

````