US Treasury Fiscal Data API
Free US Treasury Fiscal Data API with no key: national debt, interest rates, spending, revenue and exchange rates from official government records. Tested.
Endpoint tested and returned HTTP 200 on 2026-08-19
What is the US Treasury Fiscal Data API?
The US Treasury Fiscal Data API is a free, key-free government API providing official federal financial data — national debt figures, average interest rates on Treasury securities, spending, revenue and Treasury exchange rates.
This is the authoritative source for US federal financial statistics, published directly by the Treasury. The datasets go back decades and include the daily national debt, average interest rates by security type, and quarterly Treasury exchange rates used for government reporting.
Query syntax uses JSON:API-style bracket parameters — `page[size]`, `filter=`, `sort=`. That is more structured than most government APIs, though the bracket characters need URL encoding in some HTTP clients.
Quick facts
- Base URL
https://api.fiscaldata.treasury.gov/services/api/fiscal_service- Authentication
- No API key required.
- Rate limit
- No published hard limit; reasonable use expected.
- Pricing
- Free public domain US government data.
- CORS
- Enabled — callable directly from browser JavaScript
- Official docs
- Read the docs
How to use the US Treasury Fiscal Data API
Every request below was executed against the live API on 2026-08-19, and the response shown is the real body it returned — not an illustration.
1. Fetch average Treasury interest rates
GET https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2/accounting/od/avg_interest_rates?page[size]=1
curl 'https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2/accounting/od/avg_interest_rates?page[size]=1'const res = await fetch("https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2/accounting/od/avg_interest_rates?page[size]=1");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);import requests
res = requests.get("https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2/accounting/od/avg_interest_rates?page[size]=1", timeout=20)
res.raise_for_status()
print(res.json()){
"data": [
{
"record_date": "2001-01-31",
"security_type_desc": "Marketable",
"security_desc": "Treasury Notes",
"avg_interest_rate_amt": "6.096",
"src_line_nbr": "2",
"record_fiscal_year": "2001",
"record_fiscal_quarter": "2",
"record_calendar_year": "2001",
"record_calendar_quarter": "1",
"record_calendar_month": "01",
"record_calendar_day": "31"
}
],
"meta": {
"count": 1,
"labels": {
"record_date": "Record Date",
"security_type_desc": "Security Type Description",
"security_desc": "Security Description",
"avg_interest_rate_amt": "Average Interest Rate Amount",
"src_line_nbr": "Source Line Number",
"record_fiscal_year": "Fiscal Year",
"record_fiscal_quarter": "Fiscal Quarter Number",
"record_calendar_year": "Calendar Year",
"record_calendar_quarter": "Calendar Quarter Number",
"record_calendar_month": "Calendar Month Number",
"record_calendar_day": "Calendar Day Number"
},
"dataTypes": {
"record_date": "DATE",
"security_type_desc": "STRING",
"security_desc": "STRING",
"avg_interest_rate_amt": "PERCENTAGE",
"src_line_nbr": "INTEGER",
"record_fiscal_year": "YEAR",
"record_fiscal_quarter": "QUARTER",
"record_calendar_year": "YEAR",
"record_calendar_quarter": "QUARTER",
"record_calendar_month": "MONTH",
"record_calendar_day": "DAY"
},
"dataFormats": {
"record_date": "YYYY-MM-DD",
"security_type_desc": "String",
"security_desc"Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
<dataset path> | path | Required | Dataset endpoint, e.g. v2/accounting/od/avg_interest_rates. v2/accounting/od/avg_interest_rates |
page[size] | integer | Optional | Records per page, max 10000. 10 |
page[number] | integer | Optional | Page number. 2 |
filter | string | Optional | Field filter, e.g. record_date:gte:2026-01-01. record_date:gte:2026-01-01 |
sort | string | Optional | Sort field; prefix with - for descending. -record_date |
fields | string | Optional | Comma-separated fields to return. record_date,avg_interest_rate_amt |
Response fields
dataarray- The records array.
data[].record_datestring- Date of the observation.
data[].security_type_descstring- Marketable or Non-marketable.
data[].security_descstring- Instrument type such as Treasury Notes or Bills.
data[].avg_interest_rate_amtstring- Average interest rate as a string — parse before use.
metaobject- Field descriptions, data types and total record count.
What you can build with the US Treasury Fiscal Data API
- Chart US national debt over time
- Track average interest rates on government borrowing
- Use official Treasury exchange rates for government-compliant reporting
- Support economic research and financial journalism
Common errors and how to fix them
400 on bracket parameters
page[size] brackets were not encoded.
Fix: URL-encode the brackets as %5B and %5D if your HTTP client does not handle them.
Values returned as strings
Numeric fields are JSON strings.
Fix: Parse explicitly before doing arithmetic.
Empty data array
The filter matched nothing or the dataset path is wrong.
Fix: Check the dataset path against the API documentation; paths are long and version-prefixed.
US Treasury Fiscal Data API — frequently asked questions
Is the US Treasury API free?
Yes, completely free with no API key. It is public domain US government data.
What data is available?
National debt, average interest rates on Treasury securities, federal spending and revenue, and the official Treasury exchange rates used for government reporting.
Why do my bracket parameters fail?
page[size] and page[number] contain square brackets that some HTTP clients do not encode automatically. Encode them as %5B and %5D.
How do I get the most recent records?
Sort descending by date with sort=-record_date and set a small page[size].
Tools that pair with this API
JSON Formatter
Format, beautify and minify JSON online with 2-space, 4-space or tab indentation. Sort keys alphabetically and catch syntax errors instantly — free and private.
CSV to JSON Converter
Convert CSV to a JSON array of objects online. Header-row detection, comma/semicolon/tab delimiters and pretty-printed output — 100% in your browser.
Percentage Calculator
Calculate what X% of a number is, what percent one number is of another, and percentage increase or decrease between two values — instantly and free.
US Treasury Fiscal Data is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-19; always check the official documentation before relying on this API in production, as terms and limits can change.