api/v2/balancehistory - Dash

This endpoint returns aggregated balance-change history for an address, extended public key, or descriptor over a time range. Results are grouped into intervals and can include fiat rates.

Parameters

ParameterTypeLocationRequiredDescription
addressstringpathYesAddress, extended public key, or descriptor. URL-encode descriptors
fromintegerqueryNoUnix timestamp lower bound
tointegerqueryNoUnix timestamp upper bound
fiatcurrencystringqueryNoFiat currency code to include in rates
groupByintegerqueryNoAggregation interval in seconds. Default 3600

Request

bashcurl --location --request GET 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/balancehistory/XjszN1jZJthEoaQDhGthRkaHL9AqaG3Vzw?from=1789600000&to=1789690000&fiatcurrency=usd'

example.js

javascriptconst response = await fetch(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/balancehistory/XjszN1jZJthEoaQDhGthRkaHL9AqaG3Vzw?from=1789600000&to=1789690000&fiatcurrency=usd'
);
console.log(await response.json());

example.py

pythonimport requests

response = requests.get('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/balancehistory/XjszN1jZJthEoaQDhGthRkaHL9AqaG3Vzw?from=1789600000&to=1789690000&fiatcurrency=usd')

print(response.json())

Response

json[
    {
        "time": 1789599600,
        "txs": 7,
        "received": "287767781",
        "sent": "0",
        "sentToSelf": "0",
        "rates": {
            "usd": 54.960075
        }
    },
    {
        "time": 1789603200,
        "txs": 17,
        "received": "698730983",
        "sent": "0",
        "sentToSelf": "0",
        "rates": {
            "usd": 61.43
        }
    }
]

The array is truncated above. With groupBy left at its 3600-second default, the documented range returns 25 hourly points.

Response Parameters

FieldTypeDescription
timeintegerStart of the interval as a Unix timestamp
txsintegerNumber of transactions in the interval
receivedstringTotal received in the interval, in duffs
sentstringTotal sent in the interval, in duffs
sentToSelfstringAmount sent back to the same account, in duffs
ratesobjectFiat rates at the interval, when a currency is requested

Use Cases

  • Balance Charts: Plot an address balance over time in intervals
  • Fiat Valuation: Attach historical fiat rates to balance changes
  • Activity Windows: Aggregate history by day, hour, or custom interval
  • Reporting: Produce time-bucketed received and sent totals

Error Handling

HTTP StatusMessageDescription
400Bad requestThe address, XPUB, or descriptor is malformed
404Not foundNo indexed data exists for the requested account
500Internal errorThe indexer failed to read account data