POSTgetchaintxstats

Bitcoin Mainnethttps://bitcoin-mainnet.nodit.io/

Computes statistics about the total number and rate of transactions in the chain. You can specify the size of the window in number of blocks and the block that ends the window.

Request Body
idintegerrequired
jsonrpcstringrequired
methodstringrequired
paramsoneOf[]required

It contains following parameters in order:

  1. nblocks: The size of the window in number of blocks, as an integer. (optional, defaults to roughly one month of blocks)
  2. blockhash: The hash of the block that ends the window, as a string. (optional, defaults to the chain tip)
params[0]integer

The size of the window in number of blocks. Roughly one month of blocks is used when omitted.

params[1]string

The hash of the block that ends the window. The chain tip is used when omitted.

Responses
timeinteger

The timestamp of the final block in the window, expressed in UNIX epoch time.

txcountinteger

The total number of transactions in the chain up to that point. It may not be returned when the value is unknown, such as when using assumeutxo.

window_final_block_hashstring

The hash of the final block in the window.

window_final_block_heightinteger

The height of the final block in the window.

window_block_countinteger

The size of the window in number of blocks.

window_tx_countinteger

The number of transactions in the window. Returned only when window_block_count is greater than 0 and txcount exists for both the start and the end of the window.

window_intervalinteger

The elapsed time in the window, in seconds. Returned only when window_block_count is greater than 0.

txratenumber

The average rate of transactions per second in the window. Returned only when window_interval is greater than 0 and window_tx_count exists.

X-API-KEY
RequestCU30
cURL
curl -X POST "https://bitcoin-mainnet.nodit.io/" \
  -H "X-API-KEY: {YOUR_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "getchaintxstats",
  "params": [
    2016,
    "000000000000000000024bead8df69990852c202db0e0097c1a12ea637d7e96d"
  ]
}'
Response
Example · 200
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "time": 1701388800,
    "txcount": 940123456,
    "window_final_block_hash": "000000000000000000024bead8df69990852c202db0e0097c1a12ea637d7e96d",
    "window_final_block_height": 820000,
    "window_block_count": 2016,
    "window_tx_count": 7654321,
    "window_interval": 1209600,
    "txrate": 6.329
  }
}