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

> Tempo API method that returns the number of transactions in a block specified by block hash. blockHash — the hash of the block. On Tempo.

Tempo API method that returns the number of transactions in a block specified by block hash.

## Parameters

* `blockHash` — the 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 NODE_URL = "CHAINSTACK_NODE_URL";
  const provider = new ethers.JsonRpcProvider(NODE_URL);

  const getTransactionCount = async (blockHash) => {
      const count = await provider.send("eth_getBlockTransactionCountByHash", [blockHash]);
      console.log(`Block ${blockHash}`);
      console.log(`Transaction count: ${parseInt(count, 16)}`);
    };

  getTransactionCount("0x1c3830dd03a362ba82e82017a5f4e361c12fc43b64a1e4ebd2902f0c313cad7e");
  ```

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

  node_url = "CHAINSTACK_NODE_URL"
  web3 = Web3(Web3.HTTPProvider(node_url))

  block_hash = "0x1c3830dd03a362ba82e82017a5f4e361c12fc43b64a1e4ebd2902f0c313cad7e"

  result = web3.provider.make_request("eth_getBlockTransactionCountByHash", [block_hash])
  count = int(result['result'], 16)
  print(f"Block {block_hash}")
  print(f"Transaction count: {count}")
  ```

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


## OpenAPI

````yaml openapi/tempo_node_api/blocks_info/eth_getBlockTransactionCountByHash.json POST /
openapi: 3.0.0
info:
  title: eth_getBlockTransactionCountByHash Tempo example
  version: 1.0.0
  description: This is an API example for eth_getBlockTransactionCountByHash for Tempo.
servers:
  - url: https://tempo-mainnet.core.chainstack.com/c3ce2925b51f1ed18719fe8a23bbdccf
security: []
paths:
  /:
    post:
      tags:
        - Blocks info
      summary: eth_getBlockTransactionCountByHash
      operationId: tempo-eth-getBlockTransactionCountByHash
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  type: string
                  default: '2.0'
                method:
                  type: string
                  default: eth_getBlockTransactionCountByHash
                params:
                  type: array
                  items: {}
                  default:
                    - >-
                      0x1c3830dd03a362ba82e82017a5f4e361c12fc43b64a1e4ebd2902f0c313cad7e
                  description: Block hash
                id:
                  type: integer
                  default: 1
      responses:
        '200':
          description: Transaction count in block
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: string
                    description: Number of transactions in the block encoded as hexadecimal

````