Skip to main content

starknet_getBlockTransactionCount

Get the number of transactions in a block given a block id

Returns the number of transactions in the designated block.

Parameters#

ParameterTypeDescription
block_idstringBlock reference ("latest", "l1_accepted", block hash, or block number)

Request#

{
"jsonrpc": "2.0",
"method": "starknet_getBlockTransactionCount",
"params": [
{
"block_hash": "0x05abbad1e5"
}
],
"id": 1
}

Returns#

The number of transactions in the designated block

Number of transactions in the block (integer)

Errors#

CodeMessage
24Block not found

Examples#

curl -X POST https://api-starknet-mainnet.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "starknet_getBlockTransactionCount",
"params": [
{
"block_hash": "0x05abbad1e5"
}
],
"id": 1
}'