usfiscaldata
Query the U.S. Treasury Fiscal Data REST API for federal financial data. No API key required. Use for national debt (Debt to the Penny), Daily Treasury Statements, Monthly Treasury Statements, Treasury securities auctions, interest rates, foreign exchange rates, savings bonds, or U.S. government revenue and spending statistics.
npx skills add K-Dense-AI/scientific-agent-skills --skill usfiscaldata --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# U.S. Treasury Fiscal Data API Free, open REST API from the U.S. Department of the Treasury for federal financial data. No API key or registration required. **Base URL:** `https://api.fiscaldata.treasury.gov/services/api/fiscal_service` Browse [54 datasets and 179 data tables](https://fiscaldata.treasury.gov/datasets/) via the dataset search. Verify endpoint paths on each dataset's API Quick Guide — paths change over time. ## Installation ```bash uv pip install requests pandas ``` ## Quick Start ```python import requests import pandas as pd BASE_URL = "https://api.fiscaldata.treasury.gov/services/api/fiscal_service" # Get the current national debt (Debt to the Penny) resp = requests.get(f"{BASE_URL}/v2/accounting/od/debt_to_penny", params={ "sort": "-record_date", "page[size]": 1 }) data = resp.json()["data"][0] print(f"Total public debt as of {data['record_date']}: ${float(data['tot_pub_debt_out_amt']):,.0f}") ``` ```python # Get Treasury exchange rates for recent quarters resp = requests.get(f"{BASE_URL}/v1/accounting/od/rates_of_exchange", params={ "fields": "country_currency_desc,exchange_rate,record_date", "filter": "record_date:gte:2024-01-01", "sort": "-record_date", "page[
- Installation
- Quick Start
- Authentication
- Core Parameters
- Key Datasets & Endpoints
- Debt
- Daily & Monthly Statements
- Interest Rates & Exchange
- Securities & Auctions
- Savings Bonds
- Response Structure
- Common Patterns
- Load all pages into a DataFrame
- Aggregation (automatic sum)
uv pip install requests pandas
What does the usfiscaldata skill do?
Query the U.S. Treasury Fiscal Data REST API for federal financial data. No API key required. Use for national debt (Debt to the Penny), Daily Treasury Statements, Monthly Treasury Statements, Treasury securities auctions, interest rates, foreign exchange rates, savings bonds, or U.S. government revenue and spending statistics.
How do I install it?
Run `npx skills add K-Dense-AI/scientific-agent-skills --skill usfiscaldata --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From K-Dense-AI/scientific-agent-skills, a repository with 32,619 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
