Overview
The collector calls the Treasury's Debt to the Penny dataset every day at 11am and stores one record per Treasury record date, the business days on which the figures are published. `totalDebt` is total public debt outstanding, `publicDebt` is debt held by the public, `intragovernmentalDebt` is debt held by government accounts, and `publicDebtRatio` is publicDebt as a percent of totalDebt, rounded to two decimals.
`perCapita` divides the total by a fixed US population of 335,000,000, which is also what `population` returns, so it is an estimate that does not track census changes. `perHousehold` divides the total by that population over 2.5 people per household.
`date` takes YYYY-MM-DD. When the date has no record, the API searches back up to ten days and returns the nearest earlier one; `date` echoes what you asked for and `recordDate` shows the record actually used. Without `date` you get the newest record.
With `changes=true`, `previousDebt` and `previousDate` are the record before the returned one. `change30d` and `change1y` compare with the record 30 and 365 days back, or the nearest before each. `averageDailyChange30d` divides `change30d` by the calendar days between the two records, so weekends spread the growth instead of inflating it. Dollar changes are rounded to cents; any comparison whose record is missing is null.
Endpoint
One host, one path per API. The block below shows this call in four languages; every one of them is the same HTTP request. Making requests covers the timeouts, retries and parameter rules that apply to all of them. The SDKs wrap the same call in a typed client.
curl "https://api.apiverve.com/v1/nationaldebt?date=2023-06-15&changes=true" \
-H "x-api-key: your_api_key_here"const res = await fetch('https://api.apiverve.com/v1/nationaldebt?date=2023-06-15&changes=true', {
headers: { 'x-api-key': 'your_api_key_here' },
});
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const { data } = await res.json();
console.log(data);import requests
res = requests.get(
"https://api.apiverve.com/v1/nationaldebt?date=2023-06-15&changes=true",
headers={"x-api-key": "your_api_key_here"},
timeout=15,
)
res.raise_for_status()
print(res.json()["data"])package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.apiverve.com/v1/nationaldebt?date=2023-06-15&changes=true", nil)
req.Header.Set("x-api-key", "your_api_key_here")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(string(out))
}Replace your_api_key_here with the key from your dashboard. When the inputs arrive as a list rather than one at a time, batch requests run up to 200 of them through this same API in a single call.
Authentication
Send your key in the x-api-key header. That is the only auth step — there is no token exchange and no per-endpoint scope to configure. Authentication covers creating, rotating and revoking keys.
A 401 means the key is missing, invalid or expired. A 403 means the key is valid but not permitted here — blocked by a key restriction or an IP allow-list. Running out of credits is a 429.
Parameters
Sent in the query string. Premium parameters are accepted on every plan but only take effect on plans that include them.
| Parameter | Type | Description |
|---|---|---|
dateOptional | string | Optional date in YYYY-MM-DD format for historical lookup. Omit for current data. date |
changesOptional | boolean | Include the previous record's total and the growth over 1 day, 30 days and 1 year |
Response
Every API returns the same three top-level keys, so one response handler covers your whole integration: status, error and data. Only data changes shape. Response format covers the envelope, the other output formats and how premium fields are withheld.
{
"status": "ok",
"error": null,
"data": {
"date": "2026-10-26",
"recordDate": "2026-10-26",
"totalDebt": 40528358939415.85,
"totalDebtFormatted": "$40.53 trillion",
"publicDebt": 32635294814294.48,
"publicDebtFormatted": "$32.64 trillion",
"intragovernmentalDebt": 7893064125121.37,
"intragovernmentalDebtFormatted": "$7.89 trillion",
"perCapita": 120980,
"perCapitaFormatted": "$120,980",
"population": 335000000,
"publicDebtRatio": 80.52,
"perHousehold": 302450.44,
"perHouseholdFormatted": "$302,450",
"previousDebt": 40463151897249.19,
"previousDate": "2026-10-23",
"change1d": 65207042166.66,
"change30d": 431180819664.95,
"change1y": 2519332979958.45,
"changePercent1y": 6.6282,
"averageDailyChange30d": 13909058698.87
}
}
Response fields
Paths are relative to data. Premium fields are absent rather than zeroed on plans that do not include them, so check for presence instead of comparing to 0.
| Field | Type | Example | Description |
|---|---|---|---|
date | string | "2026-10-26" | Date of the national debt data (YYYY-MM-DD format) |
recordDate | string | "2026-10-26" | Treasury record date the figures come from (YYYY-MM-DD); the nearest prior business day when the requested date has no record |
totalDebt | number | 40528358939415.85 | Total US national debt in dollars |
totalDebtFormatted | string | "$40.53 trillion" | Total debt formatted as readable currency string |
publicDebt | number | 32635294814294.48 | US debt held by the public in dollars |
publicDebtFormatted | string | "$32.64 trillion" | Public debt formatted as readable currency string |
intragovernmentalDebtPremium | number | 7893064125121.37 | Intragovernmental debt holdings in dollars |
intragovernmentalDebtFormattedPremium | string | "$7.89 trillion" | Intragovernmental debt formatted as currency string |
perCapitaPremium | number | 120980 | Estimated national debt per person in dollars |
perCapitaFormattedPremium | string | "$120,980" | Per capita debt formatted as currency string |
population | number | 335000000 | US population used for per capita calculations |
publicDebtRatio | number | 80.52 | Public debt as percentage of total debt |
perHouseholdPremium | number | 302450.44 | Estimated national debt per household in dollars |
perHouseholdFormattedPremium | string | "$302,450" | Per household debt formatted as currency string |
previousDebt | number | 40463151897249.19 | Total public debt on the previous Treasury record (with changes=true) |
previousDate | string | "2026-10-23" | Date of the previous Treasury record (YYYY-MM-DD) (with changes=true) |
change1dPremium | number | 65207042166.66 | Change in total debt from the previous record, in US dollars (with changes=true) |
change30dPremium | number | 431180819664.95 | Change in total debt from the record 30 days earlier (or the nearest before it), in US dollars (with changes=true) |
change1yPremium | number | 2519332979958.45 | Change in total debt from the record one year earlier (or the nearest before it), in US dollars (with changes=true) |
changePercent1yPremium | number | 6.6282 | Percent change in total debt over one year (with changes=true) |
averageDailyChange30dPremium | number | 13909058698.87 | Average change in total debt per calendar day over the last 30 days, in US dollars (with changes=true) |
Errors
Read the HTTP status first, then error for the specific reason. The body names the parameter that has to change. Error handling covers the full status list and which of them are worth retrying.
| Status | Meaning | What to do |
|---|---|---|
400 | Input was rejected | Read error; it names the parameter. |
401 | Key missing or invalid | Check the header name and the key value. |
403 | Key valid, but not permitted | A key restriction or IP allow-list; see key scoping. |
429 | Rate limited, or out of credits | Read error to tell them apart; see rate limits. |
Use cases
- Financial Dashboards
- Display real-time national debt figures on financial dashboards and economic monitoring tools
- Economic Research
- Analyze historical debt trends for economic research and policy analysis
- Educational Tools
- Build educational applications showing government debt and per-capita calculations
- News Applications
- Provide up-to-date debt figures for news and media applications
Other ways to use National Debt
Set up National Debt on APIVerve, or reach the same source a different way. Your APIVerve account and credits work on all of them — one key, one balance.
Related
More in Finance: