# US Treasury API

> US Treasury returns Treasury yields, national debt, and reporting exchange rates as a workflow and API.

US Treasury returns daily Treasury par yields for a requested date or the latest available date; the date is optional. Get national debt returns published debt amounts for a requested date or the latest published day; the date is optional. Get reporting exchange rates returns quarterly rates for a country or currency and date; the country or currency is required.

- Page: https://fous.com/tools/us-treasury
- Handle: `@us-treasury`
- Category: [Finance](https://fous.com/tools/category/finance)
- Source website: https://home.treasury.gov
- Last verified: Sep 30, 2026

## Methods

### Get national debt

Operation `get_national_debt`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

Get US national debt for a date or the latest published day. Dates without a record use the previous published day; early records may lack the debt breakdown.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `date` | string | no | `"2024-07-04"` | Day to look up in YYYY-MM-DD; leave blank to use the latest published day. Example: 2024-07-04. |

**Input schema**

```json
{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "description": "Day to look up in YYYY-MM-DD; leave blank to use the latest published day. Example: 2024-07-04.",
      "examples": [
        "2024-07-04",
        "1993-04-01",
        "2024-06-09"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {},
    {
      "date": "2024-07-04"
    },
    {
      "date": "1993-04-01"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `date` | string | `"2026-09-25"` | Published date used for this record. |
| `currency` | string | `"USD"` | Currency of the debt amounts. |
| `page_url` | string | `"https://fiscaldata.treasury.gov/datasets/debt-to-the-penny/"` | Treasury page for Debt to the Penny. |
| `debt_held_by_the_public` | number or null | `32385874118414.11` | Debt held by the public in US dollars, or null if not reported. |
| `intragovernmental_holdings` | number or null | `7711304001336.8` | Intragovernmental holdings in US dollars, or null if not reported. |
| `total_public_debt_outstanding` | number | `40097178119750.91` | Total public debt outstanding in US dollars. |

**Example input**

```json
{}
```

**Example output**

```json
{
  "date": "2026-09-25",
  "currency": "USD",
  "page_url": "https://fiscaldata.treasury.gov/datasets/debt-to-the-penny/",
  "debt_held_by_the_public": 32385874118414.11,
  "intragovernmental_holdings": 7711304001336.8,
  "total_public_debt_outstanding": 40097178119750.91
}
```

### Get reporting exchange rates

Operation `get_reporting_exchange_rates`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

Get the U.S. Treasury quarterly reporting exchange rate for a country or currency on a given date. If that quarter has no published record, uses the latest preceding quarter. For shared currency names, the Euro is returned for Euro Zone; other shared names use one matching country.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `date` | string | no | `"2025-03-15"` | Date in YYYY-MM-DD, for example 2025-03-15; defaults to today. |
| `country_or_currency` | string | yes | `"Japan"` | Country or currency name, for example Japan, Mexico, or euro. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "country_or_currency"
  ],
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "description": "Date in YYYY-MM-DD, for example 2025-03-15; defaults to today.",
      "examples": [
        "2025-03-15",
        "2024-03-31"
      ]
    },
    "country_or_currency": {
      "type": "string",
      "description": "Country or currency name, for example Japan, Mexico, or euro.",
      "examples": [
        "Japan",
        "euro",
        "Mexico"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "country_or_currency": "Japan"
    },
    {
      "date": "2025-03-15",
      "country_or_currency": "euro"
    },
    {
      "date": "2024-03-31",
      "country_or_currency": "Mexico"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `country` | string | `"Japan"` | Country or currency area listed by Treasury. |
| `currency` | string | `"Yen"` | Currency name listed by Treasury. |
| `page_url` | string | `"https://fiscaldata.treasury.gov/datasets/treasury-reporting-rates-exchange/"` | Treasury dataset page. |
| `record_date` | string | `"2026-06-30"` | Quarter-end date of the Treasury record. |
| `effective_date` | string | `"2026-06-30"` | Date the rate became effective. |
| `currency_per_usd` | number | `162.38` | Units of the currency per 1 U.S. dollar. |

**Example input**

```json
{
  "country_or_currency": "Japan"
}
```

**Example output**

```json
{
  "country": "Japan",
  "currency": "Yen",
  "page_url": "https://fiscaldata.treasury.gov/datasets/treasury-reporting-rates-exchange/",
  "record_date": "2026-06-30",
  "effective_date": "2026-06-30",
  "currency_per_usd": 162.38
}
```

### Get treasury yields

Operation `get_treasury_yields`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

Get official daily Treasury par yield curve rates for a date, or the latest available date. Non-publishing days use the previous published date; maturities not published for a date are null.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `date` | string | no | `"2026-09-27"` | Requested calendar date (YYYY-MM-DD), such as 2024-01-01. Defaults to today and returns the latest published date on or before it. |

**Input schema**

```json
{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "description": "Requested calendar date (YYYY-MM-DD), such as 2024-01-01. Defaults to today and returns the latest published date on or before it.",
      "examples": [
        "2026-09-27",
        "1990-01-03",
        "2024-01-01"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "date": "2026-09-27"
    },
    {},
    {
      "date": "1990-01-03"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `date` | string | `"2026-09-25"` | Publication date for these rates. |
| `page_url` | string | `"https://home.treasury.gov/resource-center/data-chart-center/interest-rates/daily-treasury-rates.csv/2026/all?type=daily` | Official Treasury link to this year’s published rates. |
| `yield_1_year` | number or null | `4.5` | Treasury yield in percent, or null when not published. |
| `yield_2_year` | number or null | `4.81` | Treasury yield in percent, or null when not published. |
| `yield_3_year` | number or null | `4.94` | Treasury yield in percent, or null when not published. |
| `yield_5_year` | number or null | `4.98` | Treasury yield in percent, or null when not published. |
| `yield_7_year` | number or null | `5.06` | Treasury yield in percent, or null when not published. |
| `yield_10_year` | number or null | `5.17` | Treasury yield in percent, or null when not published. |
| `yield_1_month` | number or null | `4.04` | Treasury yield in percent, or null when not published. |
| `yield_20_year` | number or null | `5.54` | Treasury yield in percent, or null when not published. |
| `yield_2_month` | number or null | `4.2` | Treasury yield in percent, or null when not published. |
| `yield_30_year` | number or null | `5.49` | Treasury yield in percent, or null when not published. |
| `yield_3_month` | number or null | `4.24` | Treasury yield in percent, or null when not published. |
| `yield_4_month` | number or null | `4.32` | Treasury yield in percent, or null when not published. |
| `yield_6_month` | number or null | `4.33` | Treasury yield in percent, or null when not published. |
| `yield_1_5_month` | number or null | `4.14` | Treasury yield in percent, or null when not published. |

**Example input**

```json
{
  "date": "2026-09-27"
}
```

**Example output**

```json
{
  "date": "2026-09-25",
  "page_url": "https://home.treasury.gov/resource-center/data-chart-center/interest-rates/daily-treasury-rates.csv/2026/all?type=daily_treasury_yield_curve&page&_format=csv",
  "yield_1_year": 4.5,
  "yield_2_year": 4.81,
  "yield_3_year": 4.94,
  "yield_5_year": 4.98,
  "yield_7_year": 5.06,
  "yield_10_year": 5.17,
  "yield_1_month": 4.04,
  "yield_20_year": 5.54,
  "yield_2_month": 4.2,
  "yield_30_year": 5.49,
  "yield_3_month": 4.24,
  "yield_4_month": 4.32,
  "yield_6_month": 4.33,
  "yield_1_5_month": 4.14
}
```

## Quick start

Replace `YOUR_API_KEY` with a Fous API key. To create one, open Developers at the bottom of Fous Studio, turn on Developer mode, then go to API keys (https://app.fous.com/keys). Change the values in `input` to run the same tool on new data.

```bash
curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 180 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@us-treasury",
  "visibility": "public",
  "operation": "get_national_debt",
  "version": 1,
  "input": {},
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
import json
import urllib.error
import urllib.request

api_key = "YOUR_API_KEY"

body = json.loads("{\n  \"api\": \"@us-treasury\",\n  \"visibility\": \"public\",\n  \"operation\": \"get_national_debt\",\n  \"version\": 1,\n  \"input\": {},\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=180) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
const apiKey = "YOUR_API_KEY";

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(180_000),
  body: JSON.stringify({
  "api": "@us-treasury",
  "visibility": "public",
  "operation": "get_national_debt",
  "version": 1,
  "input": {},
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

## Use from an AI assistant

Connect this tool to Claude Code, Claude Desktop, Cursor, VS Code, Codex and any MCP client as its own MCP server. Each method is a typed tool whose arguments are the method’s input.

- Server URL: `https://api.fous.com/mcp/tools/us-treasury`
- Authorization: `Authorization: Bearer <Fous API key>`

**Tools**

- `get_national_debt`: Get national debt. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `get_reporting_exchange_rates`: Get reporting exchange rates. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `get_treasury_yields`: Get treasury yields. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `fous_get_run`: the result of a run that was still going, by its `request_id`. Free.

Claude Code:

```bash
claude mcp add --scope user --transport http fous-us-treasury https://api.fous.com/mcp/tools/us-treasury --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"
```

To give the assistant every tool, connect `https://api.fous.com/mcp`: it finds one with `fous_search_tools` and runs it with `fous_run_tool`. Setup for other clients: https://fous.com/llms-full.txt.

## Use cases

- Compare Treasury yields across maturities and dates
- Track changes in published national debt
- Convert U.S. dollar amounts using Treasury reporting rates
- Check the effective date of a currency rate

## FAQ

### Can I run it with my own inputs?

Yes. Change the inputs in Studio and press Run, or send new inputs from your code, or ask a connected AI assistant.

### Can I call this US Treasury tool as an API?

Yes. Send a POST request to /v1/query with your Fous API key and the inputs, and get JSON back.

### How much does it cost?

Each completed run costs 1 credit. Failed runs without a completed receipt are free; completed work can remain charged if delivery is interrupted. With pay as you go, a credit costs 1¢. Monthly plans cost less per credit.

### Do I need a US Treasury account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from home.treasury.gov when you run it. Some results are reused for up to 24 hours, and results that use your account or key are never reused. It was last verified on Sep 30, 2026.

### What are the Treasury yields for a date?

Get treasury yields returns daily par yields by maturity for the requested date, or the latest available date.

### What is the national debt on a given day?

Get national debt returns the published total debt for the requested date or latest published day, with debt breakdowns when reported.

### What is the Treasury exchange rate for a country or currency?

Get reporting exchange rates returns the quarterly rate, expressed as currency units per U.S. dollar, for the requested country or currency.

## Related

- [Investing.com API](https://fous.com/tools/investing-com.md): Investing.com provides financial markets data and news, economic releases up to 31 days, and current commodity prices and government bond yields, which may be delayed or indicative.
- [European Central Bank API](https://fous.com/tools/european-central-bank.md): The European Central Bank provides official euro reference rates and informational currency conversions using the latest preceding published rates when needed, plus current key interest rates and optionally earlier changes.
- [XE API](https://fous.com/tools/xe.md): XE returns currency conversions and mid-market rates, including current displayed rates for information and published historical daily rates for available UTC dates.
- [Trading Economics API](https://fous.com/tools/trading-economics.md): Trading Economics provides economic indicators, market data and country statistics, including country overviews, latest reported country comparisons and current commodity prices reflecting reported trading days.
- [Bankrate API](https://fous.com/tools/bankrate.md): Bankrate provides personal finance information, national-average mortgage and refinance rates with published dates, and listed savings, CD, and money market rates that may change daily.
- [Wise API](https://fous.com/tools/wise.md): Wise provides current mid-market exchange rates, optional daily rate history, published transfer cost comparisons and delivery estimates, and bank SWIFT/BIC codes and branch locations when available.
- [Freddie Mac API](https://fous.com/tools/freddie-mac.md): Weekly U.S. mortgage rate averages from Freddie Mac’s Primary Mortgage Market Survey.
- [Macrotrends API](https://fous.com/tools/macrotrends.md): Macrotrends provides long-term financial and economic charts, company metric histories, and yearly commodity and index prices; current-year prices may be incomplete.
- [All Finance tools](https://fous.com/tools/category/finance)
