# USAspending Federal Contracts & Grants Scraper (`seemuapps/usaspending-federal-contracts-scraper`) Actor

Search official US government spending data to find which companies won federal contracts and grants, by recipient, agency, or NAICS code, with amounts and dates.

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

## Pricing

from $10.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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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 Contracts & Grants Scraper

Search official US government spending records to find which companies and organizations are winning federal contracts and grants — by recipient name, agency, or industry (NAICS code) — with award amounts, dates, and locations. No login, no API key.

### What you get

- Award ID, recipient name, and award amount
- Awarding agency and sub-agency
- Award start and end dates, and a short description
- NAICS industry code and description
- Recipient location (state, city, address, ZIP)
- Direct link to the award's page on USAspending.gov

### Use cases

- **Procurement and lead-gen intelligence** — find every company winning contracts or grants from a specific agency
- **Competitive research** — see what federal work a competitor holds, and how much it's worth
- **Market sizing** — total up federal spend in an industry via NAICS code
- **Grant research** — find which organizations are receiving federal grant funding in a given field
- **Due diligence** — check a company's federal contracting history before a partnership or investment

### How to use

1. Enter a **Recipient Name** (e.g. `Boeing`), a **NAICS Code**, and/or an **Awarding Agency** — leave all blank to browse broadly
2. Choose **Award Type**: Contracts, Grants, or Both
3. Optionally set a **Start Date** / **End Date** range (data is available back to 2007-10-01)
4. Set **Max Items** (default 200; set `0` for unlimited)
5. Run the actor — results appear in the **Dataset** tab

#### Fetching more than one run's worth

The actor paginates automatically to fill your **Max Items**. To keep going past that, open the **Key-value store** tab after the run → copy the `NEXT_PAGE_ID` value → paste it into **Page ID** on your next run. If `NEXT_PAGE_ID` is `null`, you've fetched every matching award.

### Output format

Each dataset record:

```json
{
  "awardType": "contracts",
  "awardId": "FA862511C6600",
  "recipientName": "THE BOEING COMPANY",
  "awardAmount": 31972918249.03,
  "awardingAgency": "Department of Defense",
  "awardingSubAgency": "Department of the Air Force",
  "startDate": "2011-05-01",
  "endDate": "2032-12-31",
  "description": "F-15 EAGLE AIRCRAFT",
  "naicsCode": "336411",
  "naicsDescription": "AIRCRAFT MANUFACTURING",
  "recipientState": "WA",
  "recipientCity": "SEATTLE",
  "recipientAddress": "7755 E MARGINAL WAY S",
  "recipientZip": "98108",
  "usaspendingUrl": "https://www.usaspending.gov/award/CONT_AWD_FA862511C6600_9700_-NONE-_-NONE-"
}
```

# Actor input Schema

## `recipientName` (type: `string`):

Company or organization name to search for (partial match), e.g. 'Boeing'. Leave blank to browse all recipients matching the other filters.

## `naicsCode` (type: `string`):

Optional. Filter to a specific 6-digit NAICS industry code, e.g. '336411' for Aircraft Manufacturing.

## `agencyName` (type: `string`):

Optional. Filter to a top-tier federal agency by exact name, e.g. 'Department of Defense'.

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

Search federal contracts, grants, or both. Contracts and grants use different USAspending record types, so 'Both' runs two passes.

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

Earliest award start date to include, in YYYY-MM-DD format. USAspending's search API only covers data back to 2007-10-01; earlier dates are clamped to that floor. Leave blank for the earliest available date.

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

Latest award start date to include, in YYYY-MM-DD format. Defaults to today.

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

Maximum number of award records to push. Set 0 for unlimited (the run paginates until every match is fetched or the run times out).

## `pageId` (type: `string`):

Optional. Paste NEXT\_PAGE\_ID from the previous run's Key-value store to continue where that run stopped.

## Actor input object example

```json
{
  "recipientName": "Boeing",
  "awardType": "contracts",
  "maxItems": 200
}
```

# Actor output Schema

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

Each record: { awardType, awardId, recipientName, awardAmount, awardingAgency, awardingSubAgency, startDate, endDate, description, naicsCode, naicsDescription, recipientState, recipientCity, recipientAddress, recipientZip, usaspendingUrl }

## `nextPageId` (type: `string`):

NEXT\_PAGE\_ID record in the default key-value store. Paste into Page ID on the next run to resume; null when the search is exhausted.

# 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 = {
    "recipientName": "Boeing",
    "naicsCode": "",
    "agencyName": "",
    "startDate": "",
    "endDate": "",
    "maxItems": 200
};

// Run the Actor and wait for it to finish
const run = await client.actor("seemuapps/usaspending-federal-contracts-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 = {
    "recipientName": "Boeing",
    "naicsCode": "",
    "agencyName": "",
    "startDate": "",
    "endDate": "",
    "maxItems": 200,
}

# Run the Actor and wait for it to finish
run = client.actor("seemuapps/usaspending-federal-contracts-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 '{
  "recipientName": "Boeing",
  "naicsCode": "",
  "agencyName": "",
  "startDate": "",
  "endDate": "",
  "maxItems": 200
}' |
apify call seemuapps/usaspending-federal-contracts-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,seemuapps/usaspending-federal-contracts-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/656QdhZrIBCJEhMCh/builds/WXOWTe03Gv3Ibqlxs/openapi.json
