eth_getBlockTransactionCountByHash
Returns the number of transactions in a block from a block matching the given block hash.
Ethereum specification · All supported methods
Parameters
Parameters are positional, in the order below.
| Parameter | Type | Required | Description |
|---|---|---|---|
Block hash | 32-byte hash | No | See the linked specification for field encoding. |
Return value
The count as a hexadecimal quantity, or null if the block is not found.
Example
Replace <gateway-url> with your gateway base URL and <service-url> with the chain’s service path, such as service/ethereum.
sh
curl -X POST "<gateway-url>/<service-url>" \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","id":1,"method":"eth_getBlockTransactionCountByHash","params":["0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238"]}'Illustrative response; values depend on the selected network and request:
json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x8"
}Direct behavior
Requests for older chain data are automatically routed to providers with full chain history. This covers blocks, transactions, receipts, and logs independently of historical account state.
The gateway uses the block’s age when known. If the age is unknown, it starts with a full-history provider. A missing result from a provider without the required history is not accepted as proof that the data does not exist.
For providers
Support the required recent chain-history service. Advertise full chain history only when all included method families and lookup indexes work back to genesis.
See provider qualification for checks and continued eligibility.