# USAspending Federal Contracts & Grants Scraper (`deanko/usaspending-scraper`) Actor

Export federal contract and grant awards from USAspending.gov by agency, company, NAICS, PSC, state or date. UEI, address, set-aside, offers. No API key.

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

## Pricing

from $1.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 Federal Contracts & Grants Scraper

Export **US federal contract awards, grants, loans and other assistance** from **USAspending.gov**, the official source for all federal spending since 2007. You get clean, flat rows that drop straight into Excel, Google Sheets, your CRM or BI tools.

Search by **keyword, awarding agency, contractor (recipient) name or UEI, NAICS code, PSC code, place-of-performance state, award type, amount and date**. The Actor uses the official USAspending API v2, so there is no API key, no login, no proxies and no blocking.

Think of it as a **federal contracts data API** that needs no code. Run it from the Apify Console, on a schedule, or from your own Python or JavaScript.

### Who is this for?

- **Government contractors and B2B sales teams** who want lists of companies that just won federal contracts in their NAICS code, PSC or state, with UEI and street address.
- **Capture and business development managers** who track competitors, incumbents, recompetes and teaming partners.
- **Analysts, journalists and researchers** who follow federal spending by agency, program, state or congressional district.
- **Developers and data teams** who need USAspending data in a pipeline without writing pagination, retries or agency-name lookups.

### Use cases

- **Federal contractor leads.** List every company that won a new contract in your market. Set `newAwardsOnly`, filter by `naicsCodes` and `states`, and use the recipient address and UEI for outreach and enrichment.
- **Competitor intelligence.** Pull every award a competitor won: agencies, values, NAICS/PSC mix and end dates. With `includeDetails` you also get set-aside type, extent competed and number of offers.
- **Recompete pipeline.** Use `potentialEndDate` (with `includeDetails`) to see which contracts expire soon and who holds them.
- **Teaming and subcontracting.** Find primes holding large active contracts in your niche, and the agencies and offices that buy what you sell.
- **Grant research.** Export grants by keyword or agency with assistance listings (CFDA program numbers).
- **Monitoring.** Schedule a daily or weekly run over a short date range to receive only new award activity.

### Why this Actor

These are concrete features of this Actor, not marketing claims:

- **Official data, no API key.** Queries `api.usaspending.gov` directly. No scraping of HTML pages, so results don't break when the website changes.
- **Place-of-performance state filter.** Filter by US state codes (`VA`, `TX`, ...) directly, with no need to export everything and filter afterwards.
- **Agency names resolved for you.** Type `NASA`, `DHS`, `Department of the Army` or `Department of Defense`. The Actor looks up the official name and decides between department and sub-agency level.
- **Contractor contact basics.** Recipient name, **UEI** and **street address, city, state, ZIP** on every row.
- **Optional contract-intelligence fields.** With `includeDetails`: date signed, potential value including options, potential end date, awarding office, parent company and UEI, business categories (small business, 8(a), woman-owned, veteran-owned...), extent competed, set-aside, number of offers, pricing type, solicitation ID and parent IDV.
- **Large exports.** Up to 100,000 awards per run, collected 100 at a time.
- **Flat rows plus a direct link** to each award page on usaspending.gov.
- **Cost control.** Pay only per award returned. If you set a maximum charge for the run, the Actor stops as soon as it's reached.

### How to use

1. Click **Try for free** (or **Start**) on this page.
2. Pick an **Award type**: `contracts` (default), `idvs`, `grants`, `direct_payments`, `loans` or `other`.
3. Add any filters you need: keywords, agency, recipients, NAICS, PSC, states, amount or dates. Several values in one field are combined with **OR**. Different fields are combined with **AND**.
4. Set **Max results**. The default is 20, which gives a quick, cheap preview.
5. Click **Start**. Then download the dataset as **CSV, Excel, JSON or XML**, or read it through the API.

The default input searches **cybersecurity contracts with activity in the last 90 days**, largest first, and returns 20 rows in a few seconds:

