Skip to main content

getchaintxstats


description: >- Calculate information regarding the chain's overall transaction rate and quantity.


getchaintxstats

Example Request and Result for getchaintxstats method

In this section, we provide an illustrative example of a request made to retrieve details contents using the getchaintxstats method. Additionally, we present the resulting response containing information about the chain's overall transaction rate and quantity.

Parameters

FieldTypeDescription
nblocksnumericSize of the window in number of blocks
blockhashstringThe hash of the block that ends the window.
info

The example in this section uses a non-existing project id.

Make sure you replace it with your Bitcoin mainnet or Bitcoin Testnet endpoint when issuing the API calls.

Don't have a project id? Here's a straightforward guide on how to obtain one!

Calculate information regarding the chain's overall transaction rate and quantity.

POST https://bitcoin-mainnet.blastapi.io/<project-id>

Request Body

NameTypeDescription
jsonrpc*string1.0
id*stringbwarelabs
method*stringgetchaintxstats
params*string[2016]
{
"result": {
"time": 1707831750,
"txcount": 965252756,
"window_final_block_hash": "000000000000000000035c8582f22752a268f5695379597ce9405e10c4051be6",
"window_final_block_height": 830289,
"window_block_count": 2016,
"window_tx_count": 4723063,
"window_interval": 1103416,
"txrate": 4.280401045480581
},
"error": null,
"id": "bwarelabs"
}

Curl Request example

curl --location 'https://bitcoin-mainnet.blastapi.io/<project-id>' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "1.0",
"id": "bwarelabs",
"method": "getchaintxstats",
"params": [
2016
]
}'