# USAspending Scraper | Federal Contracts, Grants & Awards (`muzafferkadir/usaspending-scraper`) Actor

Scrape U.S. federal contract and grant spending from USAspending by keyword and award type: recipient, amount, agency, dates, and award links. Official API, no API key.

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

## Pricing

from $1.00 / 1,000 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

Scrape **U.S. federal contracts, grants, loans and other awards** from **USAspending.gov** by keyword — **recipient, amount, awarding agency, award type, dates, and a link to each award**. No API key, nothing to configure.

Search a topic like `artificial intelligence`, get a clean list of federal awards — ready to export to CSV, Excel, or JSON for market research, government sales, or grant tracking.

### Features

- **Official source** — data comes straight from USAspending.gov, the U.S. government's public spending database.
- **Every award type** — contracts, grants, IDVs, loans, direct payments and other assistance, each searched separately.
- **Date range filter** — limit awards to a period; defaults to the last 3 years.
- **Direct links** — every record links to its award page on USAspending.gov.

### Use cases

- **Government sales & business development** — find which agencies buy what, and who wins the contracts.
- **Competitor research** — see the federal awards a company has received.
- **Grant research** — track funding flowing into a topic or sector.
- **Journalism & policy** — follow public money by keyword and agency.

### Input

| Field | Type | Description |
| --- | --- | --- |
| `keywords` | string\[] | Search terms. Leave empty to list all awards of the chosen types. |
| `awardTypes` | string\[] | `contracts`, `grants`, `idvs`, `loans`, `direct_payments`, `other`. Default: contracts + grants. |
| `startDate` | string | `YYYY-MM-DD`. Defaults to 3 years ago. |
| `endDate` | string | `YYYY-MM-DD`. Defaults to today. |
| `maxItems` | integer | Max awards for the whole run. Default 100. |

#### Examples

```json
{
  "keywords": ["artificial intelligence"],
  "awardTypes": ["contracts", "grants"],
  "maxItems": 100
}
```

```json
{
  "keywords": ["solar", "clean energy"],
  "awardTypes": ["grants", "loans"],
  "startDate": "2025-01-01",
  "endDate": "2025-12-31",
  "maxItems": 500
}
```

### Output

Each record is one award:

| Field | Description |
| --- | --- |
| `awardId` | Award ID (PIID / FAIN). |
| `recipient` | Recipient organization. |
| `amount` | Award amount in USD. |
| `awardingAgency` / `awardingSubAgency` | Agency and sub-agency that made the award. |
| `awardType` / `awardGroup` | Award type and its group (contracts, grants, …). |
| `startDate` / `endDate` | Period of performance. |
| `description` | Award description. |
| `keyword` / `scrapedAt` | The keyword that matched and scrape time. |
| `url` / `generatedId` | Award page on USAspending.gov and its internal award ID. |

#### Example

```json
{
  "awardId": "W911QX20C0023",
  "recipient": "ECS FEDERAL, LLC",
  "amount": 120492195.74,
  "awardingAgency": "Department of Defense",
  "awardingSubAgency": "Defense Contract Management Agency",
  "awardType": null,
  "awardGroup": "contracts",
  "startDate": "2020-04-23",
  "endDate": "2027-03-11",
  "description": "RESEARCH AND DEVELOPMENT EFFORT TO DESIGN AND DEVELOP PROTOTYPES TO ARTIFICIAL INTELLIGENCE/MACHINE LEARNING ALGORITHMS.",
  "generatedId": "CONT_AWD_W911QX20C0023_9700_-NONE-_-NONE-",
  "url": "https://www.usaspending.gov/award/CONT_AWD_W911QX20C0023_9700_-NONE-_-NONE-",
  "keyword": "artificial intelligence",
  "scrapedAt": "2026-09-23T22:02:27.905Z"
}
```

Download the dataset as **JSON, CSV, Excel, or XML**, or pull it via the Apify API.

### Pricing

Pay-per-event: **$0.01 per run start** (per GB of run memory) plus **$1.00 per 1,000 awards**. You only pay for awards actually returned. See the **Pricing** tab for current rates.

### Disclaimer

This is an **unofficial** Actor. It is not affiliated with or endorsed by USAspending.gov or the U.S. Department of the Treasury. It returns publicly available government data; results reflect what the source actually has.

# Actor input Schema

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

Search terms, e.g. "artificial intelligence", "clean energy". Leave empty to list all awards of the chosen award types.

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

Which categories of federal awards to include. Each selected group is searched separately.

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

Award action start date in YYYY-MM-DD; defaults to the last 3 years.

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

Award action end date in YYYY-MM-DD; defaults to the last 3 years.

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

Stop after this many awards in total for the run.

## `proxyConfiguration` (type: `object`):

Optional. Leave empty for most runs.

## Actor input object example

```json
{
  "keywords": [
    "artificial intelligence"
  ],
  "awardTypes": [
    "contracts",
    "grants"
  ],
  "maxItems": 100
}
```

# 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": [
        "artificial intelligence"
    ],
    "awardTypes": [
        "contracts",
        "grants"
    ],
    "maxItems": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("muzafferkadir/usaspending-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": ["artificial intelligence"],
    "awardTypes": [
        "contracts",
        "grants",
    ],
    "maxItems": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("muzafferkadir/usaspending-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": [
    "artificial intelligence"
  ],
  "awardTypes": [
    "contracts",
    "grants"
  ],
  "maxItems": 100
}' |
apify call muzafferkadir/usaspending-scraper --silent --output-dataset

```

## MCP server setup

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