# US Treasury Fiscal Records — Rates & Debt (`nexgensignal/treasury-fiscal-records`) Actor

Per-record US Treasury fiscal data from the official keyless Fiscal Data API. Average interest rates by security and total public debt, with record dates and units. Public domain, commercial reuse, no personal data.

- **URL**: https://apify.com/nexgensignal/treasury-fiscal-records.md
- **Developed by:** [NexGen Signal](https://apify.com/nexgensignal) (community)
- **Categories:** Business, News, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $33.50 / 1,000 fiscal records

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## US Treasury Fiscal Records — Rates & Debt

**Official source. No API key. Pay per record.**

This actor turns the **U.S. Treasury's Fiscal Data** into clean, per-observation records — the official numbers on what the federal government pays to borrow and how much it owes. Each run reads the keyless Fiscal Data API and delivers one row per observation: the average interest rate on each class of Treasury security, and the total public debt outstanding, with the record date, the fiscal year, the value, and the unit on every record. Fiscal / statistical grain, public-domain and open for commercial reuse, no person fields.

### What this is, in one paragraph

The Bureau of the Fiscal Service publishes the government's own fiscal numbers as a keyless API. This actor reads the datasets you choose — average interest rates by security class, and the debt to the penny — paginates every record newest-first, and flattens each into a single analysis-ready row: which dataset, which date, which series, the value, and the unit. Values are delivered unmodified. You are billed only for records actually delivered.

### Who buys this and for what job

- **Fixed-income desks and macro analysts** tracking the average interest rate the Treasury pays across bills, notes, bonds, and the total debt trajectory.
- **Fintech, research, and dashboard products** displaying official U.S. debt and Treasury-rate series with a clean per-record shape.
- **Economists and journalists** who need the authoritative federal fiscal numbers, dated and sourced.
- **Data engineers** who want a keyless, one-call feed of U.S. Treasury fiscal data reduced to one row per observation.

### Datasets — and what is deliberately excluded

This actor serves two non-FX Fiscal Data datasets:

- **`avg_interest_rates`** — the average interest rate the Treasury pays on each class of security (Treasury Bills, Notes, Bonds, TIPS, and more), monthly.
- **`debt_to_penny`** — the total public debt outstanding, daily, split into debt held by the public and intragovernmental holdings.

It deliberately does **not** serve Fiscal Data's `rates_of_exchange` (Treasury Reporting Rates of Exchange) — that is FX data, already covered by the sibling `fx-rates-tracker` and `currency-exchange-rates` products. That exclusion ships in every run's receipt.

### Licence — open data, commercial reuse permitted

The Bureau of the Fiscal Service is explicit: *"The U.S. Department of the Treasury's Bureau of the Fiscal Service is committed to providing open data. The data on this site is available to copy, adapt, redistribute, or otherwise use for non-commercial and commercial purposes."* As a U.S. Government work it is public domain. Every record carries the required attribution: *"Source: U.S. Department of the Treasury, Bureau of the Fiscal Service (Fiscal Data)."* These are observation records for analysis — not investment or financial advice.

### Fiscal / statistical grain — no person data

This actor works at fiscal / statistical grain — dated national aggregates. There are no natural-person fields in this data, and this actor emits none, with a person-key guard on every record as a backstop.

### Pricing

| Event | Free plan | Bronze | Silver | Gold / Platinum / Diamond |
|-------|-----------|--------|--------|---------------------------|
| `fiscal_record` | $0.05 | $0.045 | $0.04 | $0.0335 |

Delivered before charged. Blocked runs and empty results cost nothing.

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `datasets` | string list | avg\_interest\_rates, debt\_to\_penny | Which Fiscal Data datasets to pull. |
| `dateFrom` | string (YYYY-MM-DD) | — | Optional. Keep only records with a record\_date on or after this date. |
| `maxRecords` | integer | 500 | Ceiling on records delivered and billed. |

### Output

One JSON object per observation. Real examples (values verbatim):

```json
{
  "record_id": "avg_interest_rates:2026-07-31:1",
  "dataset": "avg_interest_rates",
  "record_date": "2026-07-31",
  "record_fiscal_year": "2026",
  "series_label": "Treasury Bills",
  "series_type": "Marketable",
  "value": 3.758,
  "value_field": "avg_interest_rate_amt",
  "unit": "percent per annum",
  "source": "U.S. Treasury Fiscal Data",
  "attribution": "Source: U.S. Department of the Treasury, Bureau of the Fiscal Service (Fiscal Data).",
  "observed_at": "2026-08-19T00:00:00Z"
}
```

```json
{
  "record_id": "debt_to_penny:2026-08-19:1",
  "dataset": "debt_to_penny",
  "record_date": "2026-08-19",
  "series_label": "Total Public Debt Outstanding",
  "value": 40012700535679.44,
  "value_field": "tot_pub_debt_out_amt",
  "unit": "USD",
  "source": "U.S. Treasury Fiscal Data"
}
```

An unbilled `RUN_RECEIPT` records the robots check, the datasets and filters, the excluded FX dataset, rows seen and delivered, and whether charged equals delivered.

### Field reference

Each record is one observation, normalized across datasets. Identity: `record_id` (`dataset:record_date:src_line`), `dataset`, and the dates `record_date`, `record_fiscal_year`, `record_fiscal_quarter`, `record_calendar_year`. The series: `series_label` (the security class or measure) and `series_type` (e.g. Marketable). The data point: `value`, `value_field` (which source field the value came from, so a mixed pull stays self-describing), and `unit` (percent per annum or USD). Provenance: `source`, `source_url`, `licence`, `attribution`, `disclaimer`, and `observed_at`.

### How a run works

A run first re-reads the source's robots posture from your runtime — the Fiscal Data API host serves no robots file, a no-policy posture — and stops at the door if that ever changes. For each dataset you requested, it reads records newest-first, page by page, applying your `dateFrom` filter server-side. Each observation is normalized to one record — the value coerced to a number, the series labelled, the unit attached — and delivered **before** it is charged, so a blocked or empty run costs you nothing. The actor paces between pages, stops at your `maxRecords` ceiling, and records `charge_equals_delivered` in the receipt so you can confirm you were billed for exactly what you received.

### Cost guidance

One `fiscal_record` per delivered observation: cost = observations delivered × your plan's per-record price. `avg_interest_rates` holds about 4,993 records and `debt_to_penny` about 8,375, so a full pull of both is roughly **$670** (Free) / **$447** (Gold). Scope with `dateFrom` (e.g. only the last few years) or a single dataset to keep runs small; 1,000 records is **$50** (Free) / **$33.50** (Gold).

### Why these two series together

Average interest rates and total debt are the two halves of the same fiscal story: `avg_interest_rates` tells you the *price* the government pays to borrow across each class of security, and `debt_to_penny` tells you the *quantity* it owes. Pulled together and keyed on `record_date`, they let you track the cost of federal borrowing over time — rising rates against a rising debt stock — without stitching two separate feeds. Because both are normalized into the same record shape with a `value` and a `value_field`, a mixed pull drops straight into one table and pivots cleanly by dataset, series, and date. Both series update on the official Treasury cadence (monthly for average rates, daily for the debt), so a small newest-first run always returns the current fiscal picture, and diffing runs by `record_date` surfaces each new release.

### Honest limitations

- **Two fiscal datasets** (average interest rates and total debt) — not the entire Fiscal Data catalogue, and by design not FX.
- **Normalized shape.** One `value` per record with a `value_field` label; dataset-specific extra columns (e.g. the public/intragovernmental debt split) are not broken out into separate fields.
- **Values are unmodified** as published; read `unit` and `value_field` to interpret a record.
- **Point-in-time.** Figures are periodically revised; re-run to refresh.
- **No person data** is emitted.

### Differentiation

Distinct from the other macro cells in this fleet: `national-macro-indicator-records` is World Bank global country statistics, and `ecb-bank-interest-rate-records` is euro-area bank rates — this is the **U.S. Treasury's** own fiscal numbers (US Treasury ≠ World Bank ≠ ECB). It deliberately excludes Treasury FX (`rates_of_exchange`), which the fleet's `fx-rates-tracker` and `currency-exchange-rates` already cover, so it does not overlap them.

### The NexGen Signal family

Part of the NexGen Signal family of official-source, pay-per-record products:

- [National Macro Indicator Records — World Bank](https://apify.com/nexgensignal/national-macro-indicator-records)
- [ECB Bank Interest Rate Records — Euro Area MFI](https://apify.com/nexgensignal/ecb-bank-interest-rate-records)
- [Federal Rulemaking Records — US Federal Register](https://apify.com/nexgensignal/federal-rulemaking-records)
- [World Bank Project Records — Development Pipeline](https://apify.com/nexgensignal/world-bank-project-records)
- [Organization Sanctions & LEI Risk](https://apify.com/nexgensignal/organization-sanctions-lei-risk)

*Source: U.S. Department of the Treasury, Bureau of the Fiscal Service (Fiscal Data). Public-domain U.S. Government data, available to copy, adapt, and redistribute for commercial and non-commercial purposes. Reformatted to fiscal records; values unmodified; FX (rates\_of\_exchange) deliberately excluded; no person data emitted.*

# Actor input Schema

## `datasets` (type: `array`):

Which Fiscal Data datasets to pull: avg\_interest\_rates (average interest rates on Treasury securities), debt\_to\_penny (total public debt).

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

Optional. Keep only records with a record\_date on or after this date.

## `maxRecords` (type: `integer`):

Maximum records delivered and billed. You are billed only for records delivered.

## Actor input object example

```json
{
  "datasets": [
    "avg_interest_rates",
    "debt_to_penny"
  ],
  "maxRecords": 500
}
```

# Actor output Schema

## `results` (type: `string`):

The delivered US Treasury fiscal records.

# 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 = {
    "datasets": [
        "avg_interest_rates",
        "debt_to_penny"
    ],
    "maxRecords": 500
};

// Run the Actor and wait for it to finish
const run = await client.actor("nexgensignal/treasury-fiscal-records").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 = {
    "datasets": [
        "avg_interest_rates",
        "debt_to_penny",
    ],
    "maxRecords": 500,
}

# Run the Actor and wait for it to finish
run = client.actor("nexgensignal/treasury-fiscal-records").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 '{
  "datasets": [
    "avg_interest_rates",
    "debt_to_penny"
  ],
  "maxRecords": 500
}' |
apify call nexgensignal/treasury-fiscal-records --silent --output-dataset

```

## MCP server setup

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

```

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/kKzgRFgYWFh0fIVdV/builds/q6D9ECniQuPWcBXQU/openapi.json
