# US Treasury Financial Data Tracker (`gochujang/us-treasury-tracker`) Actor

Track TGA cash balance, national debt, and Treasury interest rates from the US Treasury FiscalData API. No API key required. Essential for macro traders and government finance analysis.

- **URL**: https://apify.com/gochujang/us-treasury-tracker.md
- **Developed by:** [Hojun Lee](https://apify.com/gochujang) (community)
- **Categories:** Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 item trackeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 Financial Data Tracker — TGA Balance, National Debt & Rates

Track key US government financial data directly from the **US Treasury FiscalData API** — one of the most important datasets for macro traders, bond investors, and government finance analysts. No API key required. Data is official, sourced directly from the US Department of the Treasury.

Monitor the Treasury General Account (TGA) cash balance — often called the "Treasury's checking account at the Fed" — which has enormous implications for financial market liquidity. Track the total national debt and average interest rates on government securities.

### What You Get

#### TGA (Daily Treasury Statement) Dataset

- **TGA closing balance** — daily Treasury General Account balance in millions USD
- **TGA opening balance** — start-of-day balance
- **Daily change** — how much the TGA grew or shrank that day
- **Sentiment label** — `"injection"` (TGA rising = liquidity drain) or `"drain"` (TGA falling = liquidity injection)

#### Public Debt Dataset

- **Total public debt** — total US national debt in billions USD
- **Held by public** — debt sold to external investors (bonds, bills, notes)
- **Intragovernmental holdings** — internal government debt
- **Daily change** — how much debt increased or decreased

#### Interest Rates Dataset

- **Average interest rates** by security type — Treasury Bills, Notes, Bonds, TIPS, FRNs
- Historical rate levels for yield curve analysis

### Input Parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `datasets` | array | `["dts","debt"]` | Datasets to fetch: `"dts"`, `"debt"`, `"rates"` |
| `days` | integer | `30` | Days of history to return (max 365) |

### Sample Output

#### TGA Record

```json
{
  "date": "2025-01-15",
  "dataset": "dts",
  "tga_close_balance_mm": 824500.0,
  "tga_open_balance_mm": 812300.0,
  "tga_daily_change_mm": 12200.0,
  "tga_sentiment": "injection",
  "fetched_at": "2025-01-16T09:00:00Z"
}
```

#### Debt Record

```json
{
  "date": "2025-01-15",
  "dataset": "debt",
  "total_debt_billion_usd": 36141.2,
  "held_by_public_billion_usd": 27542.0,
  "intragovernmental_billion_usd": 8599.2,
  "daily_change_billion_usd": 12.4,
  "fetched_at": "2025-01-16T09:00:00Z"
}
```

### Why the TGA Matters for Markets

The **Treasury General Account (TGA)** is the US government's operating account held at the Federal Reserve. When the TGA declines (the government spends from it), money flows into the private sector — effectively injecting liquidity into financial markets. When the TGA rises (through tax receipts or T-bill issuance), money is drained from the private sector.

Key TGA dynamics that move markets:

- **Debt ceiling suspension/resolution** — TGA rebuilds rapidly after a deal, draining billions of liquidity
- **Tax season** (April/September) — TGA surges as companies/individuals pay taxes
- **End of fiscal year** (September 30) — TGA often volatile as spending accelerates
- **T-bill issuance flood** — rebuilding TGA after debt ceiling requires massive bill issuance

Crypto and risk assets are particularly sensitive to TGA-driven liquidity swings. A falling TGA + rising reverse repo = net liquidity injection = historically bullish for risk assets.

### Use Cases

- **Macro liquidity analysis** — track TGA + reverse repo for net liquidity signal
- **Debt ceiling monitoring** — watch TGA extraordinary measures and resolution
- **Bond market analysis** — understand supply/demand dynamics around Treasury auctions
- **Fiscal deficit tracking** — daily spending vs. receipts from TGA flows
- **Algorithmic trading signals** — TGA drains historically correlate with risk-on moves
- **Government finance research** — academic/policy analysis of fiscal positions

### Data Update Schedule

US Treasury FiscalData updates business days around 4:00 PM ET. Weekend and holiday data is not published. For real-time monitoring, schedule this actor to run once daily at 5:00 PM ET.

### Pricing

Pay-per-event: **$0.002 per dataset fetched** — both `dts` and `debt` costs $0.004 per run regardless of how many days of history.

### FAQ

**What is the TGA?**
The Treasury General Account is the US Treasury's main bank account at the Federal Reserve. All federal receipts flow in (taxes, bond issuance proceeds) and all federal payments flow out (Social Security, defense, interest payments).

**Why is TGA a macro signal?**
When TGA falls, money moves from the government into bank accounts (private sector), increasing bank reserves. This is a liquidity injection. The mechanics are similar to QE but via fiscal, not monetary, channels.

**How does the data relate to the debt ceiling?**
When Congress imposes a debt ceiling, Treasury can't issue new debt. Instead it uses "extraordinary measures" and draws down the TGA. Once the ceiling is resolved, Treasury rapidly rebuilds the TGA via T-bill issuance, draining market liquidity.

**Is there intraday TGA data?**
No — the FiscalData API only provides end-of-day figures from the published Daily Treasury Statement.

***

### Related actors

- [Federal Reserve Rate Probability](https://apify.com/gochujang/fed-rate-probability) — SOFR/EFFR + Treasury yield curve to pair with TGA liquidity signals
- [Treasury Auction Tracker](https://apify.com/gochujang/treasury-auction-tracker) — Upcoming T-bill/note/bond auction schedule (TGA rebuild = large supply event)
- [Institutional Crypto Flows](https://apify.com/gochujang/institutional-crypto-flows) — ETF demand that correlates with TGA-driven liquidity cycles

### Feedback

If this actor powers your macro research, a review helps others find it: [Leave a review on Apify Store](https://apify.com/gochujang/us-treasury-tracker#reviews)

***

**Keywords:** US Treasury, TGA, cash balance, national debt, Treasury rates, FiscalData API, macro trading, government finance, debt ceiling, fiscal policy, T-bill yield, fixed income, deficit

# Actor input Schema

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

Which Treasury datasets to fetch. Options: 'dts' (TGA cash balance), 'debt' (public debt outstanding), 'rates' (average interest rates).

## `days` (type: `integer`):

Number of business days of data to return (max 365).

## Actor input object example

```json
{
  "datasets": [
    "dts",
    "debt"
  ],
  "days": 30
}
```

# Actor output Schema

## `results` (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("gochujang/us-treasury-tracker").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("gochujang/us-treasury-tracker").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 gochujang/us-treasury-tracker --silent --output-dataset

```

## MCP server setup

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

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/0cE0p46naZnR3ZWV0/builds/iq4Hw9zjyYrtZ9PVD/openapi.json
