# x402stock US National Debt Outstanding

> x402stock US National Debt Outstanding is a paid API for AI agents from x402stock.xyz, paid per call via x402, $0.01/call, status healthy (last checked 2026-09-14, last successful call 2026-09-02).

Returns the current US total public debt outstanding to the penny, split into debt held by the public and intragovernmental holdings, with day-over-day change and recent history sourced from the US Treasury FiscalData.

## Facts

- Endpoint: GET https://x402stock.xyz/api/v1/national-debt
- Price: $0.01/call
- Payment: x402
- Status: healthy
- Last checked: 2026-09-14
- Last successful call: 2026-09-02
- Success rate: 100% of calls made through Zero
- Activations on Zero: 2
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402stock-us-national-debt-outstanding-06afa7ad
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_LdoVV68OUCz1gcY2f51hE

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability x402stock-us-national-debt-outstanding-06afa7ad
```

Example prompt: What is the current US national debt to the penny, including the split between debt held by the public and intragovernmental holdings, and how did it change from the prior business day? Pull the last 60 days of history too.

## When to prefer this

Use this endpoint when you need the official, penny-precise US national debt figure directly from the US Treasury FiscalData, including the public vs intragovernmental breakdown and day-over-day change. Prefer it over scraping Treasury websites or using secondary financial data providers when accuracy and authoritative sourcing matter.

## Known failure modes

- limit parameter set to 0 or exceeds 250 — validation error returned
- Treasury FiscalData source temporarily unavailable — stale or null data may be returned
- Request on a weekend or holiday when no new data has been published — prior business day value returned as latest
- Network timeout if upstream Treasury API is slow

## How this service works

The total US public debt outstanding to the penny — the headline national-debt figure — split into debt held by the public and intragovernmental holdings, with the latest value, prior business day, day-over-day change, and recent history. No ticker needed. Updates each business day. Sourced from the US Treasury (FiscalData). Pass `?limit=` for more history (default 30, max 250). From x402stock

## Output

Returns a JSON object with the source (us_treasury), as-of date, series name, unit, latest business day record (date, total_public_debt_outstanding, debt_held_by_public, intragovernmental_holdings), prior business day record, day-over-day change (absolute and percent), and an array of historical daily records up to the requested limit (default 30, max 250).

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "queryParams": {
   "limit": 30
  }
 }
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "$schema": "https://json-schema.org/draft/2020-12/schema",
     "required": [
      "limit"
     ],
     "properties": {
      "limit": {
       "type": "integer",
       "default": 30,
       "maximum": 250,
       "exclusiveMinimum": 0
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "$schema": "https://json-schema.org/draft/2020-12/schema",
     "required": [
      "source",
      "as_of",
      "series",
      "unit",
      "latest",
      "prior",
      "change",
      "change_percent",
      "history"
     ],
     "properties": {
      "unit": {
       "type": "string"
      },
      "as_of": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ]
      },
      "prior": {
       "anyOf": [
        {
         "type": "object",
         "required": [
          "date",
          "total_public_debt_outstanding",
          "debt_held_by_public",
          "intragovernmental_holdings"
         ],
         "properties": {
          "date": {
           "type": "string"
          },
          "debt_held_by_public": {
           "anyOf": [
            {
             "type": "number"
            },
            {
             "type": "null"
            }
           ]
          },
          "intragovernmental_holdings": {
           "anyOf": [
            {
             "type": "number"
            },
            {
             "type": "null"
            }
           ]
          },
          "total_public_debt_outstanding": {
           "anyOf": [
            {
             "type": "number"
            },
            {
             "type": "null"
            }
           ]
          }
         },
         "additionalProperties": false
        },
        {
         "type": "null"
        }
       ]
      },
      "change": {
       
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "unit": "usd",
  "as_of": "2026-06-03T00:00:00.000Z",
  "prior": {
   "date": "2026-06-02",
   "debt_held_by_public": 31597886394124.88,
   "intragovernmental_holdings": 7624098192160.42,
   "total_public_debt_outstanding": 39221984586285.3
  },
  "change": -17009871036.65,
  "latest": {
   "date": "2026-06-03",
   "debt_held_by_public": 31599703500408.55,
   "intragovernmental_holdings": 7605271214840.1,
   "total_public_debt_outstanding": 39204974715248.65
  },
  "series": "debt_to_penny",
  "source": "us_treasury",
  "history": [
   {
    "date": "2026-06-03",
    "debt_held_by_public": 31599703500408.55,
    "intragovernmental_holdings": 7605271214840.1,
    "total_public_debt_outstanding": 39204974715248.65
   }
  ],
  "change_percent": -0.0434
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402stock-us-national-debt-outstanding-06afa7ad/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402stock.xyz](https://www.zero.xyz/host/x402stock.xyz/llms.txt)
