# US Treasury Cash (TGA) API
> The US federal government's checking account — the Treasury General Account (TGA) at the Federal Reserve — served from the official Daily Treasury Statement. The TGA is where the government's cash sits, and its day-to-day balance is a closely watched market-liquidity gauge: a falling TGA injects cash into the financial system, a rising one drains it. The balance endpoint returns the latest day's opening balance, total deposits, total withdrawals, closing balance and the net change, in millions and billions of dollars. The history endpoint returns the daily closing TGA balance over a window. The flows endpoint returns the latest day's largest cash deposits and withdrawals by category — withheld and corporate taxes coming in, Social Security and debt redemptions going out — so you can see exactly where the money moved. This is the Treasury-cash and fiscal-liquidity data-cut, distinct from the national-debt, fiscal-deficit and yield-curve APIs in the catalogue. Live, updated each business day, no key on the upstream, nothing stored.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/treasurycash-api/..."
```

## Pricing
- **Free** (Free) — 30,000 calls/Mo, 5 req/s
- **Starter** ($6/Mo) — 335,000 calls/Mo, 15 req/s
- **Pro** ($19/Mo) — 1,410,000 calls/Mo, 40 req/s
- **Scale** ($44/Mo) — 5,050,000 calls/Mo, 100 req/s

## Endpoints

### Treasury

#### `GET /v1/balance` — Latest TGA balance (opening/deposits/withdrawals/closing)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/treasurycash-api/v1/balance"
```

**Response:**
```json
{
    "data": {
        "date": "2026-06-10",
        "source": "US Treasury (Daily Treasury Statement)",
        "net_change_musd": -29315,
        "total_deposits_musd": 27211,
        "closing_balance_busd": 801.084,
        "closing_balance_musd": 801084,
        "opening_balance_busd": 830.399,
        "opening_balance_musd": 830399,
        "total_withdrawals_musd": 56525
    },
    "meta": {
        "timestamp": "2026-06-12T01:41:28.708Z",
        "request_id": "3afa55f7-7a3a-4305-b649-2595ef8113eb"
    },
    "status": "ok",
    "message": "Balance retrieved successfully",
    "success": true
}
```

#### `GET /v1/flows` — Latest day cash deposits & withdrawals by category

**Parameters:**
- `limit` (query, optional, string) — Top categories each side (max 50) Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/treasurycash-api/v1/flows?limit=10"
```

**Response:**
```json
{
    "data": {
        "date": "2026-06-10",
        "source": "US Treasury (Daily Treasury Statement)",
        "top_deposits": [
            {
                "category": "Taxes - Withheld Individual/FICA",
                "amount_musd": 11249
            },
            {
                "category": "Taxes - Non Withheld Ind/SECA Electronic",
                "amount_musd": 5067
            },
            {
                "category": "Taxes - Corporate Income",
                "amount_musd": 2864
            },
            {
                "category": "Taxes - Non Withheld Ind/SECA Other",
                "amount_musd": 2310
            },
            {
                "category": "Public Debt Cash Issues (Table IIIB)",
                "amount_musd": 1759
            },
            {
                "category": "Taxes - Miscellaneous Excise",
                "amount_musd": 804
            },
            {
                "category": "United States Postal Service (USPS)",
                "amount_musd": 362
            },
            {
                "category": "Federal Reserve Earnings",
                "amount_musd": 350
            },
            {
                "category": "DHS - Customs Duties, Taxes, and Fees",
                "amount_musd": 334
            },
            {
                "category": "HHS - Medicare Premiums",
                "amount_musd": 323
            }
        ],
        "top_withdrawals": [
            {
                "category": "SSA - 
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/history` — Daily closing TGA balance over a window

**Parameters:**
- `days` (query, optional, string) — Number of recent days (max 400) Example: `60`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/treasurycash-api/v1/history?days=60"
```

**Response:**
```json
{
    "data": {
        "count": 60,
        "source": "US Treasury (Daily Treasury Statement)",
        "history": [
            {
                "date": "2026-03-18",
                "closing_balance_busd": 875.833,
                "closing_balance_musd": 875833
            },
            {
                "date": "2026-03-19",
                "closing_balance_busd": 882.822,
                "closing_balance_musd": 882822
            },
            {
                "date": "2026-03-20",
                "closing_balance_busd": 870.864,
                "closing_balance_musd": 870864
            },
            {
                "date": "2026-03-23",
                "closing_balance_busd": 909.509,
                "closing_balance_musd": 909509
            },
            {
                "date": "2026-03-24",
                "closing_balance_busd": 876.206,
                "closing_balance_musd": 876206
            },
            {
                "date": "2026-03-25",
                "closing_balance_busd": 837.412,
                "closing_balance_musd": 837412
            },
            {
                "date": "2026-03-26",
                "closing_balance_busd": 823.031,
                "closing_balance_musd": 823031
            },
            {
                "date": "2026-03-27",
                "closing_balance_busd": 848.655,
                "closing_balance_musd": 848655
            },
            {
                "date": "2026-03-30",
                "closing_b
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/treasurycash-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "All amounts are millions of US dollars (musd); a billions figure (busd) is added for the balance. The TGA balance updates each business day. flows excludes the 'Total' summary lines and ranks individual categories by size.",
        "source": "US Treasury Daily Treasury Statement (api.fiscaldata.treasury.gov/v1/accounting/dts, live)",
        "service": "treasurycash-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/flows": "Latest day's largest cash deposits & withdrawals by category (limit=10).",
            "GET /v1/balance": "Latest TGA opening/deposits/withdrawals/closing balance + net change.",
            "GET /v1/history": "Daily closing TGA balance over a window (days=60)."
        },
        "description": "The US federal government's checking account — the Treasury General Account (TGA) at the Federal Reserve — from the official Daily Treasury Statement. balance returns the latest day's opening balance, total deposits, total withdrawals, closing balance and net change; history returns the daily closing TGA balance over a window; flows returns the latest day's largest cash deposits and withdrawals by category. A falling TGA injects cash into markets, a rising one drains it — a closely watched liquidity gauge. Live, no key, nothing stored. The Treasury-cash / fiscal-liquidity data-cut, distinct from the national-debt, fiscal-deficit and yield-curve APIs.",
        "latest_date": "202
…(truncated, see openapi.json for full schema)
```


---
Marketplace page: https://www.oanor.com/api/treasurycash-api
OpenAPI spec: https://www.oanor.com/api/treasurycash-api/openapi.json
