> For the complete documentation index, see [llms.txt](/llms.txt).

# `getchaintxstats`

Returns transaction count and rate statistics over a window of blocks. This method uses [80 credits](/get-started/pricing/) from your daily balance.

## Parameters[​](#parameters "Direct link to 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[​](#returns "Direct link to 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[​](#request "Direct link to Request")

- curl

```
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[​](#response "Direct link to Response")

- JSON

```
{
  "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
  }
}

```
