Fed Treasury API

⭐ Beginner's Pick Finance / No Auth Required Beginner HTTPS
Free to Use Varies (check documentation)

Overview

The U.S. Treasury Fiscal Data API provides free, official financial data from the U.S. Department of the Treasury, including national debt, federal spending, and government financial statements. No API key is needed — just call the endpoints directly to get reliable, up-to-date data straight from the source. This is an excellent starting point for anyone learning about public finance data or building government data visualizations.

💡

Beginner Tip

Use the "fields" parameter to request only the columns you need — this significantly reduces response size and speeds up your requests. The "sort" and "pagination" parameters help you navigate large datasets without loading everything at once.

Available Data

Response fields: treasury gov
Fed Treasury data via REST API
JSON-formatted response data
Freely accessible without authentication

Example Response

JSON Response
{
  "status": "success",
  "data": {
    "result": "Data from Fed Treasury",
    "description": "U.S. Department of the Treasury Data",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

record_date The date the financial record applies to, in YYYY-MM-DD format.
data Array of objects containing the requested financial data rows.
meta.total_count Total number of records matching the query, used for pagination.
meta.total_pages Total number of pages available given the current page size setting.
links.next URL for the next page of results, or null if on the last page.

Implementation Example

const url = "https://fiscaldata.treasury.gov/api-documentation/";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

400 Bad Request An invalid field name or filter parameter was used in the request.
Check the API documentation for the specific endpoint to see which fields are available; field names are case-sensitive.
Large response times Requesting too many records without pagination.
Always add page[size]=25 or similar to limit results per page and use page[number] to paginate through the data.
Outdated data Treasury data is published on a lag so the most recent entries may be a few days to months old.
Sort results by record_date descending (?sort=-record_date) to always get the latest available data first.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 5/20
🔒 Security 15/15
🛠 Developer XP 15/20
✓ Reliability 7/15
Response Time 1189ms

Fully tested on Apr 5, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS UNKNOWN
Category Finance
Difficulty Beginner
Verified: 2026-04-04

Similar APIs

View All →