Agent skill · Data & Analytics

usfiscaldata

Query the U.S. Treasury Fiscal Data API for federal financial data including national debt, government spending, revenue, interest rates, exchange rates, and savings bonds. Access 54 datasets and 182 data tables with no API key required. Use when working with U.S. federal fiscal data, national debt tracking (Debt to the Penny), Daily Treasury Statements, Monthly Treasury Statements, Treasury securities auctions, interest rates on Treasury securities, foreign exchange rates, savings bonds, or any U.S. government financial statistics.

LeonChaoXgithub.com/LeonChaoXGitHub ↗
claude-codeMIT
Install
npx skills add LeonChaoX/qinyan-academic-skills --skill usfiscaldata --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 9
SKILL.md size: 7 KB
Bundled scripts: none
Path: skills/15-金融与经济数据/usfiscaldata/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 759
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# 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` ## 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[size]": 100 }) df = pd.DataFrame(resp.json()["data"]) ``` ## Authentication None required. The API is fully open and free. ## Core Parameters | Parameter | Example | Description | |-----------|---------|-------------| | `fields=` | `fields=record_da

What's inside
Steps it walks through
  1. Quick Start
  2. Authentication
  3. Core Parameters
  4. Key Datasets & Endpoints
  5. Debt
  6. Daily & Monthly Statements
  7. Interest Rates & Exchange
  8. Securities & Auctions
  9. Savings Bonds
  10. Response Structure
  11. Common Patterns
  12. Load all pages into a DataFrame
  13. Aggregation (automatic sum)
  14. Reference Files
Ships with 8 files
  • references/api-basics.md
  • references/datasets-debt.md
  • references/datasets-fiscal.md
  • references/datasets-interest-rates.md
  • references/datasets-securities.md
  • references/examples.md
  • references/parameters.md
  • references/response-format.md
More from qinyan-academic-skills
All skills →
About this skill
What does the usfiscaldata skill do?

Query the U.S. Treasury Fiscal Data API for federal financial data including national debt, government spending, revenue, interest rates, exchange rates, and savings bonds. Access 54 datasets and 182 data tables with no API key required. Use when working with U.S. federal fiscal data, national debt tracking (Debt to the Penny), Daily Treasury Statements, Monthly Treasury Statements, Treasury securities auctions, interest rates on Treasury securities, foreign exchange rates, savings bonds, or any U.S. government financial statistics.

How do I install it?

Run `npx skills add LeonChaoX/qinyan-academic-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 LeonChaoX/qinyan-academic-skills, a repository with 759 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.

Keep going