# USAspending Federal Awards Scraper (`scrapyx/usaspending-awards-scraper`) Actor

US federal contracts, grants, loans and other awards from USAspending.gov: recipient, UEI, amount, agency, NAICS/PSC, dates, place of performance and links. Search by keyword, agency, recipient, NAICS, state and amount. Official API, no key.

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

## Pricing

from $1.40 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

Who the US government pays, and how much. Federal **contracts, contract
vehicles (IDVs), grants, direct payments, loans and other assistance** from
USAspending.gov, the official source under the DATA Act: recipient name and
UEI, award amount and outlays, awarding and funding agency, NAICS / PSC or
assistance program, dates, recipient address, place of performance, and
links to the award and recipient pages.

Search by keyword, awarding agency, recipient, NAICS code, state and amount
range. Official public API: no key, no login, no proxy.

### What it is for

- **Competitor intelligence for government contractors** — which companies
  win cybersecurity work at DOD, and for how much.
- **Lead generation** — recipients of federal money in your NAICS code or
  state, with their UEI and address.
- **Grant research** — which organisations received a program's grants.
- **Pairs with our Government Tenders scraper**, which covers open SAM.gov
  opportunities *before* they are awarded; this Actor covers who won.

### Input

| field | what it does |
| --- | --- |
| `keywords` | One search per keyword (3+ characters). Empty = filters only. |
| `awardType` | `contracts`, `idvs`, `grants`, `direct_payments`, `loans`, `other`. One per run: USAspending refuses to mix them. |
| `dateFrom` / `dateTo` | Window, `YYYY-MM-DD`. Default: the last 12 months. The search API starts at 2007-10-01. |
| `dateMeaning` | `activity` (default) or `new_awards` — read the next section. |
| `agencies` | Awarding agency: official name or abbreviation, any case (`DOD`, `nasa`, `Department of Energy`). |
| `recipients` | Recipient name / UEI text, e.g. `Lockheed Martin`. |
| `naicsCodes` | 2–6 digit NAICS codes (`541512`, `5415`). |
| `placeOfPerformanceStates` | 2-letter state codes. |
| `minAmount` / `maxAmount` | Award amount range in dollars. |
| `sortBy` | Largest / smallest first, newest / oldest start date, recipient A–Z. |
| `maxItems` | Awards per search (default 200, `0` = all). |

### Things about this data worth knowing before you trust a run

#### 1. "Awards in 2026" includes awards from 2013

By default USAspending matches any award that had **activity** — a payment,
a modification — in your window. In a DOD cybersecurity search for fiscal
2026, 141 of the top 150 contracts had started years earlier, one in 2013;
only 9 were first signed in the window. And `awardAmount` is the award's
**lifetime** amount, not what was spent in your window.

Set `dateMeaning: "new_awards"` for awards first signed in the window (from
771 to 265 matches in the example). Check `baseObligationDate` for the
signing date: `startDate` is the period-of-performance start, which is often
backdated — grants signed in 2025 routinely start in 2023.

#### 2. The API stops saying "more" at 10,000 rows — this Actor keeps going

On a search with 502,305 matches, USAspending's `hasNext` turns false at
page 100, yet pages 101, 102 and 200 all return new awards. A client that
trusts the flag stops at 10,000 without warning. This Actor pages on the
official match count instead; the summary shows `matchingAwards` and
`hasNextFlagIgnored`.

#### 3. Agency names must be exact

`"Department of Defense"` returns 322 awards; `"department of defense"`
returns 0, with no error. This Actor looks names and abbreviations up in
USAspending's own agency list first, and stops with the valid names if one
doesn't match.

#### 4. Many contract descriptions start with a code

`IGF::OT::IGF`, `IGF::CL,CT::IGF` (inherently-governmental-function
markers) prefix — or sometimes end, or entirely make up — contract
descriptions. The Actor moves the marker to `igfCode` and keeps the text in
`description`; `descriptionRaw` is the original.

#### 5. Loans are measured differently

Loans have `loanValue` and `subsidyCost` instead of `awardAmount`, and an
`issuedDate` instead of start/end dates. Sorting by amount or date uses
those for loans.

