Skip to main content
POST
eth_getBlockTransactionCountByHash
curl --request POST \
  --url https://tempo-moderato.core.chainstack.com/a25a421add2280d53fdbc23417055501/ \
  --header 'Content-Type: application/json' \
  --data '
{
  "jsonrpc": "2.0",
  "method": "eth_getBlockTransactionCountByHash",
  "params": [
    "0x1c3830dd03a362ba82e82017a5f4e361c12fc43b64a1e4ebd2902f0c313cad7e"
  ],
  "id": 1
}
'
{
  "jsonrpc": "<string>",
  "id": 123,
  "result": "<string>"
}
Tempo API method that returns the number of transactions in a block specified by block hash.
Get you own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

  • blockHash — the hash of the block

Response

  • result — the number of transactions in the block encoded as hexadecimal

eth_getBlockTransactionCountByHash code examples

const ethers = require('ethers');
const NODE_URL = "CHAINSTACK_NODE_URL";
const provider = new ethers.JsonRpcProvider(NODE_URL);

const getTransactionCount = async (blockHash) => {
    const count = await provider.send("eth_getBlockTransactionCountByHash", [blockHash]);
    console.log(`Block ${blockHash}`);
    console.log(`Transaction count: ${parseInt(count, 16)}`);
  };

getTransactionCount("0x1c3830dd03a362ba82e82017a5f4e361c12fc43b64a1e4ebd2902f0c313cad7e");

Body

application/json
jsonrpc
string
default:2.0
method
string
default:eth_getBlockTransactionCountByHash
params
any[]

Block hash

id
integer
default:1

Response

200 - application/json

Transaction count in block

jsonrpc
string
id
integer
result
string

Number of transactions in the block encoded as hexadecimal

Last modified on January 23, 2026