Skip to main content

starknet_getBlockTransactionCount RPC Method

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

Updated on
Mar 18, 2024

starknet_getBlockTransactionCount RPC Method

Parameters

block_id
string
REQUIRED
The hash of the requested block, the block number (height) of the requested block, or a block tag (latest or pending)

Returns

result
integer
The number of transactions in the designated block
Request
1
curl --location 'https://docs-demo.strk-mainnet.quiknode.pro/' \
2
--header 'accept: application/json' \
3
--header 'content-type: application/json' \
4
--data '{
5
"id": 1,
6
"jsonrpc": "2.0",
7
"method": "starknet_getBlockTransactionCount",
8
"params": [
9
"latest"
10
]
11
}'
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free