### Output

One `AWARD` row per award, one `SEARCH_SUMMARY` per search, `ERROR` rows for
questions the API refused.

```json
{
  "recordType": "AWARD",
  "awardId": "FA862118F6251",
  "recipientName": "LOCKHEED MARTIN CORPORATION",
  "recipientUei": "KDT2YLB34NT6",
  "awardAmount": 666315748.84,
  "totalOutlays": 242708.65,
  "description": "AFSOC ACTS AWARD OF CONTRACT FOR CLS, ENGINEERING, INSTRUCTION, CYBERSECURITY, DMO",
  "igfCode": "IGF::OT::IGF",
  "awardTypeDescription": "DELIVERY ORDER",
  "startDate": "2018-02-08",
  "endDate": "2027-01-31",
  "baseObligationDate": "2018-02-08",
  "awardingAgency": "Department of Defense",
  "awardingSubAgency": "Department of the Air Force",
  "naicsCode": "336413",
  "pscCode": "J069",
  "placeOfPerformanceStateCode": "FL",
  "awardUrl": "https://www.usaspending.gov/award/CONT_AWD_FA862118F6251_9700_FA862115D6276_9700",
  "recipientUrl": "https://www.usaspending.gov/recipient/ea75ddee-2d00-ac7f-5e72-6f42d7c88c8c-C/latest"
}
```

```json
{
  "recordType": "SEARCH_SUMMARY",
  "keyword": "cybersecurity",
  "awardType": "contracts",
  "matchingAwards": 322,
  "returnedCount": 150,
  "pagesFetched": 2,
  "stoppedBecause": "maxItems",
  "hasNextFlagIgnored": false,
  "filtersSent": {"...": "the exact filters sent to USAspending"}
}
```

### Limits

- Prime awards only (no sub-awards). Transactions (each modification) are
  not listed individually; each row is the award as a whole.
- Before 2007-10-01, use USAspending's bulk downloads; earlier `dateFrom`
  values are raised and noted in the summary.
- Broad keyword searches are slow on USAspending's side: 10–30 s per page of
  100 was measured from Apify.

# Actor input Schema

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

One search per keyword (at least 3 characters each), matched across award descriptions, recipients and codes. Leave empty to search by the filters below alone.

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

USAspending cannot mix these in one search.

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

YYYY-MM-DD. Default: one year ago. The search API starts at 2007-10-01.

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

YYYY-MM-DD. Default: today.

## `dateMeaning` (type: `string`):

'activity' includes old awards that had a payment or modification in the window -- a 2016 contract can appear in a 2026 search, with its lifetime amount. 'new\_awards' keeps only awards that started in it.

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

Official name or abbreviation, any case: 'DOD', 'Department of Health and Human Services', 'NASA'. Unknown names stop the run with the list of valid ones.

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

Recipient name or UEI search text, e.g. 'Lockheed Martin'.

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

2 to 6 digits, e.g. '541512' (computer systems design) or '5415'.

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

2-letter state codes, e.g. 'TX', 'VA'.

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

Lifetime award amount (loan value for loans).

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

Lifetime award amount (loan value for loans).

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

Amount means the award's lifetime amount (loan value for loans); start date is the issued date for loans.

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

0 = every matching award (broad searches can match hundreds of thousands).

## `minRequestInterval` (type: `number`):

Pause between API calls. The API has no published rate limit; 0.5 s keeps a run polite.

## Actor input object example

```json
{
  "keywords": [
    "cybersecurity"
  ],
  "awardType": "contracts",
  "dateMeaning": "activity",
  "sortBy": "amount_desc",
  "maxItems": 200,
  "minRequestInterval": 0.5
}
```

# Actor output Schema

## `items` (type: `string`):

One row per scraped record. See the dataset's default view for field definitions.

# 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"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapyx/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": ["cybersecurity"] }

# Run the Actor and wait for it to finish
run = client.actor("scrapyx/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": [
    "cybersecurity"
  ]
}' |
apify call scrapyx/usaspending-awards-scraper --silent --output-dataset

```

## MCP server setup

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