TL;DR
USAspending.gov is the US government's official source for federal spending data, tracking trillions of dollars in contracts, grants, loans, and direct payments. The API provides access to agency budgets, award recipients, geographic spending breakdowns, and financial assistance data. All data is sourced from the Treasury and federal agency financial systems. The REST API returns JSON and is completely open — no API key, no rate limits documented. Essential for transparency research, journalism, and civic tech applications.
Quick start: https://api.usaspending.gov/api/v2/references/toptier_agencies/
No API key needed — just make a request!
How to Use This API
1. List All Top-Tier Agencies
https://api.usaspending.gov/api/v2/references/toptier_agencies/
2. Get Agency Spending
https://api.usaspending.gov/api/v2/agency/012/
3. Search Awards
https://api.usaspending.gov/api/v2/search/spending_by_category/?filters={%22time_period%22:[{%22start_date%22:%222022-01-01%22,%22end_date%22:%222022-12-31%22}]}
4. JavaScript — Browse Agencies
fetch('https://api.usaspending.gov/api/v2/references/toptier_agencies/')
.then(r => r.json())
.then(data => {
data.results.forEach(agency => {
console.log(`${agency.agency_name}: $${agency.current_total_budget_authority_amount.toLocaleString()}`);
});
});
5. Python — Agency Budget Comparison
import requests
data = requests.get(
'https://api.usaspending.gov/api/v2/references/toptier_agencies/'
).json()
for agency in sorted(data['results'],
key=lambda a: a['current_total_budget_authority_amount'],
reverse=True)[:10]:
budget = agency['current_total_budget_authority_amount'] / 1e12
print(f"{agency['abbreviation']:10s}: ${budget:.2f}T")
https://api.usaspending.gov/api/v2/references/toptier_agencies/
Frequently Asked Questions
- What spending categories does USAspending cover?
- The platform tracks contracts (procurement), grants, loans, direct payments, insurance, and other financial assistance. Data goes back to fiscal year 2000.
- How is the data organized?
- Data is organized by agency (top-tier and sub-tier), award type, CFDA program, NAICS industry code, product/service code, geographic location (state/county/district), and fiscal year.
- Can I get spending by state or congressional district?
- Yes, use the
/api/v2/agency/{code}/endpoint with geographic filters, or query/api/v2/search/spending_by_geography/for location-based spending. - What format does the API use?
- All endpoints return JSON. The API uses POST for complex search queries (with filter objects) and GET for simpler reference data lookups.
- How current is the data?
- Data is typically updated monthly from federal financial systems. There is a lag of approximately 30-60 days for complete reporting.
- Is there documentation for all endpoints?
- Yes, complete API documentation is available at
https://api.usaspending.gov/docs/with endpoint descriptions, parameters, and example responses.
API Details
- API URL
https://api.usaspending.gov/api/v2- Documentation
- api.usaspending.gov
- Category
- Government
- Authentication
- Not Required
- Geographic Coverage
- United States (USA) — federal spending data
What You Can Build
- Government spending transparency dashboard by agency and year
- Congressional district funding analyzer showing where tax dollars go
- Federal contract opportunity aggregator for small businesses
- Grant funding tracker filtered by state and program type
- Journalism research tool comparing budget authority across administrations