# Treasury Fiscal Data API: Debt, Rates, Auctions, $0.50/1K (`conserving_celerytop/treasury-fiscal-data-api`) Actor

Pull official US Treasury Fiscal Data: Debt to the Penny, average interest rates, exchange rates, auction results, or any documented endpoint. One typed row per record. $0.50 per 1,000 rows. No API key.

- **URL**: https://apify.com/conserving_celerytop/treasury-fiscal-data-api.md
- **Developed by:** [Don Mangu](https://apify.com/conserving_celerytop) (community)
- **Categories:** Business, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.35 / 1,000 treasury data rows

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
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

## Treasury Fiscal Data API

Treasury Fiscal Data API for analysts, fintech teams and researchers: get US national debt, Treasury interest rates, exchange rates and auction results as clean rows with real numbers. $0.50 per 1,000 rows, no API key, no login.

### What does the Treasury Fiscal Data API Actor do?

It reads the official Fiscal Data API (api.fiscaldata.treasury.gov) from the U.S. Department of the Treasury and returns one row per record. Numbers are numbers, not text, and the text "null" the source uses for missing values becomes a real null. Every row has the dataset name, the endpoint, the record date and a source field.

- **Debt to the Penny:** total public debt outstanding, debt held by the public and intragovernmental holdings, per day.
- **Average interest rates:** average rate on Treasury Bills, Notes, Bonds and other securities, per month.
- **Exchange rates:** Treasury reporting rates of exchange, foreign currency units per 1 US dollar, per quarter.
- **Auction results:** bills, notes and bonds with offering, accepted amount, bid-to-cover ratio, yields and rates.
- **Any endpoint:** any of the 180 documented Fiscal Data endpoints, with your own fields, filter and sort.

**Try it now.** The form opens with Debt to the Penny for the last 30 days, capped at 25 rows. Click **Start**. It finishes in a few seconds and costs about 1 cent.

### How to use it

1. Pick **What to get**.
2. Set **Date from** and **Date to** (a date such as 2026-01-01, or a period such as 30 days) and **Maximum rows**.
3. Optional: narrow one dataset by country, security type or security description.
4. For **Any endpoint**, open the "Any endpoint (advanced)" section and enter the endpoint path, such as v2/accounting/od/gold_reserve.
5. Click **Start** and open the table for your mode.

### How much does it cost?

| Event | Price |
|---|---|
| Row (`row`) | $0.0005 ($0.50 per 1,000) |
| Run start | Apify's standard start fee |
| No results, invalid input, API error | Free |

Worked example: the full history of Treasury exchange rates is 19,147 rows. In a test run it returned all 19,147 rows in 33 seconds, so it costs 19,147 x $0.0005 = $9.57. A daily run for the latest Debt to the Penny value costs 1 row, $0.0005 a day, about 1.5 cents a month. You can set a spending limit on any run, and the Actor stops cleanly when it is reached.

### Input

```json
{
  "mode": "debt_to_the_penny",
  "dateFrom": "30 days",
  "maxRows": 25
}
```

Any-endpoint example:

```json
{
  "mode": "any_endpoint",
  "endpoint": "v2/accounting/od/gold_reserve",
  "filter": "record_date:gte:2026-01-01",
  "sortBy": "-record_date",
  "maxRows": 100
}
```

### Output

One row per record. Real row from a test run (exchange rates, country Israel):

```json
{
  "mode": "exchange_rates",
  "dataset": "Treasury Reporting Rates of Exchange",
  "endpoint": "v1/accounting/od/rates_of_exchange",
  "recordDate": "2026-09-30",
  "source": "U.S. Department of the Treasury, Fiscal Data",
  "sourceUrl": "https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v1/accounting/od/rates_of_exchange",
  "country": "Israel",
  "currency": "Shekel",
  "countryCurrency": "Israel-Shekel",
  "exchangeRate": 3.074,
  "effectiveDate": "2026-09-30",
  "status": "ok",
  "charged": true
}
```

Real row from a test run (Debt to the Penny):

```json
{
  "mode": "debt_to_the_penny",
  "recordDate": "2026-10-08",
  "debtHeldByPublic": 32454086117711.32,
  "intragovernmentalHoldings": 7851230093118.4,
  "totalPublicDebtOutstanding": 40305316210829.72,
  "status": "ok",
  "charged": true
}
```

In the any-endpoint mode the record's columns are in the `values` object, typed by the source's own column types. `status` is `ok` for data rows. Free rows have `no_results` (nothing matches), `invalid_input` (for example an unknown endpoint), `invalid_query` (the API rejected a field, filter or sort) or `rate_limited`.

### Related Actors

These Actors are built by the same author. Each answers one kind of question from an official public source, so an AI agent or a workflow can pick the right one by the question. All return one clean row per record, a `source` field naming the original publisher, and free rows for errors and empty results.

| Question | Actor |
| --- | --- |
| What did US federal agencies publish: rules, proposed rules, notices, comment deadlines? | [Federal Register API](https://apify.com/conserving_celerytop/federal-register-api) |
| Which drugs, devices or foods were recalled, and what adverse events were reported? | [FDA Recalls & Drug Adverse Events](https://apify.com/conserving_celerytop/openfda-scraper) |
| Who won a US federal contract or grant? | [USAspending Awards API](https://apify.com/conserving_celerytop/usaspending-awards-api) |
| Which public tenders are open in the EU and the UK? | [Public Tenders API](https://apify.com/conserving_celerytop/eu-uk-public-tenders) |
| What is the official ECB exchange rate for a date? | [Exchange Rates API](https://apify.com/conserving_celerytop/exchange-rates-api) |
| What did a public company file with the SEC, and what are its financials? | [SEC EDGAR Filings API](https://apify.com/conserving_celerytop/sec-edgar-filings-api), [SEC Company Financials API](https://apify.com/conserving_celerytop/sec-company-financials-api) |
| Which startups raised money (SEC Form D)? | [Startup Funding Rounds Tracker](https://apify.com/conserving_celerytop/form-d-funding-rounds) |
| Who is this company in an official register, and who owns it? | [Company Registry Search](https://apify.com/conserving_celerytop/open-company-registries), [GLEIF Ownership Change Monitor](https://apify.com/conserving_celerytop/gleif-ownership-change-monitor-api) |
| Is this company hiring, and for which roles? | [Career Page Jobs Scraper](https://apify.com/conserving_celerytop/live-career-page-jobs-api) |
| Which open access journals and articles cover a topic? | [DOAJ API](https://apify.com/conserving_celerytop/doaj-open-access-api) |
| What are the citation details of a paper or DOI? | [Crossref Works Search](https://apify.com/conserving_celerytop/crossref-works-search) |
| Which new preprints match a topic? | [Preprint Papers API](https://apify.com/conserving_celerytop/preprint-papers-api) |

### FAQ

**Is it legal to use this data?** Yes. The Fiscal Data API is published by the U.S. Department of the Treasury. Its documentation states that the data is free, has no restrictions and may be redistributed, including for commercial use. This Actor reads only that public API.

**Is this an official Treasury product?** No. This Actor is unofficial and is not affiliated with or endorsed by the U.S. Department of the Treasury or the Bureau of the Fiscal Service. It was built by the Actor author.

**What are the limits?** The API returns up to 10,000 rows per request and the Actor pages through the rest. One run returns at most 100,000 rows. Requests are sent one at a time. If the API rate limit is reached, the run ends with a free `rate_limited` row.

**Why are some auction fields empty?** Announced auctions that are not yet held have no results, so results fields are null until the auction day. Set **Date to** to today to leave them out. In auctions mode the date range applies to the auction date.

**How current is the data?** Each dataset follows the schedule of the Treasury. Debt to the Penny is published on business days; the other datasets update less often. The Actor returns what the API holds at the time of the run.

**Which endpoint paths can I use?** Any path from the Fiscal Data dataset list, such as v1/accounting/od/rates_of_exchange. The version prefix is optional. An unknown path ends the run at once with a free error row that suggests close matches.

# Actor input Schema

## `mode` (type: `string`):

Debt to the Penny, average interest rates on Treasury securities, Treasury reporting rates of exchange, Treasury auction results, or any other documented Fiscal Data endpoint.

## `dateFrom` (type: `string`):

Keep records from this date on, as 2026-01-01 or a period such as 30 days. Applies to the record date (the auction date for auctions). Leave empty for no start date.

## `dateTo` (type: `string`):

Keep records up to this date, as 2026-06-30 or a period such as 7 days. Leave empty for no end date.

## `maxRows` (type: `integer`):

Stop after this many rows. Each row is one record and one charged event. The API returns up to 10,000 rows per request; the Actor pages through the rest.

## `sortOrder` (type: `string`):

Newest first or oldest first, by record date (auction date for auctions). In the any-endpoint mode this applies only when Sort field is empty.

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

Exchange rates only: keep one country, spelled as in the data, such as Israel or Euro Zone. Leave empty for all countries.

## `securityType` (type: `string`):

Auctions only: keep Bills, Notes or Bonds. Leave empty for all.

## `securityDescription` (type: `string`):

Average interest rates only: keep one security, spelled as in the data, such as Treasury Bills or Treasury Notes. Leave empty for all.

## `endpoint` (type: `string`):

Any-endpoint mode only: a documented endpoint path, such as v1/accounting/od/gold_reserve. Paths are checked against the Fiscal Data endpoint list; an unknown path ends the run with a free error row.

## `fields` (type: `array`):

Any-endpoint mode only: column names to return, one per line, such as record_date. Leave empty for all columns.

## `filter` (type: `string`):

Any-endpoint mode only: Fiscal Data filter, joined by commas, such as country:eq:Israel,record_date:gte:2026-01-01. Operators: eq, lt, lte, gt, gte, in. Date from and Date to are added to it.

## `sortBy` (type: `string`):

Any-endpoint mode only: column to sort by, with a minus sign for descending, such as -record_date. Leave empty to sort by record date.

## Actor input object example

```json
{
  "mode": "debt_to_the_penny",
  "dateFrom": "30 days",
  "maxRows": 25,
  "sortOrder": "newest_first",
  "securityType": ""
}
```

# Actor output Schema

## `debt` (type: `string`):

Debt to the Penny

## `rates` (type: `string`):

Average interest rates

## `exchange` (type: `string`):

Exchange rates

## `auctions` (type: `string`):

Auctions

## `any` (type: `string`):

Any endpoint

## `all` (type: `string`):

Every row with every field.

## `stats` (type: `string`):

Rows, free rows, requests and time.

# 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 = {
    "mode": "debt_to_the_penny",
    "dateFrom": "30 days",
    "maxRows": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("conserving_celerytop/treasury-fiscal-data-api").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 = {
    "mode": "debt_to_the_penny",
    "dateFrom": "30 days",
    "maxRows": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("conserving_celerytop/treasury-fiscal-data-api").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 '{
  "mode": "debt_to_the_penny",
  "dateFrom": "30 days",
  "maxRows": 25
}' |
apify call conserving_celerytop/treasury-fiscal-data-api --silent --output-dataset

```

## MCP server setup

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

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/B9kR7u58OYBTYGtUU/builds/ey3BfUxym9nSRsail/openapi.json
