# 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/workflows/us-treasury
- Handle: `@us-treasury`
- Category: [Finance](https://fous.com/workflows/category/finance)
- Source website: https://home.treasury.gov
- Last verified: Sep 30, 2026
- Fous is not affiliated with US Treasury.

## Methods

### Get national debt

Operation `get_national_debt`, version 1. 1 credit per call.

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 call.

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 call.

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

Call the API with a Fous API key (`FOUS_API_KEY`). To create one, turn on Developer mode in Fous Studio, then open Keys & connections → API keys (https://app.fous.com/keys).

```bash
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
: "${FOUS_API_KEY:?Set FOUS_API_KEY before running this example}"

curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 120 \
  -H "Authorization: Bearer $FOUS_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.
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
import json
import os
import urllib.error
import urllib.request

api_key = os.environ.get("FOUS_API_KEY")
if not api_key:
    raise RuntimeError("Set FOUS_API_KEY before running this example")

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=120) 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.
// First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
const apiKey = process.env.FOUS_API_KEY;
if (!apiKey) throw new Error("Set FOUS_API_KEY before running this example");

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(120_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);
```

Or describe the data in plain language: send `{"api":"@us-treasury","prompt":"Describe the data you need, with every detail"}` to the same URL. Fous fills in the input, runs the method that fits and returns only the fields you asked for; `data.route.calls[].request` is the exact call it made. Routing is free; the run costs the same.

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

### Is Fous affiliated with US Treasury?

No. Fous is not affiliated with US Treasury. This workflow reads the public home.treasury.gov website and returns its data.

### How much does it cost?

Each run costs 1 credit. 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; repeating the same request within a day may return the saved result. Fous checks this workflow automatically; it last passed a check 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/workflows/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/workflows/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/workflows/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/workflows/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/workflows/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/workflows/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/workflows/freddie-mac.md): Weekly U.S. mortgage rate averages from Freddie Mac’s Primary Mortgage Market Survey.
- [Macrotrends API](https://fous.com/workflows/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 workflows](https://fous.com/workflows/category/finance)
