Skip to main content
EVM

eth_getBlockTransactionCountByHash

Summary: Get number of transactions by hash

This request returns the number of transactions from the block matching the given block hash.

Parameters

blockHash string

A string representing the hash (32 bytes) of a block.

Pattern: ^0x[0-9a-f]{64}$

Returns

The number of transactions in the block in hexadecimal, or null if no matching block hash is found.
eth_getBlockTransactionCountByHashResponse oneOf

Not found null

Not Found (null).

Transaction count string

Hex-encoded unsigned integer.

Pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$

Customize request
Parameter
Value
string
Request
curl https://linea-mainnet.infura.io/v3/<YOUR-API-KEY> \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getBlockTransactionCountByHash",
"params": ["0xd459570b5d2994a81ec1875b058f665b7f9c006172a8bd2860de87aee9569ac8"],
"id": 1
}'
Example response
{
"id": 1,
"jsonrpc": "2.0",
"result": "0x21"
}