# USAspending — US Federal Contracts, Grants & Awards (MCP) (`amygraphics/usaspending-awards-scraper`) Actor

USAspending.gov official federal awards data: every US government contract, grant, loan & award — recipient + UEI, amount, NAICS/PSC, dates, place, option values. SAM.gov/FPDS-grade federal spending search, govcon lead lists. Monitor mode = daily NEW awards. No API key. MCP-ready.

- **URL**: https://apify.com/amygraphics/usaspending-awards-scraper.md
- **Developed by:** [Zakaria el bouami](https://apify.com/amygraphics) (community)
- **Categories:** Lead generation, Automation, MCP servers
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## 🇺🇸 USAspending — US Federal Contracts, Grants & Awards (MCP)

**Every US federal award on USAspending.gov — contracts, grants, loans — with recipient, amount, description, NAICS/PSC codes and place of performance.** No API key, no account, no proxy: the official open-data portal, delivered clean. Built for gov-contract sales teams, market researchers, journalists and AI agents (MCP-ready).

- 🎯 **Hard-to-get data** — award **descriptions**, recipient UEI, option/ceiling values, sub-award counts, IDV parents, congress district
- 🔔 **Monitor mode** — daily schedule returns only **NEW** awards: *"who won which US government contract today"*
- 🤖 **Zero setup** — official USAspending REST API, no key, handles rate limits & pagination walls for you
- 💸 **($0.001 + $0.8/1 000)** — among the cheapest clean GovCon data sources in the Store

***

### ✨ Why this Actor and not the USAspending UI?

| | USAspending site | This Actor |
|---|---|---|
| Get **one recipient's** recent awards | click-through UI, export CSV manually | one run, all filters |
| **Monitor** new DoD/VA/NASA awards daily | not possible | monitor mode + schedule |
| Awards matching **NAICS + amount + state** | hidden filters | first-class inputs |
| **Search deeper** than the 10k page wall | impossible | automatic period splitting |
| Feed to Sheets / CRM / AI agents | CSV download | native integration + MCP |

***

### 🚀 Quick start

1. Choose the **scope**: `contracts` (default), `grants`, `loans`, `all`.
2. Set filters — **agencies**, **NAICS codes**, **keywords**, **states**, amounts, dates.
3. Hit **Start** → rows in JSON, CSV, Excel.

```json
{
  "piid": "W912DQ25F3060",
  "awardType": "DEFINITIVE CONTRACT",
  "recipientName": "JACOBS GOVERNMENT SERVICES COMPANY",
  "recipientUei": "HDMBNDVCLYJ7",
  "amount": 6350136.96,
  "awardingAgency": "Department of Defense",
  "description": "RIFS AT CASCADES ISLAND",
  "dateSigned": "2025-09-17",
  "naicsCode": "5413",
  "naicsTitle": "Engineering Services",
  "popCity": "NORTH BONNEVILLE",
  "popState": "WA",
  "popCongressional": "03",
  "awardUrl": "https://www.usaspending.gov/award/353624309",
  "isNew": false
}
```

### 🔔 Monitor mode — the daily GovCon lead list

Set **mode = monitor**, then schedule the actor daily (Apify schedules + email/Slack webhook). It remembers every award ID it has seen (persistent key-value store) and returns **only the new federal awards**: perfect to spot a competitor's win or a new contract in your NAICS steel — before the RFP even goes out.

### 🤖 Built for AI agents (MCP)

```
https://mcp.apify.com?tools=amygraphics/usaspending-awards-scraper
```

*"Which companies won VA contracts above $500k in Washington state last month?"* — your agent answers with real rows.

### 📥 Inputs

| Field | Type | Default | Meaning |
|---|---|---|---|
| `mode` | enum | `search` | `search` · `monitor` (only NEW awards) |
| `scope` | enum | `contracts` | `contracts`, `grants`, `loans`, `other`, `all` |
| `timeFrom` / `timeTo` | date | rolling 7 d | Award signature window |
| `daysBack` | int | `7` | When no start date: rolling window |
| `keywords` | list | — | Free text on descriptions |
| `agencies` | list | — | Top-tier awarders (DoD, VA, HHS, NASA…) |
| `recipientSearch` | string | — | Prime contractor / grantee name |
| `naicsCodes` / `pscCodes` | lists | — | Industry (541511…) + product/service (D301…) |
| `states` | list | — | Where the work happens (WA, TX, DC…) |
| `awardMin` / `awardMax` | number | — | Amount bounds (USD) |
| `maxResults` / `maxPages` | int | `200` / `40` | Volume guards (deep scans split automatically) |
| `includeDetails` | bool | `false` | Add descrip/UEI/options/subawards per award |
| `maxDetails` | int | `50` | Details budget guard |

### 💸 Price

$0.001 to start + **$0.0008 per award** (`award-extracted`) = **$0.8 per 1 000 awards**. Detail enrichment adds one extra API request per enriched award (no extra charge).

### 🟩 Data source

All data comes from **USAspending.gov — the official US government open-data portal** (Transparency Act / DATA Act). No authentication needed: we fetch the public JSON API, page properly, retry rate limits, and split long windows so big surveys complete cleanly.

### 🌐 Keywords

usaspending, government contracts, federal contracts, federal awards, sam.gov awards, DoD contracts, VA contracts, NASA contracts, federal grants, federal loans, govcon data, GSA schedule, prime contractor awards, spending data, NAICS 541511, public procurement USA, award monitoring, MCP, AI agents

***

*Built by [AmyGraphics](https://apify.com/amygraphics) — tested live before publishing. Questions welcome, honest answers only.*

# Actor input Schema

## `mode` (type: `string`):

search = one-off extraction of matching awards. monitor = return only **NEW** awards signed since the previous run — schedule it daily for a true 'who won which contract' feed.

## `scope` (type: `string`):

contracts = DoD/VA/NASA/civilian purchase orders & definitive contracts. grants = federal grants & cooperative agreements. loans = direct & guaranteed federal loans. other = the remainder (insurance, indemnity…). all = everything.

## `timeFrom` (type: `string`):

YYYY-MM-DD — awards signed since this date. Leave empty to use the last 'daysBack' days. The actor splits long windows automatically to beat the API's page wall.

## `timeTo` (type: `string`):

YYYY-MM-DD — awards signed up to this date. Defaults to today.

## `daysBack` (type: `integer`):

Rolling window ending today. Default 7 days. Typical monitor schedule: 1 day; typical first scan: 30–90 days.

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

Free-text on the award description & metadata — e.g. \["cloud hosting", "cybersecurity"], \["medical supplies"], \["construction school"].

## `agencies` (type: `array`):

Top-tier agencies by name — e.g. \["Department of Defense", "Department of Veterans Affairs", "Department of Health and Human Services", "NASA"].

## `recipientSearch` (type: `string`):

Company / organization name as written in federal filings — e.g. "LOCKHEED MARTIN CORPORATION", "BOOZ ALLEN HAMILTON INC". Returns that vendor's awards.

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

Industry classification — e.g. \["541511"] (custom computer programming), \["236220"] (commercial building). Digits only, 2–6 chars.

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

Product & service categories — e.g. \["D301"] (IT facilities ops), \["C219"] (architect-engineer).

## `states` (type: `array`):

Two-letter codes where the work happens — e.g. \["TX", "CA", "WA", "DC"]. Not the recipient's HQ but the work location.

## `awardMin` (type: `number`):

Only awards at or above this value. 0 = no lower bound.

## `awardMax` (type: `number`):

Only awards at or below this value. 0 = no upper bound (biggest contracts reach $1 B+).

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

Hard cap on the number of awards returned. Default 200. Raise for full scans (monitor mode ignores this — it returns only new awards).

## `maxPages` (type: `integer`):

Pagination depth per split window (100 awards/page). Default 40 ≈ 4 000 rows before auto-splitting the period.

## `includeDetails` (type: `boolean`):

One extra request per award: full description, recipient UEI, option/ ceiling values, sub-award counts, parent award (IDV), NAICS & PSC hierarchies, congress district.

## `maxDetails` (type: `integer`):

Budget guard for includeDetails (1 request per award). Default 50.

## `requestDelaySecs` (type: `number`):

Politeness pause between API calls on top of automatic 429 handling. 0 = API-default pace.

## `requestTimeoutSecs` (type: `number`):

How long to wait for the API before retrying.

## Actor input object example

```json
{
  "mode": "search",
  "scope": "contracts",
  "timeFrom": "",
  "timeTo": "",
  "daysBack": 7,
  "keywords": [],
  "agencies": [
    "Department of Veterans Affairs"
  ],
  "recipientSearch": "",
  "naicsCodes": [],
  "pscCodes": [],
  "states": [],
  "awardMin": 0,
  "awardMax": 0,
  "maxResults": 200,
  "maxPages": 40,
  "includeDetails": false,
  "maxDetails": 50,
  "requestDelaySecs": 0,
  "requestTimeoutSecs": 30
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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 = {
    "mode": "search",
    "scope": "contracts",
    "daysBack": 7,
    "keywords": [],
    "agencies": [
        "Department of Veterans Affairs"
    ],
    "naicsCodes": [],
    "pscCodes": [],
    "states": [],
    "maxResults": 200,
    "includeDetails": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("amygraphics/usaspending-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 = {
    "mode": "search",
    "scope": "contracts",
    "daysBack": 7,
    "keywords": [],
    "agencies": ["Department of Veterans Affairs"],
    "naicsCodes": [],
    "pscCodes": [],
    "states": [],
    "maxResults": 200,
    "includeDetails": False,
}

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

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

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

```

## CLI example

```bash
echo '{
  "mode": "search",
  "scope": "contracts",
  "daysBack": 7,
  "keywords": [],
  "agencies": [
    "Department of Veterans Affairs"
  ],
  "naicsCodes": [],
  "pscCodes": [],
  "states": [],
  "maxResults": 200,
  "includeDetails": false
}' |
apify call amygraphics/usaspending-awards-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,amygraphics/usaspending-awards-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

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