```json
{
  "keywords": ["cybersecurity"],
  "awardType": "contracts",
  "sortBy": "amount",
  "maxItems": 20
}
```

New IT contracts in Virginia and Maryland over $100k, with competition details:

```json
{
  "awardType": "contracts",
  "naicsCodes": ["5415"],
  "states": ["VA", "MD"],
  "minAmount": 100000,
  "dateFrom": "2026-01-01",
  "newAwardsOnly": true,
  "sortBy": "startDate",
  "includeDetails": true,
  "maxItems": 1000
}
```

Everything one contractor won from one agency:

```json
{ "recipients": ["Booz Allen Hamilton"], "awardingAgency": "Department of Homeland Security", "dateFrom": "2025-01-01", "maxItems": 500 }
```

Broadband grants:

```json
{ "awardType": "grants", "keywords": ["broadband"], "dateFrom": "2025-10-01", "maxItems": 200 }
```

#### Input fields

| Field | Description |
|---|---|
| `keywords` | Free text across descriptions, names, IDs and codes, e.g. `cybersecurity`, `drone` |
| `awardType` | `contracts` (default), `idvs` (IDIQ, GWAC, BPA, FSS), `grants`, `direct_payments`, `loans`, `other` |
| `awardingAgency` | Department or sub-agency by name or abbreviation, e.g. `NASA`, `DHS`, `Department of the Army` |
| `recipients` | Contractor / recipient names or UEIs, e.g. `Lockheed Martin` |
| `naicsCodes` | NAICS codes, 2 to 6 digits (prefixes include sub-codes), e.g. `541512`, `5415` |
| `pscCodes` | Product and Service Codes, e.g. `R425`, `D302` |
| `states` | Place-of-performance state codes, e.g. `VA`, `TX` |
| `dateFrom` / `dateTo` | Award activity date range, `YYYY-MM-DD` (default: last 90 days; earliest 2007-10-01) |
| `newAwardsOnly` | Only awards first signed inside the date range (skips modifications to older awards) |
| `minAmount` / `maxAmount` | Award amount range in USD |
| `sortBy` | `amount` (largest first, default), `startDate` or `lastModified` (newest first) |
| `includeDetails` | Adds contract-intelligence fields (one extra request per award, slower) |
| `maxItems` | Maximum number of awards to return (default 20, up to 100,000) |

### Output

Each award is one row. Here is a shortened example from a real run:

```json
{
  "awardId": "36C10B23F0346",
  "url": "https://www.usaspending.gov/award/CONT_AWD_36C10B23F0346_3600_47QSWA18D008Q_4732",
  "recipientName": "MAVERIS LLC",
  "recipientUei": "NEKWPBM5VT33",
  "recipientAddress": "8180 GREENSBORO DR STE 1000",
  "recipientCity": "MCLEAN",
  "recipientState": "VA",
  "recipientZip": "22102",
  "amount": 219083824.48,
  "totalOutlays": 147432546.43,
  "awardType": "DELIVERY ORDER",
  "awardingAgency": "Department of Veterans Affairs",
  "description": "VA CYBERSECURITY OPERATIONS CENTER NEXT GENERATION II (CSOC NG II) SUPPORT",
  "startDate": "2023-09-29",
  "endDate": "2027-09-28",
  "naicsCode": "541511",
  "naicsDescription": "CUSTOM COMPUTER PROGRAMMING SERVICES",
  "pscCode": "R499",
  "popState": "WV",
  "popCongressionalDistrict": "02",
  "scrapedAt": "2026-10-19T08:23:00.024Z"
}
```

