DEV Community

linderroger-eng
linderroger-eng

Posted on

I Built a REST API That Wraps USASpending.gov, SAM.gov and Grants.gov Into One Clean Endpoint

The Problem

Working with US government spending data is painful.

  • USASpending.gov requires complex POST payloads with nested JSON filters
  • SAM.gov needs API key registration and has rate limits
  • Grants.gov has its own completely different format

Every developer building govtech tools has to figure all this out from scratch. I got tired of it.

What I Built

A single REST API that normalizes all three sources into clean, consistent JSON responses.

One GET request. Real data. No auth headaches.

# Get top DoD contracts right now
curl "https://government-contracts-grants-api1.p.rapidapi.com/contracts?agency=Department%20of%20Defense&limit=5" \
  -H "X-RapidAPI-Key: YOUR_KEY" \
  -H "X-RapidAPI-Host: government-contracts-grants-api1.p.rapidapi.com"
Enter fullscreen mode Exit fullscreen mode

Real Data Example

Here is what comes back — actual federal contracts, not mock data:

{
  "count": 3,
  "source": "USASpending.gov",
  "contracts": [
    {
      "contract_id": "HT940216C0001",
      "recipient": "HUMANA GOVERNMENT BUSINESS INC",
      "agency": "Department of Defense",
      "amount_usd": 51269205263.03,
      "start_date": "2016-08-01",
      "end_date": "2025-12-31"
    },
    {
      "contract_id": "DENA0003525",
      "recipient": "NATIONAL TECHNOLOGY & ENGINEERING SOLUTIONS OF SANDIA, LLC",
      "agency": "Department of Energy",
      "amount_usd": 42370311400.75,
      "start_date": "2017-01-18",
      "end_date": "2027-04-30"
    }
  ]
}
Enter fullscreen mode Exit fullscreen mode

Endpoints

  • GET /contracts — Filter by agency, amount, keyword
  • GET /grants — Federal grants from USASpending.gov
  • GET /agencies — All federal agencies with budget data

Use Cases

GovCon intelligence — Track competitor contract wins in real time

Business development — Identify which agencies are spending in your sector

Grant research — Find federal grants filtered by agency and dollar amount

Compliance tools — Build apps on top of real procurement data without scraping

Market analysis — Analyze federal spending trends across agencies

Why Not Just Use The Raw APIs?

You can. But:

  1. USASpending requires a POST with nested filter objects just to search
  2. You need separate auth flows for each source
  3. Response formats are completely different across sources
  4. No single query spans all three datasets

This API handles all of that so you can focus on building.

Free Tier Available

Free tier includes 100 requests/month — enough to prototype and test.

Find it on RapidAPI: Government Contracts & Grants API

Happy to add endpoints based on what people actually need — drop a comment below.

Top comments (0)