# USAspending Federal Awards Scraper — Contracts, Grants & More (`themineworks/usaspending-federal-awards`) Actor

Search every US federal contract, grant, loan and award from USAspending.gov as clean structured JSON. Filter by keyword, agency, NAICS/PSC, recipient, amount, state and date. Zero charge on empty runs.

- **URL**: https://apify.com/themineworks/usaspending-federal-awards.md
- **Developed by:** [The Mine Works](https://apify.com/themineworks) (community)
- **Categories:** Business, Developer tools
- **Stats:** 2 total users, 0 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-usage

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## USAspending Federal Awards Scraper — Contracts, Grants, Loans & More

Search **every US federal award** — contracts, IDVs, grants, direct payments, loans and other assistance — straight from **USAspending.gov**, the US government's official spending database, and get clean structured JSON back. Filter by keyword, awarding agency, recipient, NAICS code, place of performance, dollar amount and date. Ideal for **government-contracting intelligence**, competitor and market research, grant discovery, and B2G lead generation. You only pay for awards actually delivered.

**Keywords:** USAspending API, federal contracts scraper, government contracts data, federal grants scraper, SAM.gov alternative, GovCon intelligence, federal spending data, B2G leads, NAICS contract search, government award data.

---

### Why this actor

USAspending.gov holds the complete public record of how the US federal government spends money — trillions of dollars across millions of awards. The data is open, but the official API is awkward to drive: it is a POST-only search with required award-type codes, different valid fields for contracts versus assistance awards, cursor-style pagination, and raw column names that do not map cleanly to a database row.

This actor wraps all of that into a simple, structured scraper:

- **Every award type** in one place — contracts, IDVs, grants, direct payments, loans, other assistance — selected with a single dropdown.
- **Powerful filters** — keyword, awarding agency, recipient name, NAICS code, place-of-performance state, minimum/maximum dollar amount, and a date window.
- **Clean, normalized output** — one tidy record per award, with the recipient, agency, amount as a real number, dates, type, NAICS/PSC, description and a direct link to the award page on USAspending.gov.
- **Deep pagination** — pull anywhere from a handful of awards to thousands, sorted largest-first.
- **Fully open, no API key** — this targets USAspending's official public API. No key, no login, no anti-bot fight.

It is a clean, low-maintenance alternative to manually exporting from USAspending or wrestling with SAM.gov for award-level intelligence.

---

### What you can build with it

- **GovCon competitive intelligence** — see exactly which contracts your competitors win, from which agencies, for how much, and when they expire (re-compete timing).
- **B2G lead generation** — find agencies and prime contractors actively spending in your NAICS or category, then target them.
- **Grant discovery** — surface federal grants by agency, recipient type and keyword for nonprofits, universities and research teams.
- **Market sizing & research** — quantify total federal spend in a category, geography or time window.
- **Supply-chain & risk analysis** — map which recipients depend on which agencies and programs.
- **Recurring monitoring** — schedule a daily or weekly run on a saved filter and capture new awards as they post.

---

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `keywords` | string[] | `["cybersecurity"]` | Free-text search across descriptions, recipients and IDs. Empty = all. |
| `awardType` | enum | `contracts` | `contracts`, `idvs`, `grants`, `direct_payments`, `loans`, `other_assistance`. |
| `agencies` | string[] | — | Top-tier awarding agency names (e.g. `Department of Defense`). |
| `recipientSearch` | string | — | Recipient name contains this text (e.g. `Lockheed`). |
| `naicsCodes` | string[] | — | NAICS industry codes (contracts/IDVs only). |
| `placeOfPerformanceState` | string | — | Two-letter US state code (e.g. `CA`). |
| `minAmount` / `maxAmount` | integer | — | Award amount bounds in USD. |
| `dateFrom` / `dateTo` | string | last 365 days | Action-date window `YYYY-MM-DD` (search supports back to 2007-10-01). |
| `maxResults` | integer | 100 | Max awards to return, largest first. |

#### Example input

```json
{
  "keywords": ["artificial intelligence"],
  "awardType": "contracts",
  "agencies": ["Department of Defense"],
  "minAmount": 1000000,
  "dateFrom": "2024-10-01",
  "dateTo": "2025-09-30",
  "maxResults": 200
}
````

***

### Output

Each award is one dataset record:

```json
{
  "award_id": "FA862118F6251",
  "recipient_name": "LOCKHEED MARTIN CORPORATION",
  "recipient_id": "abc123-C",
  "awarding_agency": "Department of Defense",
  "awarding_sub_agency": "Department of the Air Force",
  "award_amount": 625405469.07,
  "award_type": "DELIVERY ORDER",
  "award_category": "contracts",
  "naics": { "code": "336413", "description": "OTHER AIRCRAFT PARTS AND AUXILIARY EQUIPMENT MANUFACTURING" },
  "psc": { "code": "1680", "description": "..." },
  "start_date": "2018-02-08",
  "end_date": "2027-01-31",
  "place_of_performance_state": "TX",
  "description": "AFSOC ACTS AWARD OF CONTRACT FOR CLS, ENGINEERING, INSTRUCTION",
  "award_url": "https://www.usaspending.gov/award/CONT_AWD_FA862118F6251_9700_FA862115D6276_9700",
  "scraped_at": "2026-06-10T15:00:00.000Z"
}
```

`naics` and `psc` are present for contracts and IDVs; assistance awards use `award_type` (e.g. `BLOCK GRANT (A)`). A final `{"_type": "summary"}` record reports how many awards were returned.

***

### Pricing

**Your first 25 awards are free — every Apify account, no card, no trial clock.** After that it is a flat **$0.003 per award delivered**.

- First 25 awards free per account (lifetime), then $0.003/award
- **Zero charge on empty runs** — filters that match nothing cost you nothing
- No monthly minimum, no rental
- A run pulling 1,000 awards costs $3.00

You pay for awards in your dataset, not for time on the platform.

***

### FAQ

**Do I need an API key?** No. USAspending.gov's API is fully open. Nothing to sign up for.

**How far back does the data go?** The award search covers action dates back to **2007-10-01**. For older data, USAspending offers bulk downloads.

**Is this the same data as SAM.gov?** USAspending is the authoritative record of awarded federal spending (where the money went). SAM.gov focuses on active solicitations and entity registration. For *award-level intelligence* — who won what, for how much — USAspending is the right source, and this actor makes it queryable.

**Can I monitor new awards automatically?** Yes — save your filter as a task and schedule it. Each run returns the latest matching awards.

**What award types are covered?** Contracts, IDVs, grants, direct payments, loans, and other assistance — every category USAspending tracks.

# Actor input Schema

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

Free-text search across award descriptions, recipients and identifiers (e.g. cybersecurity, solar, ambulance). Leave empty to match all awards in your other filters.

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

Which category of federal award to return.

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

Top-tier awarding agency names to filter by, exactly as USAspending lists them (e.g. Department of Defense, Department of Health and Human Services). Leave empty for all agencies.

## `recipientSearch` (type: `string`):

Filter to awards whose recipient name matches this text (e.g. Lockheed). Leave empty for all recipients.

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

Industry NAICS codes to filter by (e.g. 541512). Applies to contracts and IDVs only.

## `placeOfPerformanceState` (type: `string`):

Two-letter US state code where the work is performed (e.g. CA, TX, VA). Leave empty for all states.

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

Only return awards at or above this dollar amount.

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

Only return awards at or below this dollar amount.

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

Earliest award action date. USAspending search supports dates back to 2007-10-01. Defaults to the last 365 days if left empty.

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

Latest award action date. Defaults to today if left empty.

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

Maximum number of awards to return, sorted by amount (largest first).

## Actor input object example

```json
{
  "keywords": [
    "cybersecurity"
  ],
  "awardType": "contracts",
  "maxResults": 25
}
```

# 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"
    ],
    "awardType": "contracts",
    "maxResults": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("themineworks/usaspending-federal-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 = {
    "keywords": ["cybersecurity"],
    "awardType": "contracts",
    "maxResults": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("themineworks/usaspending-federal-awards").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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"
  ],
  "awardType": "contracts",
  "maxResults": 25
}' |
apify call themineworks/usaspending-federal-awards --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=themineworks/usaspending-federal-awards",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "USAspending Federal Awards Scraper — Contracts, Grants & More",
        "description": "Search every US federal contract, grant, loan and award from USAspending.gov as clean structured JSON. Filter by keyword, agency, NAICS/PSC, recipient, amount, state and date. Zero charge on empty runs.",
        "version": "0.1",
        "x-build-id": "hMNq5CklNLssb6tLt"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/themineworks~usaspending-federal-awards/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-themineworks-usaspending-federal-awards",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/themineworks~usaspending-federal-awards/runs": {
            "post": {
                "operationId": "runs-sync-themineworks-usaspending-federal-awards",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/themineworks~usaspending-federal-awards/run-sync": {
            "post": {
                "operationId": "run-sync-themineworks-usaspending-federal-awards",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "keywords": {
                        "title": "Keywords",
                        "type": "array",
                        "description": "Free-text search across award descriptions, recipients and identifiers (e.g. cybersecurity, solar, ambulance). Leave empty to match all awards in your other filters.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "awardType": {
                        "title": "Award type",
                        "enum": [
                            "contracts",
                            "idvs",
                            "grants",
                            "direct_payments",
                            "loans",
                            "other_assistance"
                        ],
                        "type": "string",
                        "description": "Which category of federal award to return.",
                        "default": "contracts"
                    },
                    "agencies": {
                        "title": "Awarding agencies",
                        "type": "array",
                        "description": "Top-tier awarding agency names to filter by, exactly as USAspending lists them (e.g. Department of Defense, Department of Health and Human Services). Leave empty for all agencies.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "recipientSearch": {
                        "title": "Recipient name contains",
                        "type": "string",
                        "description": "Filter to awards whose recipient name matches this text (e.g. Lockheed). Leave empty for all recipients."
                    },
                    "naicsCodes": {
                        "title": "NAICS codes (contracts/IDVs)",
                        "type": "array",
                        "description": "Industry NAICS codes to filter by (e.g. 541512). Applies to contracts and IDVs only.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "placeOfPerformanceState": {
                        "title": "Place of performance — US state code",
                        "type": "string",
                        "description": "Two-letter US state code where the work is performed (e.g. CA, TX, VA). Leave empty for all states."
                    },
                    "minAmount": {
                        "title": "Minimum award amount (USD)",
                        "type": "integer",
                        "description": "Only return awards at or above this dollar amount."
                    },
                    "maxAmount": {
                        "title": "Maximum award amount (USD)",
                        "type": "integer",
                        "description": "Only return awards at or below this dollar amount."
                    },
                    "dateFrom": {
                        "title": "Action date from (YYYY-MM-DD)",
                        "type": "string",
                        "description": "Earliest award action date. USAspending search supports dates back to 2007-10-01. Defaults to the last 365 days if left empty."
                    },
                    "dateTo": {
                        "title": "Action date to (YYYY-MM-DD)",
                        "type": "string",
                        "description": "Latest award action date. Defaults to today if left empty."
                    },
                    "maxResults": {
                        "title": "Max awards to return",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Maximum number of awards to return, sorted by amount (largest first).",
                        "default": 100
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
