getblockstats
curl --request POST \
--url https://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8 \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "1.0",
"method": "getblockstats",
"params": [
"00000000000000000002d517d73d1abd09730ea69aa688207c281944300e8a50",
[
"avgfee",
"avgfeerate",
"avgtxsize",
"blockhash",
"feerate_percentiles",
"height",
"ins",
"maxfee",
"maxfeerate",
"maxtxsize",
"medianfee",
"mediantime",
"mediantxsize",
"minfee",
"minfeerate",
"mintxsize",
"outs",
"subsidy",
"swtotal_size",
"swtotal_weight",
"swtxs",
"time",
"total_out",
"total_size",
"total_weight",
"totalfee",
"txs",
"utxo_increase",
"utxo_size_inc"
]
],
"id": 1
}
'import requests
url = "https://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8"
payload = {
"jsonrpc": "1.0",
"method": "getblockstats",
"params": ["00000000000000000002d517d73d1abd09730ea69aa688207c281944300e8a50", ["avgfee", "avgfeerate", "avgtxsize", "blockhash", "feerate_percentiles", "height", "ins", "maxfee", "maxfeerate", "maxtxsize", "medianfee", "mediantime", "mediantxsize", "minfee", "minfeerate", "mintxsize", "outs", "subsidy", "swtotal_size", "swtotal_weight", "swtxs", "time", "total_out", "total_size", "total_weight", "totalfee", "txs", "utxo_increase", "utxo_size_inc"]],
"id": 1
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '1.0',
method: 'getblockstats',
params: [
'00000000000000000002d517d73d1abd09730ea69aa688207c281944300e8a50',
[
'avgfee',
'avgfeerate',
'avgtxsize',
'blockhash',
'feerate_percentiles',
'height',
'ins',
'maxfee',
'maxfeerate',
'maxtxsize',
'medianfee',
'mediantime',
'mediantxsize',
'minfee',
'minfeerate',
'mintxsize',
'outs',
'subsidy',
'swtotal_size',
'swtotal_weight',
'swtxs',
'time',
'total_out',
'total_size',
'total_weight',
'totalfee',
'txs',
'utxo_increase',
'utxo_size_inc'
]
],
id: 1
})
};
fetch('https://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'jsonrpc' => '1.0',
'method' => 'getblockstats',
'params' => [
'00000000000000000002d517d73d1abd09730ea69aa688207c281944300e8a50',
[
'avgfee',
'avgfeerate',
'avgtxsize',
'blockhash',
'feerate_percentiles',
'height',
'ins',
'maxfee',
'maxfeerate',
'maxtxsize',
'medianfee',
'mediantime',
'mediantxsize',
'minfee',
'minfeerate',
'mintxsize',
'outs',
'subsidy',
'swtotal_size',
'swtotal_weight',
'swtxs',
'time',
'total_out',
'total_size',
'total_weight',
'totalfee',
'txs',
'utxo_increase',
'utxo_size_inc'
]
],
'id' => 1
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8"
payload := strings.NewReader("{\n \"jsonrpc\": \"1.0\",\n \"method\": \"getblockstats\",\n \"params\": [\n \"00000000000000000002d517d73d1abd09730ea69aa688207c281944300e8a50\",\n [\n \"avgfee\",\n \"avgfeerate\",\n \"avgtxsize\",\n \"blockhash\",\n \"feerate_percentiles\",\n \"height\",\n \"ins\",\n \"maxfee\",\n \"maxfeerate\",\n \"maxtxsize\",\n \"medianfee\",\n \"mediantime\",\n \"mediantxsize\",\n \"minfee\",\n \"minfeerate\",\n \"mintxsize\",\n \"outs\",\n \"subsidy\",\n \"swtotal_size\",\n \"swtotal_weight\",\n \"swtxs\",\n \"time\",\n \"total_out\",\n \"total_size\",\n \"total_weight\",\n \"totalfee\",\n \"txs\",\n \"utxo_increase\",\n \"utxo_size_inc\"\n ]\n ],\n \"id\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"1.0\",\n \"method\": \"getblockstats\",\n \"params\": [\n \"00000000000000000002d517d73d1abd09730ea69aa688207c281944300e8a50\",\n [\n \"avgfee\",\n \"avgfeerate\",\n \"avgtxsize\",\n \"blockhash\",\n \"feerate_percentiles\",\n \"height\",\n \"ins\",\n \"maxfee\",\n \"maxfeerate\",\n \"maxtxsize\",\n \"medianfee\",\n \"mediantime\",\n \"mediantxsize\",\n \"minfee\",\n \"minfeerate\",\n \"mintxsize\",\n \"outs\",\n \"subsidy\",\n \"swtotal_size\",\n \"swtotal_weight\",\n \"swtxs\",\n \"time\",\n \"total_out\",\n \"total_size\",\n \"total_weight\",\n \"totalfee\",\n \"txs\",\n \"utxo_increase\",\n \"utxo_size_inc\"\n ]\n ],\n \"id\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"1.0\",\n \"method\": \"getblockstats\",\n \"params\": [\n \"00000000000000000002d517d73d1abd09730ea69aa688207c281944300e8a50\",\n [\n \"avgfee\",\n \"avgfeerate\",\n \"avgtxsize\",\n \"blockhash\",\n \"feerate_percentiles\",\n \"height\",\n \"ins\",\n \"maxfee\",\n \"maxfeerate\",\n \"maxtxsize\",\n \"medianfee\",\n \"mediantime\",\n \"mediantxsize\",\n \"minfee\",\n \"minfeerate\",\n \"mintxsize\",\n \"outs\",\n \"subsidy\",\n \"swtotal_size\",\n \"swtotal_weight\",\n \"swtxs\",\n \"time\",\n \"total_out\",\n \"total_size\",\n \"total_weight\",\n \"totalfee\",\n \"txs\",\n \"utxo_increase\",\n \"utxo_size_inc\"\n ]\n ],\n \"id\": 1\n}"
response = http.request(request)
puts response.read_body{
"result": {},
"error": {},
"id": 123
}Bitcoin node API
getblockstats | Bitcoin
The getblockstats method computes per block statistics based on the specified block hash and the array of stats to include. On Bitcoin.
POST
/
788f110831fe13808302bd79796d55e8
getblockstats
curl --request POST \
--url https://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8 \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "1.0",
"method": "getblockstats",
"params": [
"00000000000000000002d517d73d1abd09730ea69aa688207c281944300e8a50",
[
"avgfee",
"avgfeerate",
"avgtxsize",
"blockhash",
"feerate_percentiles",
"height",
"ins",
"maxfee",
"maxfeerate",
"maxtxsize",
"medianfee",
"mediantime",
"mediantxsize",
"minfee",
"minfeerate",
"mintxsize",
"outs",
"subsidy",
"swtotal_size",
"swtotal_weight",
"swtxs",
"time",
"total_out",
"total_size",
"total_weight",
"totalfee",
"txs",
"utxo_increase",
"utxo_size_inc"
]
],
"id": 1
}
'import requests
url = "https://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8"
payload = {
"jsonrpc": "1.0",
"method": "getblockstats",
"params": ["00000000000000000002d517d73d1abd09730ea69aa688207c281944300e8a50", ["avgfee", "avgfeerate", "avgtxsize", "blockhash", "feerate_percentiles", "height", "ins", "maxfee", "maxfeerate", "maxtxsize", "medianfee", "mediantime", "mediantxsize", "minfee", "minfeerate", "mintxsize", "outs", "subsidy", "swtotal_size", "swtotal_weight", "swtxs", "time", "total_out", "total_size", "total_weight", "totalfee", "txs", "utxo_increase", "utxo_size_inc"]],
"id": 1
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '1.0',
method: 'getblockstats',
params: [
'00000000000000000002d517d73d1abd09730ea69aa688207c281944300e8a50',
[
'avgfee',
'avgfeerate',
'avgtxsize',
'blockhash',
'feerate_percentiles',
'height',
'ins',
'maxfee',
'maxfeerate',
'maxtxsize',
'medianfee',
'mediantime',
'mediantxsize',
'minfee',
'minfeerate',
'mintxsize',
'outs',
'subsidy',
'swtotal_size',
'swtotal_weight',
'swtxs',
'time',
'total_out',
'total_size',
'total_weight',
'totalfee',
'txs',
'utxo_increase',
'utxo_size_inc'
]
],
id: 1
})
};
fetch('https://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'jsonrpc' => '1.0',
'method' => 'getblockstats',
'params' => [
'00000000000000000002d517d73d1abd09730ea69aa688207c281944300e8a50',
[
'avgfee',
'avgfeerate',
'avgtxsize',
'blockhash',
'feerate_percentiles',
'height',
'ins',
'maxfee',
'maxfeerate',
'maxtxsize',
'medianfee',
'mediantime',
'mediantxsize',
'minfee',
'minfeerate',
'mintxsize',
'outs',
'subsidy',
'swtotal_size',
'swtotal_weight',
'swtxs',
'time',
'total_out',
'total_size',
'total_weight',
'totalfee',
'txs',
'utxo_increase',
'utxo_size_inc'
]
],
'id' => 1
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8"
payload := strings.NewReader("{\n \"jsonrpc\": \"1.0\",\n \"method\": \"getblockstats\",\n \"params\": [\n \"00000000000000000002d517d73d1abd09730ea69aa688207c281944300e8a50\",\n [\n \"avgfee\",\n \"avgfeerate\",\n \"avgtxsize\",\n \"blockhash\",\n \"feerate_percentiles\",\n \"height\",\n \"ins\",\n \"maxfee\",\n \"maxfeerate\",\n \"maxtxsize\",\n \"medianfee\",\n \"mediantime\",\n \"mediantxsize\",\n \"minfee\",\n \"minfeerate\",\n \"mintxsize\",\n \"outs\",\n \"subsidy\",\n \"swtotal_size\",\n \"swtotal_weight\",\n \"swtxs\",\n \"time\",\n \"total_out\",\n \"total_size\",\n \"total_weight\",\n \"totalfee\",\n \"txs\",\n \"utxo_increase\",\n \"utxo_size_inc\"\n ]\n ],\n \"id\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"1.0\",\n \"method\": \"getblockstats\",\n \"params\": [\n \"00000000000000000002d517d73d1abd09730ea69aa688207c281944300e8a50\",\n [\n \"avgfee\",\n \"avgfeerate\",\n \"avgtxsize\",\n \"blockhash\",\n \"feerate_percentiles\",\n \"height\",\n \"ins\",\n \"maxfee\",\n \"maxfeerate\",\n \"maxtxsize\",\n \"medianfee\",\n \"mediantime\",\n \"mediantxsize\",\n \"minfee\",\n \"minfeerate\",\n \"mintxsize\",\n \"outs\",\n \"subsidy\",\n \"swtotal_size\",\n \"swtotal_weight\",\n \"swtxs\",\n \"time\",\n \"total_out\",\n \"total_size\",\n \"total_weight\",\n \"totalfee\",\n \"txs\",\n \"utxo_increase\",\n \"utxo_size_inc\"\n ]\n ],\n \"id\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"1.0\",\n \"method\": \"getblockstats\",\n \"params\": [\n \"00000000000000000002d517d73d1abd09730ea69aa688207c281944300e8a50\",\n [\n \"avgfee\",\n \"avgfeerate\",\n \"avgtxsize\",\n \"blockhash\",\n \"feerate_percentiles\",\n \"height\",\n \"ins\",\n \"maxfee\",\n \"maxfeerate\",\n \"maxtxsize\",\n \"medianfee\",\n \"mediantime\",\n \"mediantxsize\",\n \"minfee\",\n \"minfeerate\",\n \"mintxsize\",\n \"outs\",\n \"subsidy\",\n \"swtotal_size\",\n \"swtotal_weight\",\n \"swtxs\",\n \"time\",\n \"total_out\",\n \"total_size\",\n \"total_weight\",\n \"totalfee\",\n \"txs\",\n \"utxo_increase\",\n \"utxo_size_inc\"\n ]\n ],\n \"id\": 1\n}"
response = http.request(request)
puts response.read_body{
"result": {},
"error": {},
"id": 123
}The
getblockstats method computes per block statistics based on the specified block hash and the array of stats to include. It returns an object containing various statistics for the specified block.
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.
Parameters
blockhash(required) — the hash of the block for which statistics are to be computed.stats(optional) — an array of statistics to include in the response. Possible values include:avgfeeavgfeerateavgtxsizeblockhashfeerate_percentilesheightinsmaxfeemaxfeeratemaxtxsizemedianfeemediantimemediantxsizeminfeeminfeeratemintxsizeoutssubsidyswtotal_sizeswtotal_weightswtxstimetotal_outtotal_sizetotal_weighttotalfeetxsutxo_increaseutxo_size_inc
Response
result— an object containing the computed block statistics based on the specified parameters.error— an object containing an error message if an error occurred.id— an integer representing the ID of the request, used to match requests with responses.
Use case
Thegetblockstats method is useful for analyzing and extracting detailed statistics about individual blocks in the blockchain. These statistics can provide valuable insights into block characteristics and transaction data, aiding in blockchain analysis and monitoring.Body
application/json
Last modified on July 7, 2026
Was this page helpful?
⌘I