# National Debt API

> National Debt provides the US national debt (Debt to the Penny), updated daily from the Treasury. It returns the total public debt, debt held by the public, intragovernmental holdings, per-capita debt calculations, the previous record's total, and on paid plans how much the debt grew over a day, 30 days and a year.

**Endpoint:** `GET https://api.apiverve.com/v1/nationaldebt`  
**Category:** Finance  
**Cost:** 2 credits per call  
**Canonical page:** https://apiverve.com/marketplace/nationaldebt

## Overview

National Debt sources data directly from the US Treasury Fiscal Data API, which is updated daily, and returns the Debt to the Penny figures for the latest record or any date back to 1993. Use the daily total public debt to build a US debt clock or track the national debt over time without parsing Treasury downloads yourself.

Each reading gives the total public debt outstanding, the portion held by the public and the share of the total that represents, with readable strings like $40.53 trillion ready for display. Weekend and holiday dates resolve to the nearest earlier business day, so any calendar date works.

The Free plan returns those headline figures for any date, and changes=true adds the previous record's total and date. Paid plans add intragovernmental holdings, estimated debt per person and per household, and the growth figures: the dollar change over 1 day, 30 days and 1 year, the 1-year percent change and the average daily increase over the last 30 days.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl "https://api.apiverve.com/v1/nationaldebt?date=2023-06-15&changes=true" \
  -H "x-api-key: YOUR_API_KEY"
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `date` | string | No | Optional date in YYYY-MM-DD format for historical lookup. Omit for current data.. date |
| `changes` | boolean | No | Include the previous record's total and the growth over 1 day, 30 days and 1 year. default false |

## Response fields

- `date` — string · Date of the national debt data (YYYY-MM-DD format)
- `recordDate` — string · Treasury record date the figures come from (YYYY-MM-DD); the nearest prior business day when the requested date has no record
- `totalDebt` — number · Total US national debt in dollars
- `totalDebtFormatted` — string · Total debt formatted as readable currency string
- `publicDebt` — number · US debt held by the public in dollars
- `publicDebtFormatted` — string · Public debt formatted as readable currency string
- `intragovernmentalDebt` — number · Intragovernmental debt holdings in dollars · (premium)
- `intragovernmentalDebtFormatted` — string · Intragovernmental debt formatted as currency string · (premium)
- `perCapita` — number · Estimated national debt per person in dollars · (premium)
- `perCapitaFormatted` — string · Per capita debt formatted as currency string · (premium)
- `population` — number · US population used for per capita calculations
- `publicDebtRatio` — number · Public debt as percentage of total debt
- `perHousehold` — number · Estimated national debt per household in dollars · (premium)
- `perHouseholdFormatted` — string · Per household debt formatted as currency string · (premium)
- `previousDebt` — number · Total public debt on the previous Treasury record (with changes=true)
- `previousDate` — string · Date of the previous Treasury record (YYYY-MM-DD) (with changes=true)
- `change1d` — number · Change in total debt from the previous record, in US dollars (with changes=true) · (premium)
- `change30d` — number · Change in total debt from the record 30 days earlier (or the nearest before it), in US dollars (with changes=true) · (premium)
- `change1y` — number · Change in total debt from the record one year earlier (or the nearest before it), in US dollars (with changes=true) · (premium)
- `changePercent1y` — number · Percent change in total debt over one year (with changes=true) · (premium)
- `averageDailyChange30d` — number · Average change in total debt per calendar day over the last 30 days, in US dollars (with changes=true) · (premium)

## Sample response

```json
{
  "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
  }
}
```

## 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

## SDKs

- **npm** — `npm install @apiverve/nationaldebt` (https://www.npmjs.com/package/@apiverve/nationaldebt)
- **NuGet** — `dotnet add package APIVerve.API.NationalDebt` (https://www.nuget.org/packages/APIVerve.API.NationalDebt)
- **Source** — https://github.com/apiverve/nationaldebt-api

## More

- Full reference: https://docs.apiverve.com/ref/nationaldebt
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
