For AI agents: a documentation index is available at /llms.txt. A markdown version of this page is available at the same URL with .md appended (or via Accept: text/markdown).
Skip to main content

getchaintxstats

Returns transaction count and rate statistics over a window of blocks. This method uses 80 credits from your daily balance.

Parameters​

  • nblocks: (integer) [optional] - Size of the window, in blocks. Must be less than the height of blockhash. The default is about one month of blocks.
  • blockhash: (string) [optional] - Hash of the block that ends the window. The default is the chain tip.

Returns​

result: (object) - Transaction statistics.

  • time: (integer) - Timestamp of the final block in the window, in Unix epoch seconds.
  • txcount: (integer) [optional] - Total number of transactions in the chain up to the final block.
  • window_final_block_hash: (string) - Hash of the final block in the window.
  • window_final_block_height: (integer) - Height of the final block in the window.
  • window_block_count: (integer) - Size of the window, in blocks.
  • window_interval: (integer) [optional] - Elapsed time across the window, in seconds, measured between the median time past of the first and final blocks. Present when window_block_count is greater than 0.
  • window_tx_count: (integer) [optional] - Number of transactions in the window. Present when window_block_count is greater than 0.
  • txrate: (number) [optional] - Average transactions per second in the window. Present when window_interval is greater than 0.

Request​

curl https://bitcoin-mainnet.infura.io/v3/<YOUR-API-KEY> \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "getchaintxstats", "params": [2016, "000000000003ba27aa200b1cecaad478d2b00432346c3f1f3986da1afd33e506"]}'

Response​

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"time": 1293623863,
"txcount": 216577,
"window_final_block_hash": "000000000003ba27aa200b1cecaad478d2b00432346c3f1f3986da1afd33e506",
"window_final_block_height": 100000,
"window_block_count": 2016,
"window_interval": 1066712,
"window_tx_count": 7317,
"txrate": 0.006859395975671034
}
}