| Group | Fields |
|---|---|
| Award | `awardId`, `url`, `generatedInternalId`, `awardType`, `description`, `amount`, `totalOutlays` |
| Recipient | `recipientName`, `recipientUei`, `recipientAddress`, `recipientCity`, `recipientState`, `recipientZip`, `recipientCountry` |
| Agencies | `awardingAgency`, `awardingSubAgency`, `fundingAgency`, `fundingSubAgency` |
| Dates | `startDate`, `endDate`, `baseObligationDate`, `lastModifiedDate`, `scrapedAt` |
| Classification | `naicsCode`, `naicsDescription`, `pscCode`, `pscDescription`, `assistanceListings` (grants) |
| Place of performance | `popCity`, `popState`, `popZip`, `popCounty`, `popCongressionalDistrict`, `popCountry` |
| With `includeDetails` | `dateSigned`, `potentialValue`, `potentialEndDate`, `awardingOffice`, `parentRecipientName`, `parentRecipientUei`, `businessCategories`, `extentCompeted`, `setAside`, `numberOfOffers`, `pricingType`, `solicitationId`, `parentAwardId`, `subawardCount` |

For loans, `amount` is the loan face value. The **Overview** table view in the Console shows the key columns at a glance.

### Pricing

This Actor uses **pay-per-event** pricing:

- **$0.001 per award returned** ($1 per 1,000 rows).
- A tiny **Actor start** fee of $0.00005 per GB of memory, charged once per run.

Worked example: exporting **5,000 contract awards** costs 5,000 × $0.001 = **$5.00**, plus the start fee of a fraction of a cent. The default input (20 rows) costs about **$0.02**. Turning on `includeDetails` doesn't change the price per row; it only makes the run slower.

To cap your spend, set **Max results** or set a maximum charge per run in the run options. The Actor stops once the limit is reached.

### Integrations and API

Run the Actor from your own code with the official Apify client. Replace `<YOUR_APIFY_TOKEN>` with your token from **Settings → API & Integrations**.

**Python**

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("deanko/usaspending-scraper").call(run_input={
    "awardType": "contracts",
    "naicsCodes": ["541512"],
    "states": ["VA"],
    "newAwardsOnly": True,
    "maxItems": 500,
})
for award in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(award["recipientName"], award["amount"], award["url"])
```

**JavaScript / Node.js**

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

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('deanko/usaspending-scraper').call({
    awardType: 'grants',
    keywords: ['broadband'],
    maxItems: 200,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.length, items[0]);
```

You can also connect results to **Google Sheets, Make, Zapier, n8n, Slack, webhooks** and other tools through Apify integrations. Use **Schedules** to get new awards every day or week.

### FAQ

