# USASpending Awards Scraper | Tracks Modifications Too (`hridayrungta/usaspending-scraper`) Actor

Federal contracts, grants, loans and payments from the official USASpending.gov API - no login, no browser. Incremental mode tracks Last Modified Date, catching award modifications, not just new awards. Filter by recipient, agency or amount. $0.001 per row.

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

## Pricing

$1.00 / 1,000 award scrapeds

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 Awards Scraper — tracks modifications too

**Federal contracts, grants, loans and payments — no login, no browser.** Reads
USASpending.gov's own official public API. Complements this developer's Grants.gov Actor:
Grants.gov covers *opportunities* (what agencies are offering to fund); this covers *awards* (who
actually got the money), across every federal agency.

**$1.00 per 1,000 rows.** No start fee.

***

### What you get

One row per award: `awardId`, `recipientName`, `awardAmount`, `awardingAgency`,
`awardingSubAgency`, `startDate`, `endDate`, `description`, `lastModifiedDate`, `awardType`, and
`usaspendingUrl` linking straight to the official record.

### Incremental mode tracks *modifications*, not just new awards

A federal award is not a static record once posted — a contract modification, a grant's funding
change, a closeout all update the SAME award and bump its `Last Modified Date` without changing
its original start date. Filtering by posted date alone (the right approach for a one-shot
opportunity listing, like this developer's Grants.gov Actor) would silently miss every one of
those updates here. `mode: "changes"` filters and sorts by `Last Modified Date` instead, so a
recipient or agency you're tracking shows both new awards **and** material changes to existing
ones.

**The one thing worth knowing about the date filter.** USASpending's API filters by calendar day,
not time of day. So re-running on the same day as your last mark re-asks for everything modified
that whole day - this Actor guards against re-billing that overlap with its own remembered-id
list, the same technique this developer's Reddit Actor uses for its rarer second-level boundary
collision. Verified live: a second run in the middle of a busy day correctly recognized 20 of 30
fetched awards as already billed and charged only the genuinely new ones.

### Input at a glance

| Input | Default | Notes |
|---|---|---|
| `awardTypeGroup` | `contracts` | contracts / grants / loans / direct\_payments / other |
| `recipientSearchText` | — | filter by recipient name |
| `agencyName` | — | exact top-tier awarding agency name |
| `minAwardAmount` / `maxAwardAmount` | — | optional amount bounds |
| `mode` | `all` | `all` or `changes` |
| `postedSince` | 90 days | `all` mode only |
| `maxItems` | `200` | cost cap — billed once per row saved |
| `firstRunSince` | `30 days` | `changes` mode only; `"all"` backfills to FY2008 |

### Billing

Pay per event, charged once per award row saved, **no start fee**:

| Event | Price | When |
|---|---|---|
| `award-scraped` | $0.001 | one award row |

Set `maxItems` as your cost cap.

# Actor input Schema

## `awardTypeGroup` (type: `string`):

Which category of federal award to search.

## `recipientSearchText` (type: `string`):

Filter to awards whose recipient name matches this text, e.g. "Boeing".

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

e.g. "Department of Defense", "National Science Foundation".

## `minAwardAmount` (type: `integer`):

Leave blank for no minimum.

## `maxAwardAmount` (type: `integer`):

Leave blank for no maximum.

## `mode` (type: `string`):

"all": every matching award in the window. "changes": only awards new or MODIFIED since your last run.

## `postedSince` (type: `string`):

Date or span, e.g. "90 days" or "2026-01-01". Defaults to 90 days if left blank.

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

Cost cap - you're billed once per row saved.

## `firstRunSince` (type: `string`):

A source's first incremental run only takes awards modified since this date/span - never USASpending's whole archive. Default "30 days"; "all" for a deliberate backfill to FY2008.

## `maxRetries` (type: `integer`):

Retries with backoff for network errors and 5xx responses.

## `stateStoreName` (type: `string`):

Name of the key-value store (in YOUR account) that holds the high-water mark per source. Leave blank for the default.

## `stateNamespace` (type: `string`):

Advanced: an explicit namespace for the mark key. Leave blank to namespace by your Apify user id automatically.

## Actor input object example

```json
{
  "awardTypeGroup": "contracts",
  "recipientSearchText": "",
  "agencyName": "",
  "mode": "all",
  "postedSince": "",
  "maxItems": 200,
  "firstRunSince": "30 days",
  "maxRetries": 3,
  "stateStoreName": "",
  "stateNamespace": ""
}
```

# 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 = {};

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

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

```

## MCP server setup

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