eth_getBlockTransactionCountByNumber
Get the number of transactions in a block by providing its block number or tag (latest, earliest, pending).
Instructions
Get the number of transactions in a block identified by its number or tag.
Args:
blockNumber (string): Block number as hex (e.g., '0x10d4f') or tag ('latest', 'earliest', 'pending').
network (string, optional): Ethereum network to query. Defaults to 'mainnet'.
Returns:
Hexadecimal string representing transaction count (e.g., '0x10' for 16 transactions). Returns null if block not found.
Examples:
"Count txs in latest block": { "blockNumber": "latest" }
"Count txs in specific block": { "blockNumber": "0x10d4f", "network": "mainnet" }
Errors:
InvalidParams: When blockNumber format is invalid.
InternalError: When Infura API is unavailable or returns an error.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| blockNumber | Yes | The block number or one of the string tags (latest, earliest, pending). | |
| network | No | The Ethereum network to query, e.g., 'mainnet' or 'sepolia'. | mainnet |
| response_format | No | Output format: 'json' for structured data, 'markdown' for human-readable. | json |