# US Treasury Data API — debt, FX & rates (no key) (`synthetic.ia/us-treasury-data`) Actor

Official U.S. Treasury FiscalData: the national debt (Debt to the Penny), Treasury reporting rates of exchange by country/currency, and average interest rates on Treasury securities. Current or historical. Clean HTTP API + MCP, no key. Pay per query.

- **URL**: https://apify.com/synthetic.ia/us-treasury-data.md
- **Developed by:** [Synthetic](https://apify.com/synthetic.ia) (community)
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 1,000 treasury queries

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## US Treasury Data API — debt, FX & rates (no key)

Official **U.S. Treasury FiscalData** as a clean HTTP API (and MCP tool): the **national debt** (Debt to the Penny), the **Treasury reporting rates of exchange** by country/currency, and the **average interest rates** on U.S. Treasury securities — current or over any date range. Authoritative government data, reshaped to clean typed rows. **No API key.** Pay per query.

- 💵 **National debt** — total public debt outstanding, split into debt held by the public vs intragovernmental, daily.
- 💱 **Exchange rates** — the official Treasury reporting rates of exchange used across the U.S. government, by country/currency.
- 📉 **Interest rates** — average interest rates on Treasury bills, notes, bonds and the total marketable/non-marketable debt.
- 🗓️ **Current or historical** — filter any dataset by a date range.
- 💵 Pay per query · no key · official Treasury data.

### The use case it was built for

Track the U.S. national debt for a dashboard, use the official Treasury FX rate for government-facing accounting, or chart interest rates on the debt. This API returns the numbers straight from Treasury, no scraping, no key.

### Sample output (`debt`, latest)

```json
{
  "ok": true, "dataset": "Debt to the Penny", "count": 1,
  "data": [
    { "date": "2026-09-16", "totalPublicDebt": 40094080427790.97,
      "debtHeldByPublic": 32406353922774.30, "intragovernmental": 7687726505016.67 }
  ]
}
```

### How to use

- **HTTP API (Standby):** POST or GET `/debt`, `/exchange-rates`, `/interest-rates`. `GET /` returns help. Example: `GET /exchange-rates?country=Argentina`.
- **Normal run:** pass `{ operation, start, end, ... }`; results land in the dataset + key-value store.
- **MCP tool:** expose it to your agent via Apify's MCP server.

### Input

- **operation** — `debt` · `exchange-rates` · `interest-rates`.
- **start / end** — date range (YYYY-MM-DD). **country / currency** — (exchange-rates) filters. **limit** — cap rows.

### Pricing

**Per query** from **$0.005** (down to $0.002 on higher tiers). One call = one query (a date range returns many rows at once).

### Related Actors

- **[SEC EDGAR API](https://apify.com/synthetic.ia/sec-edgar-api)** — company filings and financials.
- **[Currency Exchange](https://apify.com/synthetic.ia/currency-exchange)** — live ECB market rates and conversion.

### FAQ

**Do I need a key?** No — Treasury FiscalData is keyless.

**How current is the debt?** Debt to the Penny updates each business day.

**Are these market FX rates?** No — they're the Treasury's official reporting rates (quarterly), used across the U.S. government, not live market rates. For market rates use our Currency Exchange actor.

### Notes & limits

Data from the U.S. Department of the Treasury FiscalData API. Up to 1000 rows per call; use a date range to focus.

# Changelog

This Actor's version history is a separate document: https://apify.com/synthetic.ia/us-treasury-data/changelog.md

# Actor input Schema

## `operation` (type: `string`):

Which dataset.

## `start` (type: `string`):

YYYY-MM-DD (earliest record).

## `end` (type: `string`):

YYYY-MM-DD (latest record).

## `country` (type: `string`):

Country name, e.g. Argentina, Brazil-Real.

## `currency` (type: `string`):

Currency name, e.g. Peso, Euro.

## `limit` (type: `integer`):

Max rows (1-1000). Debt defaults to 1 (latest) unless a date range is given.

## Actor input object example

```json
{
  "operation": "debt"
}
```

# Actor output Schema

## `result` (type: `string`):

No description

## `runs` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("synthetic.ia/us-treasury-data").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("synthetic.ia/us-treasury-data").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call synthetic.ia/us-treasury-data --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,synthetic.ia/us-treasury-data"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Bw0eXfnXXbbR6t8NE/builds/i7hjp4r4LvAPZ4UR7/openapi.json
