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

Parameters

Params - a string array containing (required):
  • QUANTITY|TAG(hex string|string, required) - integer of a block number in hex string format, or the string "earliest", "latest" or "pending", as in the default block parameter.

Returns

QUANTITY(hex string) - integer of the number of transactions in this block.

Example

Request

curl https://api.blockvision.org/v1/<api key> \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getBlockTransactionCountByNumber",
"params": [
"0xe8333"
],
"id": 42
}'

Result

{
"jsonrpc": "2.0",
"id": 42,
"result": "0x2"
}