# US Treasury Fiscal Data Scraper (`parseforge/us-treasury-fiscal-data-scraper`) Actor

Scrape US Treasury fiscal data including national debt totals, daily cash balances, interest rates, savings bond rates, and federal spending breakdowns. Filter by date range across 80+ datasets covering decades of financial history.

- **URL**: https://apify.com/parseforge/us-treasury-fiscal-data-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Developer tools, Automation, Other
- **Stats:** 3 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $6.00 / 1,000 results

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

![ParseForge Banner](https://raw.githubusercontent.com/ParseForge/apify-assets/main/banner.jpg)

## 🏦 US Treasury Fiscal Data Scraper

🚀 Collect US Treasury fiscal data including national debt totals, daily cash balances, interest rates, savings bond rates, and federal spending breakdowns. Filter by date range across 7 datasets covering decades of financial history.

Federal fiscal data powers investment research, economic modeling, and policy analysis. The US Treasury publishes this data across multiple endpoints, but downloading and structuring it manually is time-consuming and requires navigating different interfaces.

The US Treasury Fiscal Data Scraper automates this process, pulling structured records from 7 different Treasury datasets with optional date filtering. Whether you are tracking national debt, monitoring interest rates, or analyzing federal revenue, this tool delivers clean data in seconds.

| | |
|---|---|
| **Target Audience** | Financial analysts, economists, banks, policy researchers, academic researchers |
| **Primary Use Cases** | Debt tracking, interest rate monitoring, exchange rate analysis, revenue research |

### 📋 What Does It Do

This tool collects federal fiscal records from the US Department of the Treasury, covering 7 major datasets. It delivers:

- 💰 **National debt tracking** - daily "Debt to the Penny" figures showing total public debt
- 📈 **Interest rate data** - average interest rates on Treasury securities by maturity
- 💱 **Exchange rates** - Treasury exchange rates for international currencies
- 🏛️ **Debt outstanding** - breakdowns of outstanding federal debt by security type
- 📊 **Revenue collections** - federal tax revenue and collections data
- 🔨 **Treasury auctions** - auction results for government securities

### 🚀 How to Use

1. **Sign Up** - [Create a free account w/ $5 credit](https://console.apify.com/sign-up?fpr=vmoqkp) (takes 2 minutes)
2. **Find the Tool** - Search for "US Treasury Fiscal Data Scraper" in the Apify Store
3. **Set Input** - Select the dataset and set optional date filters
4. **Run It** - Click "Start" and get structured fiscal data in seconds
5. **Download Data** - Export results as CSV, Excel, or JSON from the Dataset tab

### 📊 Data fields

Each record includes: `debt_held_public_amt`, `intragov_hold_amt`, `record_calendar_day`, `record_calendar_month`, `record_calendar_quarter`, `record_calendar_year`, `record_date`, `record_fiscal_quarter`, `record_fiscal_year`, `scrapedAt`, `src_line_nbr`, `tot_pub_debt_out_amt`. These field names come straight from the actor's dataset schema, so what you see here is what lands in your dataset.

### 🚀 How to use

1. 📝 **Sign up.** [Create a free account with $5 credit](https://console.apify.com/sign-up?fpr=vmoqkp) (takes 2 minutes).
2. 🌐 **Open the Actor.** Go to the US Treasury Fiscal Data Scraper page on the Apify Store.
3. 🎯 **Set input.** Configure the input fields in the form (or paste a JSON), then set maxItems.
4. 🚀 **Run it.** Click **Start** and let the Actor collect your data.
5. 📥 **Download.** Grab your results in the **Dataset** tab as CSV, Excel, JSON, or XML.

> ⏱️ Total time from signup to downloaded dataset: **3-5 minutes.** No coding required.

### 🔗 Recommended Actors

Looking for more financial and government data tools? Check out these related actors:

| Actor | Description | Link |
|-------|-------------|------|
| GSA eLibrary Scraper | Government contract data | [Link](https://apify.com/parseforge/gsa-elibrary-scraper) |
| FINRA BrokerCheck Scraper | Broker registration data | [Link](https://apify.com/parseforge/finra-brokercheck-scraper) |
| FAA Aircraft Registry Scraper | Aircraft registration records | [Link](https://apify.com/parseforge/faa-aircraft-registry-scraper) |
| Pitchbook Funds Scraper | Private fund profiles | [Link](https://apify.com/parseforge/pitchbook-funds-scraper) |
| Smart Apify Actor Scraper | Apify marketplace analytics | [Link](https://apify.com/parseforge/smart-apify-actor-scraper) |

**Pro Tip:** 💡 Browse the full [ParseForge catalog](https://apify.com/parseforge) to find more data tools.

### 🆘 Need Help?

If you hit a bug, have questions about setup, or need a scraper we haven't built yet, open our [contact form](https://tally.so/r/BzdKgA) or write to parseforge@protonmail.com. We also take on paid custom data projects.

For faster answers, join our [Discord](https://parseforge.co/discord). It's the best place to get support and suggest new actors.

# Actor input Schema

## `dataset` (type: `string`):

Select the Treasury fiscal dataset to scrape

## `maxItems` (type: `integer`):

Maximum number of records to collect per run.

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

Filter records from this date (YYYY-MM-DD format)

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

Filter records up to this date (YYYY-MM-DD format)

## Actor input object example

```json
{
  "dataset": "v2/accounting/od/debt_to_penny",
  "maxItems": 10
}
```

# Actor output Schema

## `overview` (type: `string`):

Overview

# 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 = {
    "dataset": "v2/accounting/od/debt_to_penny",
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/us-treasury-fiscal-data-scraper").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 = {
    "dataset": "v2/accounting/od/debt_to_penny",
    "maxItems": 10,
}

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

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

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

```

## CLI example

```bash
echo '{
  "dataset": "v2/accounting/od/debt_to_penny",
  "maxItems": 10
}' |
apify call parseforge/us-treasury-fiscal-data-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=parseforge/us-treasury-fiscal-data-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/Ju9wxq219xReRNgUE/builds/IhZT8al9NpBMomXjC/openapi.json
