Skip to main content

starknet_getBlockTransactionCount

Returns the number of transactions in the specified block.

Parameters

block_id: [Required] The block parameter object containing one of the following:

  • block_hash: (string) Block hash.
  • block_number: (integer) Decimal block number.
  • One of the string tags latest or pending.

Returns

Number of transactions in the requested block.

Example

Replace <YOUR-API-KEY> with an API key from your Infura dashboard.

Request

curl https://starknet-mainnet.infura.io/v3/<YOUR-API-KEY> \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "starknet_getBlockTransactionCount",
"params": {
"block_id": {
"block_number": 470207
}
},
"id": 0
}'

Response

{
"jsonrpc": "2.0",
"result": 148,
"id": 1
}