# USAspending Scraper: Federal Contracts & Grants Awards (`dafei-data/usaspending-awards-scraper`) Actor

Government contracts and federal grants award data from the official USAspending.gov API: obligated amount, recipient UEI, agency, NAICS, PSC, state, dates. Only new or modified awards each run for award alerts, free Excel report, no API key. Unofficial tool.

- **URL**: https://apify.com/dafei-data/usaspending-awards-scraper.md
- **Developed by:** [dafei-data](https://apify.com/dafei-data) (community)
- **Categories:** Business, Lead generation
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 results

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 Scraper: Federal Contracts & Grants Awards

Get **US federal contract awards** and **federal grant awards** with the **actual obligated dollar amounts** from the official [USAspending.gov](https://www.usaspending.gov) API (no HTML scraping, no API key). Filter by keyword, awarding agency, **NAICS code**, **PSC code**, state, date, amount and award type. **Incremental mode** returns **only new or modified awards**, so a daily Schedule plus email or Slack gives you **contract award alerts**. Every run also saves a free, **formatted Excel report** (`REPORT.xlsx`) with clickable award links and currency-formatted amounts.

**Who it is for:** government-contracting BD teams tracking competitors' wins, capture managers sizing a market by NAICS/PSC, grant consultants, journalists and analysts.

**Keywords:** USAspending, USAspending.gov, USAspending API, federal awards, federal contract awards, federal grant awards, federal contracts, government contracts, federal grants, federal spending, contract awards, NAICS, PSC, UEI, GovCon, competitor intelligence, award alerts, Excel award report.

> This is an independent tool that uses public data from USAspending.gov. It is not affiliated with or endorsed by the U.S. Department of the Treasury or any U.S. government agency.

### Formatted Excel report (free)

With `excelReport` on (default), each run writes `REPORT.xlsx` to the run's default key-value store: styled and frozen header row, auto-filters, a clickable **Open award** link per row, obligated amount and outlays as real number columns (`#,##0.00`) and obligation / start / end dates as real Excel dates, so you can sort or total immediately. It contains the same rows as the dataset (up to 20,000), costs nothing extra and does not change the dataset. Download it from the run's **Storage → Key-value store** tab or via `https://api.apify.com/v2/key-value-stores/<storeId>/records/REPORT.xlsx`.

> **Looking for open tenders to bid on, not past awards?** Use our sister Actor **[EU & UK Tenders Scraper: TED, Find a Tender, Contracts Finder](https://apify.com/dafei-data/eu-uk-tender-scraper)**. USAspending tells you *who won and for how much*; the tender scraper tells you *what you can bid on next*.

### Try it now: copy-paste input

Paste this into the **Input → JSON** tab and click **Start** (same file: `examples/readme-dod-cyber-10.json`):

```json
{
  "keywords": [
    "cybersecurity"
  ],
  "awardGroups": [
    "contracts"
  ],
  "agencies": [
    "Department of Defense"
  ],
  "dateType": "last_modified_date",
  "maxItems": 10,
  "incremental": false
}
```

#### Sample output

![Sample output table rendered from a real run](https://api.apify.com/v2/key-value-stores/rZAPAMH2laMhiHfpr/records/usaspending-sample-output.png)

*Real Apify cloud run on 2026-10-27 (UTC) with exactly this input: 7 Department of Defense contract awards matching "cybersecurity" modified in the last 7 days (empty recipient name = withheld by design, see `includeRecipientName`).*

### Quick start: ready-to-run examples

Leave `dateFrom`/`dateTo` empty to search the last 7 days.

**1. DoD cybersecurity contracts (daily watch)** – NAICS 541512 / 541519:

```json
{ "keywords": ["cybersecurity"], "awardGroups": ["contracts"], "agencies": ["Department of Defense"], "naicsCodes": ["541512", "541519"], "dateType": "last_modified_date", "maxItems": 100, "incremental": true, "stateStoreName": "watch-dod-cyber" }
```

**2. Big R\&D contracts and IDVs in VA / MD / DC** – PSC DA10, over $1M:

```json
{ "awardGroups": ["contracts", "idvs"], "states": ["VA", "MD", "DC"], "pscCodes": ["DA10"], "minAmount": 1000000, "maxItems": 100 }
```

**3. California research grants over $100k** (grants are published weeks later, so use a longer range):

```json
{ "keywords": ["research"], "awardGroups": ["grants"], "states": ["CA"], "minAmount": 100000, "dateFrom": "2026-07-01", "maxItems": 100 }
```

### Input

| Field | Description |
|---|---|
| `keywords` | Full-text keywords (OR) |
| `awardGroups` | `contracts` (A–D), `idvs` (IDV vehicles: GWACs, BPAs, IDCs), `grants` (02–05). Default `contracts` |
| `agencies` / `subAgencies` | Awarding agency names, e.g. `Department of Defense` / `Department of the Army` |
| `naicsCodes` / `pscCodes` | Contracts & IDVs only, e.g. `541512`, `DA10` |
| `states` | Place-of-performance states, e.g. `VA` |
| `recipients` | Company name / UEI search text |
| `dateFrom` / `dateTo` / `dateType` | Range (default last 7 days) on `action_date`, `last_modified_date` or `date_signed`. Earliest 2007-10-01 |
| `minAmount` / `maxAmount` | Award amount bounds (USD) |
| `maxItems` | Max results per run (default 100, max 50,000) |
| `incremental` / `stateStoreName` | Skip awards already delivered (award + last-modified date) |
| `includeRecipientName` | Default `true`. Output the recipient name for awards dated on/after 2022-04-04 (see *Recipient names* below). `false` = UEI only |

Grant data is usually published several weeks after contracts — use a longer date range for grants.

### Output (one row per award)

`awardId, awardKey, awardGroup, awardType, description, recipientName, recipientNameSource, recipientUei, recipientId, recipientDeidentified, awardingAgency, awardingSubAgency, fundingAgency, fundingSubAgency, amount, outlays, currency, naicsCode, naicsDescription, pscCode, pscDescription, cfdaNumber, cfdaTitle, performanceState, performanceCountry, baseObligationDate, startDate, endDate, lastModified, url, license, attribution`

### Daily award alerts: Schedule + email

1. **Save a task.** Enter example 1, keep `incremental: true`, give it its own `stateStoreName`, leave dates empty, *Save as a new task*. Awards already delivered are skipped and **not charged**; the 7-day window overlaps between runs, so late-published awards are not missed.
2. **Schedule it.** Console → *Schedules* → *Create new*, cron e.g. `0 7 * * *`, add the task. Docs: https://docs.apify.com/platform/schedules
3. **Get an email or Slack message.** Task → *Integrations*: *Send results email via Gmail* (attach CSV/JSON/Excel, https://docs.apify.com/platform/integrations/gmail), *Slack* (https://docs.apify.com/platform/integrations/slack) or an HTTP webhook on `ACTOR.RUN.SUCCEEDED` (https://docs.apify.com/platform/integrations/webhooks).
4. **Optional:** Apify *Monitoring* can email you when a run fails or the dataset is empty (https://docs.apify.com/platform/monitoring).

Note: a day with no new awards gives an empty dataset; the Gmail integration may still send an email.

### Data protection — what we deliberately leave out

- **No Dun & Bradstreet data**: DUNS numbers, recipient street addresses and parent-company D\&B fields are never requested from the API. Recipients are identified by the government's own UEI.
- **No personal data**: direct payments, loans, insurance and "other" assistance (mostly payments to individuals) are not offered. When a recipient looks like a private person (e.g. a sole proprietor named "JOHN A SMITH", or "REDACTED DUE TO PII"), the award is kept but `recipientName`, `recipientUei`, `recipientId` are set to `null` and `recipientDeidentified` = `true`. No executive compensation, no officer names.

#### Recipient names (D\&B and the 2022 UEI transition)

Since **4 April 2022** the federal government identifies entities by the SAM.gov-issued UEI, and entities maintain their legal business name in SAM.gov instead of with Dun & Bradstreet ([GSA bulletin, 2022-04-04](https://content.govdelivery.com/accounts/USGSA/bulletins/311f7c9)). The [SAM.gov Terms of Use](https://sam.gov/about/terms-of-use) state that *"D\&B Open Data may be in entity registration records last updated before April 4, 2022"*. Therefore:

- awards whose base obligation date (or start date) is **on/after 2022-04-04**: `recipientName` is output, `recipientNameSource` = `SAM.gov (award on/after 2022-04-04)`;
- **older awards** (or no date): `recipientName` = `null` because the name may be D\&B Open Data; `recipientUei` is still output;
- `includeRecipientName: false` outputs UEI only for every award.
  USAspending.gov still shows a general D\&B notice ([db_info](https://www.usaspending.gov/db_info)) without a date cut-off; this rule is our conservative reading, not legal advice.

### Pricing

Pay per result: **$2.00 per 1,000 awards** ($0.002 each). In incremental mode, awards already delivered are never charged. Set *Max total charge* to cap spend; the run stops cleanly at the cap.

### Source & licence

Data: USAspending.gov, U.S. Department of the Treasury, Bureau of the Fiscal Service — "available to copy, adapt, redistribute, or otherwise use for non-commercial or for commercial purposes, subject to the Limitation on Permissible Use of Dun & Bradstreet, Inc. Data" ([About](https://www.usaspending.gov/about), [D\&B limitation](https://www.usaspending.gov/db_info)). Every row carries `license` and `attribution`. This Actor is not affiliated with the U.S. Government.

### Related

- [EU & UK Public Tenders Scraper with Bid Alerts](https://apify.com/dafei-data/eu-uk-tender-scraper) — open public tenders in the EU and UK.

# Actor input Schema

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

Full-text keywords (OR-combined) searched across award description, recipient and other text.

## `awardGroups` (type: `array`):

'contracts' (A-D), 'idvs' (IDV contract vehicles), 'grants' (02-05). Direct payments, loans, insurance and other assistance are not offered (they are mostly payments to individuals). maxItems is split evenly across groups.

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

Exact names, e.g. "Department of Defense", "Department of Homeland Security".

## `subAgencies` (type: `array`):

Exact names, e.g. "Department of the Army".

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

Contracts/IDVs only. 2-6 digit prefixes, e.g. 541512.

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

Contracts/IDVs only. Product/Service Codes, e.g. DA10, R425.

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

2-letter US state codes, e.g. VA, MD, CA.

## `recipients` (type: `array`):

Company name or UEI text.

## `dateFrom` (type: `string`):

YYYY-MM-DD. Default: 7 days ago. Earliest 2007-10-01. Note: grant data is typically published weeks later than contracts.

## `dateTo` (type: `string`):

YYYY-MM-DD. Default: today.

## `dateType` (type: `string`):

Which award date the range applies to. Use last_modified_date for daily monitoring.

## `minAmount` (type: `integer`):

Optional.

## `maxAmount` (type: `integer`):

Optional.

## `maxItems` (type: `integer`):

Maximum awards to output per run (each is one billable result).

## `incremental` (type: `boolean`):

Remember delivered awards (award + last-modified date) in a named key-value store and skip them next run.

## `stateStoreName` (type: `string`):

Use different names for different saved searches.

## `includeRecipientName` (type: `boolean`):

Output the recipient (company) name. Names are only output for awards whose base obligation / start date is on or after 2022-04-04 (UEI transition: names come from SAM.gov registrations). For older awards the name may be D\&B Open Data, so it is left empty (UEI is still given). Set false to output UEI only.

## `excelReport` (type: `boolean`):

Also save a ready-to-share Excel file (REPORT.xlsx) to the run's default key-value store: styled header, frozen first row, filters, clickable links and number-formatted amount and date columns. Free: it does not add any charge and does not change the dataset.

## Actor input object example

```json
{
  "awardGroups": [
    "contracts"
  ],
  "dateType": "action_date",
  "maxItems": 10,
  "incremental": true,
  "stateStoreName": "usaspending-seen-ids",
  "includeRecipientName": true,
  "excelReport": true
}
```

# Actor output Schema

## `awards` (type: `string`):

No description

## `overview` (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 = {
    "awardGroups": [
        "contracts"
    ],
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("dafei-data/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 = {
    "awardGroups": ["contracts"],
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("dafei-data/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 '{
  "awardGroups": [
    "contracts"
  ],
  "maxItems": 10
}' |
apify call dafei-data/usaspending-awards-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,dafei-data/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/g7SXnyIUTBVprGq7c/builds/3UdIhUsCmFo1aUQVY/openapi.json
