curl --request POST \
--url https://monad-testnet.core.chainstack.com/9c5b265f20b3ea5df4f54f70eb74b800/ \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_getBlockTransactionCountByNumber",
"params": [
"latest"
]
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}curl --request POST \
--url https://monad-testnet.core.chainstack.com/9c5b265f20b3ea5df4f54f70eb74b800/ \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_getBlockTransactionCountByNumber",
"params": [
"latest"
]
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}quantity|tag — the block number as a hexadecimal string, or one of the following block tags:
latest — the most recent block in the canonical chainearliest — the genesis blockpending — the pending state/transactionsresult — the number of transactions in the block, encoded as hexadecimal.eth_getBlockTransactionCountByNumber code examplesconst { ethers } = require("ethers");
const provider = new ethers.JsonRpcProvider("CHAINSTACK_NODE_URL");
async function getBlockTransactionCount() {
const blockNumber = "latest"; // Or use hex like "0x1234"
const count = await provider.send("eth_getBlockTransactionCountByNumber", [blockNumber]);
console.log(`Transaction count: ${parseInt(count, 16)}`);
}
getBlockTransactionCount();
eth_getBlockTransactionCountByNumber is analyzing network throughput over time by sampling transaction counts across multiple blocks, which helps understand network congestion patterns.Was this page helpful?