USAspending.gov API

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

Overview

USAspending.gov provides a free, open API to explore how the United States federal government spends taxpayer money across contracts, grants, loans, and more. No API key is required, making it simple for beginners to start querying federal spending data immediately. It is a powerful tool for data journalism, research projects, or anyone interested in government transparency.

💡

Beginner Tip

Use the /api/v2/search/spending_by_award/ endpoint with a POST request to search for specific contracts or grants — the API uses JSON request bodies rather than URL query parameters.

Available Data

Use case: Integrate us federal spending data data into web and mobile applications
USAspending.gov data via REST API
JSON-formatted response data
Freely accessible without authentication

Example Response

JSON Response
{
  "status": "success",
  "data": {
    "result": "Data from USAspending.gov",
    "description": "US federal spending data",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

results List of spending awards or agencies matching your query.
total_count Total number of records matching the query before pagination.
award_id Unique identifier for a specific federal award or contract.
recipient_name Name of the company or organization that received the federal award.
award_amount Total dollar amount of the federal award in USD.
awarding_agency_name Name of the federal agency that issued the award.

Implementation Example

const url = "https://api.usaspending.gov/";
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 The request body is missing required fields or contains invalid filter values.
Check the API documentation for required fields and ensure your JSON body is valid and properly formatted.
Slow response times Some endpoints aggregate large datasets which can take several seconds to respond.
Add pagination using the page and limit parameters, and consider increasing your HTTP timeout to 30+ seconds for complex queries.
Empty results array Your filter criteria may be too narrow or the fiscal year specified has no matching awards.
Broaden your search filters, check that the fiscal year exists (USAspending data starts from FY2001), and verify agency codes are correct.

Matrix Score Breakdown

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

Fully tested on Apr 5, 2026

Technical Specifications

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

Similar APIs

View All →