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

> Optimism API method that retrieves the number of transactions in a block, identified by its hash. Use it on Optimism via Chainstack.

Optimism API method that retrieves the number of transactions in a block, identified by its hash. This method provides a way to know how many transactions were included in a specific block without retrieving the full block data.

## Parameters

* `hash` — the hash of the block for which the transaction count is being queried, as a hexadecimal string.

## Response

* `result` — the number of transactions in the specified block, encoded as a hexadecimal string. This count includes all transactions that were part of the block when it was mined.

## Use case

The `eth_getBlockTransactionCountByHash` method is particularly useful for applications that need to quickly assess the volume of transactions within specific blocks. For instance, analytics platforms may use this information to analyze network activity over time or to identify blocks that contain an unusually high or low number of transactions.


## OpenAPI

````yaml openapi/optimism_node_api/eth_getBlockTransactionCountByHash.json POST /efb0a5eccd2caa5135eb54eba6f7f300
openapi: 3.0.0
info:
  title: eth_getBlockTransactionCountByHash example
  version: 1.0.0
  description: This is an API example for eth_getBlockTransactionCountByHash.
servers:
  - url: https://optimism-mainnet.core.chainstack.com
security: []
paths:
  /efb0a5eccd2caa5135eb54eba6f7f300:
    post:
      tags:
        - Ethereum Operations
      summary: eth_getBlockTransactionCountByHash
      operationId: getBlockTransactionCountByHash
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  type: string
                  default: '2.0'
                method:
                  type: string
                  default: eth_getBlockTransactionCountByHash
                id:
                  type: integer
                  default: 1
                params:
                  type: array
                  items:
                    anyOf:
                      - type: string
                        default: >-
                          0x7e4aea365093a183b0df5f003f26144ef04ec8a6e7f4910356590c5fc7b1671f
                  default:
                    - >-
                      0x7e4aea365093a183b0df5f003f26144ef04ec8a6e7f4910356590c5fc7b1671f
      responses:
        '200':
          description: The transaction count of the block by hash
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: string

````