Skip to content

eth_getBlockTransactionCountByHash ​

served · same as reth

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

When to use ​

Use it to find how many transactions a block has without the block itself.

Example ​

bash
curl -s -X POST -H 'Content-Type: application/json' \
  --data '{"jsonrpc": "2.0", "id": 1, "method": "eth_getBlockTransactionCountByHash", "params": ["0x88392e71b7c4893c80cadfdeadcbaa91add6a41a1a9e2bda3aef6774053617a5"]}' \
  http://127.0.0.1:8547
json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_getBlockTransactionCountByHash",
  "params": [
    "0x88392e71b7c4893c80cadfdeadcbaa91add6a41a1a9e2bda3aef6774053617a5"
  ]
}

Response ​

Live mainnet, block 26193069, 2026-10-14. Checked against reth 2.7: equal.

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0xed"
}

Full response

Parameters ​

NameTypeRequiredMeaning
blockHash32-byte hashyesThe hash of the block.

Returns ​

The count as a hex number, or null when the hash is unknown or not on the canonical chain.

Errors ​

CodeMessageWhen
-32602Invalid paramsA parameter is missing or does not parse. data has the text of reth, with the position.

Compared with reth ​

The live example above gives the same answer on Cinder and on reth 2.7.

eth_getBlockTransactionCountByNumber, eth_getBlockByHash.

Schema (OpenRPC) ​

The official specification: eth_getBlockTransactionCountByHash in ethereum/execution-apis.

Parameter Block hash: string
json
{
  "pattern": "^0x[0-9a-f]{64}$",
  "title": "32 byte hex value",
  "type": "string"
}
Result: Not Found (null) or Transaction count
json
{
  "oneOf": [
    {
      "title": "Not Found (null)",
      "type": "null"
    },
    {
      "pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
      "title": "Transaction count",
      "type": "string"
    }
  ]
}