getblockstats
Returns fee, size, and transaction statistics for a block. This method uses 80 credits from your daily balance.
Statistics exclude the coinbase transaction unless noted. Amounts are in satoshis, not BTC.
Parameters
hash_or_height: (string or integer) [required] - Block hash or height.stats: (array) [optional] - Names of the statistics to return, for example["height", "totalfee"]. If omitted, all statistics are returned.
Returns
result: (object) - Block statistics.
avgfee: (integer) - Average fee, in satoshis.avgfeerate: (integer) - Average fee rate, in satoshis per vbyte.avgtxsize: (integer) - Average transaction size, in bytes.blockhash: (string) - Block hash.feerate_percentiles: (array) - Fee rates at the 10th, 25th, 50th, 75th, and 90th percentiles of transaction weight, in satoshis per vbyte.height: (integer) - Block height.ins: (integer) - Number of inputs.maxfee,medianfee,minfee: (integer) - Maximum, median, and minimum fee, in satoshis.maxfeerate,minfeerate: (integer) - Maximum and minimum fee rate, in satoshis per vbyte.maxtxsize,mediantxsize,mintxsize: (integer) - Maximum, median, and minimum transaction size, in bytes.mediantime: (integer) - Median timestamp of the previous 11 blocks, in Unix epoch seconds.outs: (integer) - Number of outputs, including the coinbase transaction's outputs.subsidy: (integer) - Block subsidy, in satoshis.swtotal_size,swtotal_weight: (integer) - Total size and weight of SegWit transactions.swtxs: (integer) - Number of SegWit transactions.time: (integer) - Block timestamp, in Unix epoch seconds.total_out: (integer) - Total amount of all outputs, in satoshis.total_size,total_weight: (integer) - Total size and weight of all transactions.totalfee: (integer) - Total fees, in satoshis.txs: (integer) - Number of transactions, including the coinbase transaction.utxo_increase: (integer) - Change in the number of unspent outputs.utxo_increase_actual: (integer) - Same asutxo_increase, excluding unspendable outputs.utxo_size_inc: (integer) - Change in the size of the UTXO set, in bytes.utxo_size_inc_actual: (integer) - Same asutxo_size_inc, excluding unspendable outputs.
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": "getblockstats", "params": [1]}'
Response
- JSON
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"avgfee": 0,
"avgfeerate": 0,
"avgtxsize": 0,
"blockhash": "00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048",
"feerate_percentiles": [0, 0, 0, 0, 0],
"height": 1,
"ins": 0,
"maxfee": 0,
"maxfeerate": 0,
"maxtxsize": 0,
"medianfee": 0,
"mediantime": 1231469665,
"mediantxsize": 0,
"minfee": 0,
"minfeerate": 0,
"mintxsize": 0,
"outs": 1,
"subsidy": 5000000000,
"swtotal_size": 0,
"swtotal_weight": 0,
"swtxs": 0,
"time": 1231469665,
"total_out": 0,
"total_size": 0,
"total_weight": 0,
"totalfee": 0,
"txs": 1,
"utxo_increase": 1,
"utxo_increase_actual": 1,
"utxo_size_inc": 117,
"utxo_size_inc_actual": 117
}
}