api/v2/feestats - Dash

This endpoint returns fee statistics for the transactions in a single block, selected by height or hash. The load grows with the number of transactions in the block.

Parameters

ParameterTypeLocationRequiredDescription
blockIdstringpathYesBlock height or block hash

Request

bashcurl --location --request GET 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/feestats/2540670'

example.js

javascriptconst response = await fetch(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/feestats/2540670'
);
console.log(await response.json());

example.py

pythonimport requests

response = requests.get('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/feestats/2540670')

print(response.json())

Response

json{
    "txCount": 30,
    "totalFeesSat": "226187",
    "averageFeePerKb": 6441,
    "decilesFeePerKb": [
        0,
        0,
        1000,
        1002,
        1003,
        1004,
        1008,
        2008,
        6735,
        32204,
        64233
    ]
}

Response Parameters

FieldTypeDescription
txCountintegerNumber of transactions in the block
totalFeesSatstringTotal fees in the block, in duffs
averageFeePerKbnumberAverage fee rate in duffs per kilobyte
decilesFeePerKbarrayFee-rate deciles across the block's transactions

Use Cases

  • Fee Market Analysis: Study the fee distribution within recent blocks
  • Fee Modeling: Use deciles to model competitive fee rates
  • Dashboards: Chart average and total fees per block
  • Historical Study: Compare fee statistics across a range of blocks

Error Handling

HTTP StatusMessageDescription
400Bad requestThe block height or hash is malformed
404Not foundNo block matches the requested height or hash
500Internal errorThe indexer failed to read the block