# USAspending Federal Awards Scraper (Contracts & Grants) (`cblu/usaspending-federal-awards-scraper`) Actor

Extract US federal award records from the official USAspending.gov Treasury API — contracts, grants, loans and direct payments with recipient, amount, agency, NAICS/PSC/CFDA, and dates. Filter by keyword, recipient, agency, code, state, amount, and date. Pay per award record.

- **URL**: https://apify.com/cblu/usaspending-federal-awards-scraper.md
- **Developed by:** [Steven Carleton](https://apify.com/cblu) (community)
- **Categories:** Lead generation
- **Stats:** 2 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 award records

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## USAspending Federal Awards Scraper — Contracts, Grants & Recipients API

Search and export **US federal award records from the official USAspending.gov API** — the US Treasury's authoritative record of every federal contract, grant, loan, and direct payment. Get the **award ID, recipient name and UEI, award amount, awarding agency, NAICS/PSC/CFDA code, place of performance, and dates**, and optionally the **recipient's mailing address and business categories**. Filter by **keyword, recipient, awarding agency, industry code, program, recipient/place-of-performance state, dollar amount, and date**, then download clean JSON, CSV, or Excel.

This Actor reads the **official USAspending.gov API** (`api.usaspending.gov`) — **no account, no API key, no rate-limit application**. It is the *post-award* companion to federal opportunity feeds: SAM.gov tells you what the government *wants to buy*; USAspending tells you **who actually got paid, how much, and for what** — the data you need for competitive intelligence, subcontractor targeting, and grant research.

### What data do you get?

One result per federal award:

| Field | Example |
|---|---|
| `awardId` / `usaspendingUrl` | `70B01C25F00001121` + direct award link |
| `category` | `contract` or `assistance` |
| `recipientName` / `recipientUei` | `LOCKHEED MARTIN CORP` / `FYHNA5WC8XD7` |
| `awardAmount` / `totalOutlays` | Obligated dollars and outlays to date |
| `awardType` | `DEFINITIVE CONTRACT`, `BLOCK GRANT (A)`... |
| `description` | `CONSTRUCTION OF BORDER BARRIER WALL SYSTEM.` |
| `awardingAgency` / `awardingSubAgency` / `fundingAgency` | `Department of Homeland Security` / `U.S. Customs and Border Protection` |
| `naics` / `psc` | Industry + product/service code with descriptions (contracts) |
| `cfdaNumber` | Assistance Listing / CFDA program number (grants) |
| `startDate` / `endDate` | Period of performance |
| `placeOfPerformanceState` | Where the work happens |
| `recipientAddress` | **Street, city, state, ZIP, county, congressional district, business categories** (optional enrichment) |

### Use cases

- **GovCon competitive intelligence** — see every contract a competitor won last year, by amount, agency, and NAICS. Track who is winning in your market.
- **Subcontractor & supplier lead generation** — pull prime awardees in your industry and state, turn on `includeRecipientAddress` for mailing addresses, and build a targeted outreach list of funded primes who need subs and suppliers.
- **Grant research** — find every federal grant or assistance award for a program (CFDA number), agency, or recipient type; benchmark award sizes; identify active grantees.
- **Market sizing & analytics** — quantify federal spending by agency, industry, geography, and time for BD strategy or investor research.
- **Recipient due diligence** — verify that an entity actually holds the federal awards it claims, with amounts and periods of performance from the source of record.
- **AI agents / MCP** — a clean, filterable interface to federal spending for agent-driven research and enrichment.

### How to use it

Every large construction contract performed in Texas last fiscal year, with recipient addresses:

```json
{
    "awardTypes": ["contracts"],
    "naicsCodes": ["236220"],
    "placeOfPerformanceStates": ["TX"],
    "timePeriodStart": "2024-10-01",
    "timePeriodEnd": "2025-09-30",
    "minAwardAmount": 1000000,
    "includeRecipientAddress": true,
    "maxResults": 500
}
```

Every HHS grant to a university:

```json
{
    "awardTypes": ["grants"],
    "awardingAgency": "Department of Health and Human Services",
    "recipientSearchText": ["university"],
    "timePeriodStart": "2024-10-01",
    "maxResults": 500
}
```

**Filters:** `awardTypes` (contracts, contract-idvs, grants, direct-payments, loans, other), `keywords`, `recipientSearchText`, `awardingAgency`, `naicsCodes`, `pscCodes` (contracts), `cfdaNumbers` (grants), `recipientStates`, `placeOfPerformanceStates`, `timePeriodStart`/`timePeriodEnd`, `minAwardAmount`/`maxAwardAmount`, `includeRecipientAddress`, `maxResults`. At least one narrowing filter is required.

### Data source & freshness

Every run queries the **official USAspending.gov API** live. USAspending is refreshed from the government's financial and award systems (FPDS for contracts, FABS for assistance) on a rolling basis — typically within a day or two of the source transaction. You get whatever USAspending has at the moment of your call; no stale mirror, no monthly file. Because it reads a structured federal API rather than scraping a website, it does not break the way HTML scrapers do.

Notes on coverage: contract awards carry NAICS/PSC codes; assistance awards (grants, direct payments) carry CFDA/Assistance Listing numbers instead — so `naicsCodes`/`pscCodes` apply only to contract award types. The API paginates the top 10,000 matching awards per award-type query (sorted by amount); narrow with filters to reach beyond that.

### Pricing

This Actor uses **pay per result**: you are charged **one `award-record` event per award returned**, and only for records actually delivered. Suggested price **$0.003 per record ($3.00 / 1,000 awards)**.

Why this price: USAspending competitors on the store charge **$0.001–$0.009 per record** (most add an actor-start fee on top). At **$0.003/record with no start fee**, this Actor undercuts the "intelligence"-tier incumbents ($0.005+) while delivering more per record — normalized contract *and* assistance awards in one schema, plus optional recipient-address enrichment that the cheap scrapers do not provide. Start low; you only pay for the awards you keep.

### Why this Actor

- **Official Treasury API, no key** — no SAM.gov-style application, no rate-limit approval, no website scraping to break.
- **Contracts *and* grants in one normalized schema** — most incumbents cover only one; this Actor merges every award category with a single flat record shape.
- **Recipient-address enrichment** — turn awards into mailing lists with one flag, straight from the award record of truth.
- **Pay only for results**, transparent per-record pricing, JSON/CSV/Excel export, and an MCP-ready interface for AI agents.

# Actor input Schema

## `awardTypes` (type: `array`):

Which categories of federal award to search. Contract and assistance types are queried separately and merged.

## `keywords` (type: `array`):

Free-text keywords matched against award descriptions and recipients, e.g. <code>cybersecurity</code>, <code>solar</code>.

## `recipientSearchText` (type: `array`):

Recipient (awardee) name search, e.g. <code>Lockheed</code>, <code>University of Texas</code>.

## `awardingAgency` (type: `string`):

Top-tier awarding agency name, e.g. <code>Department of Defense</code>, <code>Department of Health and Human Services</code>.

## `naicsCodes` (type: `array`):

Industry NAICS codes (contracts only), e.g. <code>236220</code> (commercial building construction).

## `pscCodes` (type: `array`):

Product/Service codes (contracts only), e.g. <code>D307</code> (IT services).

## `cfdaNumbers` (type: `array`):

Assistance Listing (CFDA) program numbers for grants/assistance, e.g. <code>93.778</code> (Medicaid).

## `recipientStates` (type: `array`):

Two-letter state codes of the recipient's location, e.g. <code>TX</code>.

## `placeOfPerformanceStates` (type: `array`):

Two-letter state codes where the work is performed.

## `timePeriodStart` (type: `string`):

Only awards with an action date on or after this date (YYYY-MM-DD). Defaults to 365 days ago.

## `timePeriodEnd` (type: `string`):

Only awards with an action date on or before this date (YYYY-MM-DD). Defaults to today.

## `minAwardAmount` (type: `integer`):

Only awards at or above this dollar amount.

## `maxAwardAmount` (type: `integer`):

Only awards at or below this dollar amount.

## `includeRecipientAddress` (type: `boolean`):

Enrich every award with the recipient's mailing address and business categories (one extra API call per award — slower).

## `includeRawData` (type: `boolean`):

Attach the complete raw USAspending search result to every record under <code>raw</code>.

## `maxResults` (type: `integer`):

Maximum number of award records to return. You are only charged for records actually returned.

## Actor input object example

```json
{
  "awardTypes": [
    "contracts"
  ],
  "recipientSearchText": [
    "Lockheed Martin"
  ],
  "includeRecipientAddress": false,
  "includeRawData": false,
  "maxResults": 500
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "awardTypes": [
        "contracts"
    ],
    "recipientSearchText": [
        "Lockheed Martin"
    ],
    "maxResults": 500
};

// Run the Actor and wait for it to finish
const run = await client.actor("cblu/usaspending-federal-awards-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "awardTypes": ["contracts"],
    "recipientSearchText": ["Lockheed Martin"],
    "maxResults": 500,
}

# Run the Actor and wait for it to finish
run = client.actor("cblu/usaspending-federal-awards-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "awardTypes": [
    "contracts"
  ],
  "recipientSearchText": [
    "Lockheed Martin"
  ],
  "maxResults": 500
}' |
apify call cblu/usaspending-federal-awards-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=cblu/usaspending-federal-awards-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/sYaBC6i7uDZhFscAE/builds/gL9Qi0ycSyGdLEcPF/openapi.json
