# USAspending Scraper – US Federal Contract & Grant Awards (`iamshytv/usaspending-awards`) Actor

Search US federal contract, grant and loan awards from USAspending.gov's official API. Filter by keyword, company, NAICS, PSC, agency, state, set-aside and amount. Get recipient, UEI, award value, dates and links. No API key.

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

## Pricing

$2.00 / 1,000 federal awards

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 – US Federal Contract & Grant Awards

Search **who won US federal money** using the **official USAspending.gov API** (US Department of the Treasury). Contracts, contract vehicles (IDVs such as GWACs, IDIQs and BPAs), grants, loans, direct payments and other assistance, from October 2007 to today. No API key, no login, no browser. Get clean JSON, CSV or Excel with the recipient, UEI, award amount, outlays, agency, dates, NAICS and PSC codes, place of performance and links.

Use it for **GovCon competitor research**, **teaming-partner and subcontracting lead lists**, **incumbent analysis before a recompete**, **sales prospecting to federal contractors**, **grant market research** and **journalism or policy analysis**. It pairs well with [SAM.gov Contract Opportunities](https://apify.com/iamshytv/sam-gov-opportunities) (what is open now), [Grants.gov Scraper](https://apify.com/iamshytv/grants-gov-opportunities) and [EU Tenders (TED)](https://apify.com/iamshytv/ted-eu-tenders).

### What you get for each award

- Award ID, award category (contract, IDV, grant, loan…) and award type (delivery order, BPA call, definitive contract, project grant…)
- **Recipient name and UEI**, with a link to the recipient's USAspending profile
- **Award amount** (obligated), **total outlays**, loan value and subsidy cost for loans
- Awarding and funding agency and sub-agency
- Start, end, base obligation and last-modified dates
- **NAICS** and **PSC** codes with descriptions (contracts), **Assistance Listings (ALN/CFDA)** with program titles (assistance)
- Place of performance (state, country, ZIP), disaster/emergency fund codes
- Award description (length configurable) and a link to the award page on USAspending.gov

Output is award-level business data. No personal contact details are included.

### How to use

1. Pick one or more **award types** (default: contracts).
2. Add **keywords**, **recipient names**, **NAICS/PSC codes**, **agencies**, **states**, **set-asides** or an **amount range**.
3. Choose a time window (**last N days** or fixed dates) and how it applies (any transaction, date signed, last modified, or new awards only).
4. Run. Results appear in the dataset; download as JSON, CSV, Excel or use the API.

**Weekly award alert:** schedule the Actor with `onlyNewSinceLastRun: true` and `dateType: "new_awards_only"` and connect the dataset to email, Slack, Google Sheets, Make or Zapier. You only get (and pay for) awards you have not seen.

#### Example input: new IT contracts in Virginia over $1M

```json
{
  "awardTypes": ["contracts"],
  "naicsCodes": ["541511", "541512"],
  "states": ["VA"],
  "minAmount": 1000000,
  "lookbackDays": 30,
  "dateType": "new_awards_only",
  "maxResults": 500
}
```

#### Example input: everything a competitor won in the last year

```json
{ "awardTypes": ["contracts", "idvs"], "recipientNames": ["Booz Allen"], "lookbackDays": 365, "maxResults": 1000 }
```

#### Example input: NSF grants in the last 90 days

```json
{ "awardTypes": ["grants"], "awardingAgencies": ["National Science Foundation"], "lookbackDays": 90 }
```

#### Example output

```json
{
  "awardId": "W9128Z26FA001",
  "awardCategory": "Contract",
  "awardType": "DELIVERY ORDER",
  "recipientName": "PALANTIR USG INC",
  "awardAmount": 637552404.79,
  "awardingAgency": "Department of Defense",
  "naicsCode": "541511",
  "placeOfPerformanceState": "CA",
  "awardUrl": "https://www.usaspending.gov/award/CONT_AWD_W9128Z26FA001_9700_W519TC25D0039_9700"
}
```

### Pricing

Pay per result: **$2 per 1,000 awards** (plus a tiny Apify platform start fee). A default run (100 awards) costs about $0.20. Set **Max awards per award type** to control spend.

### Tips and notes

- **Reporting lag:** contracts usually appear within days; grants, loans and other assistance are reported by agencies with a lag of several weeks. Use 90+ days or `dateType: "last_modified_date"` for assistance.
- Agency names must match USAspending's top-tier names exactly (e.g. "Department of Health and Human Services").
- Each award type returns up to 10,000 awards per run; narrow filters for more.
- Searches support dates from 2007-10-01.

### Data source and terms

Data comes from the public [USAspending.gov API](https://api.usaspending.gov/), run by the US Department of the Treasury's Bureau of the Fiscal Service. US federal spending data is public domain. This Actor is not affiliated with or endorsed by the US government.

# Actor input Schema

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

Which kinds of federal awards to search. Each type is searched separately and results are combined. Default: contracts.

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

Full-text search across award descriptions, recipient names and IDs. An award matches if it contains any keyword (min 3 characters). Leave empty for all awards.

## `recipientNames` (type: `array`):

Only awards to recipients whose name or UEI contains one of these, e.g. 'Palantir' or 'Booz Allen'. Great for competitor and customer research.

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

Contracts only. 2 to 6 digit NAICS codes, e.g. 541511 (custom programming) or 5415.

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

Contracts only. Product and Service Codes, e.g. DA10 (SaaS) or R499.

## `assistanceListings` (type: `array`):

Grants and assistance only, e.g. 47.084 or 93.855.

## `awardingAgencies` (type: `array`):

Exact top-tier agency names as shown on USAspending, e.g. 'Department of Defense', 'National Science Foundation', 'Department of Veterans Affairs'.

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

Two-letter US state codes, e.g. VA, CA, TX.

## `recipientTypes` (type: `array`):

Optional business-type filters using USAspending codes, e.g. small_business, other_than_small_business, woman_owned_business, veteran_owned_business, minority_owned_business, nonprofit, higher_education, government.

## `setAsideTypes` (type: `array`):

Contracts only. FPDS set-aside codes, e.g. SBA (small business), 8A, HZC (HUBZone), SDVOSBC, WOSB.

## `lookbackDays` (type: `integer`):

Time window ending today (ignored if a start date is set). 0 = since Oct 2007. Grants and other assistance are reported with a lag of several weeks, so use 90+ days for them.

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

Optional fixed window start. Earliest supported: 2007-10-01.

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

Optional fixed window end. Default: today.

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

How the time window is matched. 'New awards only' returns awards first made inside the window.

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

0 = no minimum.

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

0 = no maximum.

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

Sort order of results within each award type (loans sort by loan value).

## `order` (type: `string`):

Sort direction.

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

Stop after this many awards for each selected award type. You pay per award returned.

## `onlyNewSinceLastRun` (type: `boolean`):

Remember awards returned by earlier runs (in a named key-value store) and skip them. Use with a schedule for alerts.

## `descriptionMaxChars` (type: `integer`):

Trim award descriptions to this many characters. 0 = full text.

## Actor input object example

```json
{
  "awardTypes": [
    "contracts"
  ],
  "keywords": [
    "software"
  ],
  "recipientNames": [],
  "naicsCodes": [],
  "pscCodes": [],
  "assistanceListings": [],
  "awardingAgencies": [],
  "states": [],
  "recipientTypes": [],
  "setAsideTypes": [],
  "lookbackDays": 30,
  "startDate": "",
  "endDate": "",
  "dateType": "action_date",
  "minAmount": 0,
  "maxAmount": 0,
  "sortBy": "Award Amount",
  "order": "desc",
  "maxResults": 100,
  "onlyNewSinceLastRun": false,
  "descriptionMaxChars": 1000
}
```

# Actor output Schema

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

US federal contract, grant and loan awards from USAspending.gov (recipient, amount, agency, dates, NAICS/PSC, links). Stored in the run's default dataset.

## `runSummary` (type: `string`):

JSON record RUN_SUMMARY in the default key-value store: award types searched and counts.

# 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 = {
    "awardTypes": [
        "contracts"
    ],
    "keywords": [
        "software"
    ],
    "recipientNames": [],
    "naicsCodes": [],
    "pscCodes": [],
    "assistanceListings": [],
    "awardingAgencies": [],
    "states": [],
    "recipientTypes": [],
    "setAsideTypes": [],
    "lookbackDays": 30,
    "startDate": "",
    "endDate": "",
    "dateType": "action_date",
    "minAmount": 0,
    "maxAmount": 0,
    "sortBy": "Award Amount",
    "order": "desc",
    "maxResults": 100,
    "onlyNewSinceLastRun": false,
    "descriptionMaxChars": 1000
};

// Run the Actor and wait for it to finish
const run = await client.actor("iamshytv/usaspending-awards").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 = {
    "awardTypes": ["contracts"],
    "keywords": ["software"],
    "recipientNames": [],
    "naicsCodes": [],
    "pscCodes": [],
    "assistanceListings": [],
    "awardingAgencies": [],
    "states": [],
    "recipientTypes": [],
    "setAsideTypes": [],
    "lookbackDays": 30,
    "startDate": "",
    "endDate": "",
    "dateType": "action_date",
    "minAmount": 0,
    "maxAmount": 0,
    "sortBy": "Award Amount",
    "order": "desc",
    "maxResults": 100,
    "onlyNewSinceLastRun": False,
    "descriptionMaxChars": 1000,
}

# Run the Actor and wait for it to finish
run = client.actor("iamshytv/usaspending-awards").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 '{
  "awardTypes": [
    "contracts"
  ],
  "keywords": [
    "software"
  ],
  "recipientNames": [],
  "naicsCodes": [],
  "pscCodes": [],
  "assistanceListings": [],
  "awardingAgencies": [],
  "states": [],
  "recipientTypes": [],
  "setAsideTypes": [],
  "lookbackDays": 30,
  "startDate": "",
  "endDate": "",
  "dateType": "action_date",
  "minAmount": 0,
  "maxAmount": 0,
  "sortBy": "Award Amount",
  "order": "desc",
  "maxResults": 100,
  "onlyNewSinceLastRun": false,
  "descriptionMaxChars": 1000
}' |
apify call iamshytv/usaspending-awards --silent --output-dataset

```

## MCP server setup

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

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/ahUGYYcok8nEgaEL5/builds/q3oqiXEvzTuMAycxv/openapi.json
