DEV Community

Ava Torres
Ava Torres

Posted on

How to Search Federal Government Contracts and Grants by Keyword, Agency, or Recipient

The US federal government spends over $6 trillion per year. A significant portion of that -- contracts, grants, direct payments, and loans -- is publicly searchable through USAspending.gov. If you work in government contracting, business development, grant writing, journalism, or policy research, this data is one of the most valuable free resources available.

The problem: USAspending.gov has a powerful API, but it's complex. The documentation spans dozens of endpoints with different request formats. Pagination requires tracking page numbers across multiple requests. The response objects are deeply nested. And the search interface on their website limits you to manual, one-at-a-time queries.

What USAspending tracks

Every federal dollar that flows to a recipient gets recorded:

  • Contracts -- who won it, which agency awarded it, the NAICS code, dollar amount, period of performance, competition type
  • Grants -- which organizations received federal grants, from which agency, for what purpose, and how much
  • Direct payments -- federal payments to individuals and organizations
  • Loans -- federal loan programs and their recipients

The data goes back years and covers every federal agency. Total tracked spending exceeds $7 trillion.

Who uses this data

Government contractors track competitor wins. If your competitor just won a $50M contract with the Department of Defense, you want to know about it -- what the contract was for, whether it was competitive or sole-source, and what the period of performance looks like.

BD teams identify opportunities by searching for contracts in their NAICS codes, tracking which agencies are spending in their domain, and identifying small business set-asides they qualify for.

Grant writers find which organizations are receiving federal grants in their program area, which agencies are funding their type of work, and how award sizes compare.

Journalists investigate federal spending patterns -- which contractors receive the most money, which agencies have the highest sole-source rates, and how spending shifts between administrations.

Policy researchers analyze spending trends by agency, category, geography, and recipient type.

The API pain points

If you've tried using the USAspending API directly:

  1. Multiple endpoints -- different endpoints for awards search, spending by geography, spending by agency, and recipient profiles. Each has a different request format.

  2. Complex request bodies -- the advanced award search endpoint requires nested filter objects with specific field names that aren't always obvious from the docs.

  3. Pagination -- results are paginated and you need to track page numbers. Large result sets require many sequential requests.

  4. Nested responses -- award records contain nested objects for the awarding agency, funding agency, recipient, place of performance, and more. Flattening this for analysis requires custom code.

A simpler approach

I built a USAspending Federal Spending Search actor on Apify that handles all of this. Search by:

  • Keyword -- search across award descriptions and recipient names
  • Agency -- filter by awarding or funding agency
  • Award type -- contracts, grants, direct payments, loans
  • Recipient -- search by recipient name
  • Date range -- filter by fiscal year or specific date range
  • Location -- filter by state or congressional district
  • NAICS code -- filter by industry classification

Results come back as clean, flat JSON. Export to CSV, Excel, or Google Sheets directly.

Example searches

"Find all DoD contracts over $1M awarded to companies in Virginia in FY2025" -- this is a single query that would take dozens of manual searches on USAspending.gov.

"Show me all NIH grants related to 'machine learning' in the last 2 years" -- useful for understanding where federal AI research funding is going.

"List all USDA grants to organizations in Iowa" -- relevant for agricultural organizations tracking federal investment in their state.

Combining with other data

Federal spending data is often one input into a broader research workflow:

  • SEC EDGAR Filings -- check if a government contractor is publicly traded and review their financial filings
  • Federal Register Search -- track proposed rules and notices that might affect contract opportunities
  • FEC Campaign Finance -- research political contributions by contractor executives (common in investigative journalism)
  • IRS 990 Nonprofit Search -- for nonprofit grant recipients, check their financial health and other funding sources

All free public data sources with ready-to-use Apify actors.

Getting started

  1. Go to the USAspending Federal Spending Search actor
  2. Enter search terms and filters
  3. Click "Start" -- results are typically ready in under a minute
  4. Export to your preferred format or connect via API

This is official government data from USAspending.gov's public API. No scraping, no authentication required.

Top comments (0)