**Where does the data come from?**
From the official [USAspending.gov API](https://api.usaspending.gov/) run by the US Department of the Treasury. It publishes federal award data reported under the DATA Act and FFATA. The Actor does not scrape HTML pages.

**Do I need a USAspending API key?**
No. The USAspending API is public and needs no key or login.

**Are there rate limits?**
USAspending does not publish a fixed rate limit. To stay polite, this Actor requests pages one at a time (up to 100 awards per request) with a short pause between pages. It retries temporary errors (such as HTTP 429 or 5xx) up to 5 times with backoff. With `includeDetails` it makes one extra request per award, so large detailed runs take longer.

**Why are recent Department of Defense contracts missing?**
DoD contract data is published with a **90-day delay** under federal reporting rules. Set `dateFrom` further back for DoD searches.

**What does the date range filter on?**
Award **activity**: new awards and modifications. To get only awards first signed in the range, turn on `newAwardsOnly`.

**Is this SAM.gov?**
No. SAM.gov lists **open opportunities** (solicitations and RFPs). USAspending lists **awarded** contracts and grants: who got paid, how much, and by which agency. Use this Actor to find who wins work in your market.

**Can I get sub-awards?**
Not currently. The Actor returns prime awards. With `includeDetails`, `subawardCount` tells you how many sub-awards exist.

### Limitations

- **One award type per run.** USAspending does not mix contracts, IDVs, grants, loans and other assistance in one search.
- **NAICS and PSC filters apply to contracts and IDVs only.** Grants use assistance listings instead.
- **Prime awards only.** No sub-award rows.
- **Data lag.** Agencies report with a delay (DoD: 90 days), so the newest awards may not appear yet.
- **Redacted individuals.** Awards to individuals are returned exactly as USAspending publishes them, for example `MULTIPLE RECIPIENTS` or `REDACTED DUE TO PII`. The Actor never tries to identify or enrich individuals.
- **Missing fields.** Some awards have no amount, no end date (loans) or no location in the source data. These come through as `null`.
- **Earliest date** is 2007-10-01.

### Legal and privacy

The data comes from the public USAspending.gov API, which publishes federal award data under the DATA Act. This Actor returns organization-level award data only. You are responsible for using the data in line with the laws that apply to you.

### Support and feedback

Found a bug, need a field or filter that's missing, or want a custom export? Open an issue on the **Issues** tab of this Actor page. Feedback and reviews help a lot and are read quickly.

# Actor input Schema

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

Free-text search across award descriptions, recipient names, award IDs and codes. Several values are combined with OR. Leave empty to search all awards. e.g. cybersecurity, drone, janitorial

## `awardType` (type: `string`):

Which kind of federal award to return. One type per run (USAspending does not mix these groups in a single search).

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

Department or sub-agency that made the award, by name or abbreviation. The best match is looked up automatically. e.g. Department of Defense, Department of the Army, NASA, DHS

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

Only awards to recipients whose name or UEI matches. Several values are combined with OR. e.g. Booz Allen, Lockheed Martin

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

Industry codes (2 to 6 digits; shorter codes include all sub-codes). Contracts only. e.g. 541512 (computer systems design), 236220 (commercial construction)

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

Product and Service Codes describing what was bought. Contracts only. e.g. R425 (engineering support), D302 (IT systems development)

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

Two-letter US state codes where the work is performed. Several values are combined with OR. e.g. VA, TX, CA

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

Awards with activity (a new award or modification) on or after this date, YYYY-MM-DD. Earliest allowed 2007-10-01. Leave empty for 90 days ago. Tip: Department of Defense contracts appear with a 90-day delay, so widen this for DoD.

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

Awards with activity on or before this date, YYYY-MM-DD. Leave empty for today.

## `newAwardsOnly` (type: `boolean`):

Only return awards whose base award was signed inside the date range, skipping older awards that merely had a modification. Best for finding fresh wins / new leads.

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

Only awards with at least this total obligated amount.

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

Only awards with at most this total obligated amount.

## `sortBy` (type: `string`):

Order of the results. Matters when the search matches more awards than Max results.

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

Fetch each award's detail record for extra fields: date signed, potential value incl. options, competition and set-aside info, number of offers, pricing type, parent company, business categories, awarding office. Slower (one extra request per award).

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

Stop after this many awards. You pay per award returned, so this also caps the cost ($0.002 each). Raise it for full exports (up to 100,000).

## Actor input object example

```json
{
  "keywords": [
    "cybersecurity"
  ],
  "awardType": "contracts",
  "recipients": [],
  "naicsCodes": [],
  "pscCodes": [],
  "states": [],
  "newAwardsOnly": false,
  "sortBy": "amount",
  "includeDetails": false,
  "maxItems": 20
}
```

# 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 = {
    "keywords": [
        "cybersecurity"
    ],
    "awardingAgency": "",
    "recipients": [],
    "naicsCodes": [],
    "pscCodes": [],
    "states": [],
    "dateFrom": "",
    "dateTo": "",
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("deanko/usaspending-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 = {
    "keywords": ["cybersecurity"],
    "awardingAgency": "",
    "recipients": [],
    "naicsCodes": [],
    "pscCodes": [],
    "states": [],
    "dateFrom": "",
    "dateTo": "",
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("deanko/usaspending-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 '{
  "keywords": [
    "cybersecurity"
  ],
  "awardingAgency": "",
  "recipients": [],
  "naicsCodes": [],
  "pscCodes": [],
  "states": [],
  "dateFrom": "",
  "dateTo": "",
  "maxItems": 20
}' |
apify call deanko/usaspending-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,deanko/usaspending-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/b0RrmBULV1CoNYvmA/builds/uX6CdN6KKt7MNJSe2/openapi.json
