L0vdL0vd

eth_getBlockTransactionCountByHash

Returns the number of transactions in a block, by hash.

Archive · Works on any past block

curl https://eth.l0vdinfra.com/YOUR_KEY \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","id":1,"method":"eth_getBlockTransactionCountByHash","params":["0xc7a2fd354a9a1512636dad41b44e618905f5e8d2500f08c515c3bbbdf5261f6a"]}'

Example response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0xae"
}
Params and your endpoint

Parameters

blockHashstringrequired
32-byte block hash.

Returns

string Transaction count, hex.

When to use it

Count the transactions in a block identified by hash.

How to read the result

Hex integer, or null if the block is unknown.

Tips

  • Use the hash variant when you work from stored block hashes to stay correct across reorgs.

Related methods