Skip to main content

getchaintxstats RPC Method

Calculates data about the total number and rate of transactions in the chain.

Updated on
Oct 4, 2023

getchaintxstats RPC Method

Parameters

nblocks
numeric
default=one month. The window's size in number of blocks
blockhash
string
default=chain tip. The hash of the block that ends the window

Returns

result
The result is a JSON object with the following fields:
time
The timestamp for the last block in the window, defined in UNIX epoch time
txcount
The total number of chain transactions up to that point
window_final_block_hash
The hash of the final block in the window
window_final_block_height
The height of the final block in the window
window_block_count
The window's size in terms of blocks
window_tx_count
The number of transactions in the window and only returned if "window_block_count" is > 0
window_interval
The elapsed time in the window in seconds and only returned if "window_block_count" is > 0
txrate
The average rate of transactions per second in the window and only returned if "window_interval" is > 0
error
The error message, if any
Request
1
curl https://docs-demo.btc.quiknode.pro/ \
2
-X POST \
3
-H "Content-Type: application/json" \
4
--data '{"method": "getchaintxstats", "params": [2016]}'
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free