# USAspending Awards (`publicrecords/usaspending-awards-scraper`) Actor

USAspending Awards — federal contract/IDV awards from the official USASpending.gov v2 API. Last-30-days default; agency, recipient, NAICS filters → flat JSON.

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

## Pricing

from $1.50 / 1,000 result rows

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 Awards Scraper

### What does USASpending Awards Scraper do?

**USASpending Awards Scraper** queries the official [USAspending.gov](https://www.usaspending.gov) **`spending_by_award`** API and returns **flat federal award rows** — award ID, recipient, UEI, amount, agency, dates, and detail URL.

Defaults to **contracts / IDVs** (`A–D`) over the **last 30 days**, so fresh GovCon intel works out of the box. Optional agency, recipient, NAICS, and keyword filters.

> Not affiliated with the U.S. Department of the Treasury. Spending data may be reused commercially per USAspending licensing, subject to [Dun & Bradstreet limitations](https://www.usaspending.gov/db_info).

#### Why this Actor?

- 🏛 **Official API** — `POST api.usaspending.gov/api/v2/search/spending_by_award/`
- ⏱ **Recent-by-default** — last 30 days → today (not a stale FY dump)
- 🎯 **Agency + recipient + NAICS** — first-class filters for BD workflows
- 🔒 **Contracts/IDVs default** — avoids assistance awards that may list individuals
- 🔁 **Deduped** by `awardId|generatedInternalId`
- 💵 **$0.0015 per successful award**. **Error rows are not charged.**

#### What data can you extract?

| Field | Description |
|-------|-------------|
| `awardId`, `generatedInternalId` | Award identifiers |
| `recipientName`, `recipientUei` | Recipient |
| `awardAmount`, `startDate`, `endDate` | Value & period |
| `awardingAgency`, `description` | Agency / description (search often null) |
| `awardType`, `subaward` | Type / mode flags |
| `detailUrl` | USAspending award page |

***

### How to scrape USASpending awards

1. Open **USASpending Awards Scraper**.
2. Prefer **Agency** (e.g. `Department of Defense`) and/or **Recipient** over broad keywords.
3. Optionally set **NAICS**, **Keywords**, and date range (defaults: last 30 days).
4. Keep **Award types** at `A,B,C,D` unless you intentionally need assistance.
5. Set **Max items** and run (API can be slow — Actor timeout is generous).
6. Export or consume via Apify API.

***

### Input

| Field | Required | Default | Description |
|-------|----------|---------|-------------|
| `keywords` | no | `[]` | → `filters.keywords` |
| `naics` | no | `[]` | → `filters.naics_codes` |
| `agency` | no | `""` (prefill DoD example) | Toptier awarding agency name |
| `recipient` | no | `""` | → `recipient_search_text` array |
| `awardTypes` | no | `A,B,C,D` | Contracts/IDVs |
| `startDate` / `endDate` | no | last 30d → today | YYYY-MM-DD |
| `subawards` | no | `false` | Subawards mode |
| `fetchDetails` | no | `false` | `GET /awards/{id}/` hydrate |
| `maxItems` | no | `50` | Cap (deduped) |

#### Example input

```json
{
  "agency": "Department of Defense",
  "recipient": "Boeing",
  "naics": ["336411"],
  "maxItems": 50
}
```

#### Recent awards (defaults)

```json
{
  "agency": "Department of Defense",
  "awardTypes": ["A", "B", "C", "D"],
  "maxItems": 20
}
```

***

### Billing note

Only default-dataset **success** awards are charged. **Error rows are not charged** (named `errors` dataset / logs).

### Sample output

```json
{
  "recordType": "award",
  "awardId": "DENA0003525",
  "generatedInternalId": "CONT_AWD_DENA0003525_8900_-NONE-_-NONE-",
  "recipientName": "NATIONAL TECHNOLOGY & ENGINEERING SOLUTIONS OF SANDIA, LLC",
  "recipientUei": "LUJEPCRRT377",
  "awardAmount": 43198566451.99,
  "startDate": "2017-01-18",
  "endDate": "2027-04-30",
  "awardingAgency": "Department of Energy",
  "description": "IGF::CL,CT::IGF CONTRACT AWARD DE-NA0003525 TO THE NATIONAL TECHNOLOGY&ENGINEERING SOLUTIONS OF SANDIA, LLC (NTESS) FOR THE MANAGEMENT AND OPERATION OF THE DEPARTMENT OF ENERGY, NATIONAL NUCLEAR SECURITY ADMINISTRATION'S SANDIA NATIONAL LABORATORIES (SNL)",
  "awardType": null,
  "subaward": false,
  "detailUrl": "https://www.usaspending.gov/award/CONT_AWD_DENA0003525_8900_-NONE-_-NONE-"
}
```

Note: search often returns `description: null` — enable `fetchDetails` when you need hydrated text (still one PPE charge).

***

### How much does it cost?

| Event | Price |
|-------|-------|
| Actor start | ~$0.00005 |
| Dataset item (**successful** award only) | **$0.0015** |
| Error / diagnostic rows | **Not charged** |

| Run | Approx. cost |
|-----|----------------|
| 1 start + 200 awards | ≈ **$0.30** |
| 1 start + 1,000 awards | ≈ **$1.50** |

Mark-approved FREE list from `PPE_PRICING.md`. **Error rows are not charged.**

***

### Use cases

- 🛡 **GovCon BD** — recent DoD / agency award watches by recipient or NAICS
- ✅ **Compliance / diligence** — award history pulls
- 📰 **Journalism** — structured federal spending slices
- 🤖 **Agents** — scheduled award feeds

***

### Limitations

- **Not SAM.gov opportunities** — different dataset / Actor
- API latency is **variable** (seconds to ~60s+); Actor uses long timeouts + retries
- Search field names are spaced in the API; we emit **camelCase**
- Default award types skip assistance (may list individual persons)
- Do not market bulk recipient/address fields as a **D\&B substitute**

***

### Legal & licensing

Per [USAspending About](https://www.usaspending.gov/about):

> Data is 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.

See https://www.usaspending.gov/db\_info for D\&B Open Data bulk-share limits.\
API: https://api.usaspending.gov/

***

### FAQ

#### Why last 30 days by default?

Fresh awards are what BD users need; override `startDate`/`endDate` for historical pulls.

#### Can I pull grants to individuals?

You can change `awardTypes`, but v1 defaults to contracts/IDVs to reduce personal-recipient exposure.

#### Is this SAM.gov?

No — USASpending **awards**, not SAM opportunity postings.

***

### SEO keywords

usaspending scraper, usaspending api, federal awards scraper, federal contracts data, DoD awards API, recipient UEI awards, NAICS federal spending, govcon award history

# Actor input Schema

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

Mapped to filters.keywords. Leave empty for broad recent awards; prefer agency/recipient/date.

## `naics` (type: `array`):

Mapped to filters.naics\_codes.

## `agency` (type: `string`):

Toptier awarding agency name → filters.agencies\[{type:awarding,tier:toptier,name}]. Example: Department of Defense.

## `recipient` (type: `string`):

Mapped to filters.recipient\_search\_text (array). Example: Boeing. Verified shape requires an array of strings.

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

Default A,B,C,D (contracts/IDVs). Avoid assistance codes that may list individuals.

## `startDate` (type: `string`):

YYYY-MM-DD. Default: today − 30 days (recent awards window).

## `endDate` (type: `string`):

YYYY-MM-DD. Default: today.

## `subawards` (type: `boolean`):

Pass subawards flag to search (default false).

## `fetchDetails` (type: `boolean`):

Hydrate via GET /awards/{generated\_internal\_id}/. Still one PPE charge.

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

Cap on award rows (deduped by awardId|generatedInternalId).

## Actor input object example

```json
{
  "keywords": [],
  "naics": [],
  "agency": "Department of Defense",
  "recipient": "",
  "awardTypes": [
    "A",
    "B",
    "C",
    "D"
  ],
  "subawards": false,
  "fetchDetails": false,
  "maxItems": 50
}
```

# 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": [],
    "agency": "Department of Defense"
};

// Run the Actor and wait for it to finish
const run = await client.actor("publicrecords/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 = {
    "keywords": [],
    "agency": "Department of Defense",
}

# Run the Actor and wait for it to finish
run = client.actor("publicrecords/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 '{
  "keywords": [],
  "agency": "Department of Defense"
}' |
apify call publicrecords/usaspending-awards-scraper --silent --output-dataset

```

## MCP server setup

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