eth_getBlockTransactionCountByNumber

Returns the number of transactions in a block matching the given block number.

Request

curl 'https://rpc.web3api.io?x-api-key=YOUR-API-KEY' \
    -X POST \
    -H 'x-amberdata-blockchain-id: ethereum-mainnet' \
    -d '{"jsonrpc":"2.0","id":1,"method":"eth_getBlockTransactionCountByNumber","params":["0x7f36c2"]}'
IndexDescription
0* - blockNumberThe integer of a block number, or the string "earliest", "latest" or "pending", as in the default block parameter.

*Required

Response

{
"id":1,
"jsonrpc":"2.0",
"result": "0x2f"
}
FieldDescription
resultThe integer of the number of transactions in this block.