getblockstats

For a given window, calculate the statistics each block. All amounts are in satoshis.

Pruning won't function at certain heights.

Example Request and Result for getblockstats method

In this section, we provide an illustrative example of a request made to retrieve details contents using the getblockstats method. Additionally, we present the resulting response containing information about the statistics of each block.

Parameters

FieldTypeDescription

hash_or_height*

numeric

The block hash or height of the target block

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!

Calculates statistics per block for a given window.

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

Request Body

NameTypeDescription

jsonrpc*

string

1.0

id*

string

bwarelabs

method*

string

getblockstats

params*

array<string>

[3000]

{
    "result": {
        "avgfee": 0,
        "avgfeerate": 0,
        "avgtxsize": 0,
        "blockhash": "000000004a81b9aa469b11649996ecb0a452c16d1181e72f9f980850a1c5ecce",
        "feerate_percentiles": [
            0,
            0,
            0,
            0,
            0
        ],
        "height": 3000,
        "ins": 0,
        "maxfee": 0,
        "maxfeerate": 0,
        "maxtxsize": 0,
        "medianfee": 0,
        "mediantime": 1233757102,
        "mediantxsize": 0,
        "minfee": 0,
        "minfeerate": 0,
        "mintxsize": 0,
        "outs": 1,
        "subsidy": 5000000000,
        "swtotal_size": 0,
        "swtotal_weight": 0,
        "swtxs": 0,
        "time": 1233761870,
        "total_out": 0,
        "total_size": 0,
        "total_weight": 0,
        "totalfee": 0,
        "txs": 1,
        "utxo_increase": 1,
        "utxo_size_inc": 117,
        "utxo_increase_actual": 1,
        "utxo_size_inc_actual": 117
    },
    "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": "getblockstats",
    "params": [
        3000,
        []
    ]
}'

Last updated