getblockstats
POST
Computes the fee and size statistics for the block with the given block hash or height.Pass an array of value names in
stats to return only the requested values.📘 This method works only when the -txindex option is enabled or for blocks that have not been pruned.
param[0]
hashOrHeightstringrequired
The block hash or height of the target block. A height is passed as an integer.param[1]
statsarrayrequired
The names of the values to return. All values are returned when omitted.Responses
avgfeeinteger
The average fee in the block, in satoshis.avgfeerateinteger
The average fee rate in the block, in satoshis per virtual byte.avgtxsizeinteger
The average transaction size in the block, in bytes.blockhashstring
The hash of the block the statistics were computed for. Use it to check for potential reorgs.feerate_percentilesarray
Fee rates at the 10th, 25th, 50th, 75th and 90th percentile, in satoshis per virtual byte.heightinteger
The block height.insinteger
The number of inputs in the block, excluding the coinbase input.maxfeeinteger
The maximum fee in the block, in satoshis.maxfeerateinteger
The maximum fee rate in the block, in satoshis per virtual byte.maxtxsizeinteger
The maximum transaction size in the block, in bytes.medianfeeinteger
The truncated median fee in the block, in satoshis.mediantimeinteger
The median time past of the block, expressed in UNIX epoch time.mediantxsizeinteger
The truncated median transaction size in the block, in bytes.minfeeinteger
The minimum fee in the block, in satoshis.minfeerateinteger
The minimum fee rate in the block, in satoshis per virtual byte.mintxsizeinteger
The minimum transaction size in the block, in bytes.outsinteger
The number of outputs in the block.subsidyinteger
The block subsidy, in satoshis.swtotal_sizeinteger
The total size of all segwit transactions, in bytes.swtotal_weightinteger
The total weight of all segwit transactions.swtxsinteger
The number of segwit transactions.timeinteger
The block time expressed in UNIX epoch time.total_outinteger
The total amount in all outputs, excluding the coinbase, in satoshis.total_sizeinteger
The total size of all non-coinbase transactions, in bytes.total_weightinteger
The total weight of all non-coinbase transactions.totalfeeinteger
The total fee in the block, in satoshis.txsinteger
The number of transactions in the block, including the coinbase.utxo_increaseinteger
The increase or decrease in the number of unspent outputs (UTXOs).utxo_size_incinteger
The increase or decrease in the size of the UTXO index, in bytes.utxo_increase_actualinteger
The increase or decrease in the number of unspent outputs (UTXOs), not counting unspendables.utxo_size_inc_actualinteger
The increase or decrease in the size of the UTXO index, not counting unspendables, in bytes.codestringrequired
Code identifying the cause of the failed request.messagestringrequired
Detailed message including the name and value of the invalid parameter.{"code": "ERROR_CODE","message": "Unauthorized"}
cURL
curl -X POST 'https://bitcoin-mainnet.nodit.io' \-H 'Content-Type: application/json' \-H 'X-API-KEY: nodit-demo' \-d '{"jsonrpc": "2.0","id": 1,"method": "getblockstats","params": [820000,["minfeerate","avgfeerate"]]}'