Bitcoin
Bitcoin
Bitcoin
Le niveau gratuit couvre les projets personnels. Le paiement à l'usage évolue sans carte bancaire.
getblockstats computes a compact set of statistics over a single Bitcoin block — average and median fees, the fee-rate percentiles, total and median size and weight, the input and output counts, the block subsidy, and the change in the UTXO set. It saves you from fetching the whole block and summing transactions yourself, which makes it ideal for fee analytics on the BTC network. You target a block by hash or height and may request a subset of stat names. Call it at https://bitcoin.therpc.io/YOUR_API_KEY; note that every fee and amount field comes back in satoshis (1 BTC = 100,000,000 sat).
feerate_percentiles to show what users paid to confirm.total_size, total_weight, and txs across heights to track block usage over time.subsidy and totalfee for a height to see the full miner reward for that block.| # | Nom | Type | Obligatoire | Description |
|---|---|---|---|---|
| 1 | hash_or_height | string | number | Oui | Block hash or height to compute stats over. |
| 2 | stats | array | Non | Subset of stat names to return; omit for all. |
| Type | Description |
|---|---|
| object | Amounts in satoshis: avgfee, avgfeerate, avgtxsize, blockhash, feerate_percentiles, height, ins, maxfee, medianfee, mediantime, minfee, outs, subsidy, time, total_out, total_size, total_weight, totalfee, txs, utxo_increase. |
| Code | Message | Cause |
|---|---|---|
-5 | Block not found | No block matches the given hash — check the hash and that the block is on the chain this endpoint serves. |
-8 | Invalid parameter | A parameter is out of range or the wrong shape — check verbosity levels, conf_target bounds, and required fields. |