# USAspending Federal Awards & Contracts (`grit-77/usaspending-awards`) Actor

USAspending federal award scraper for prime contracts, grants and other award categories. Export recipients, amounts, agencies, dates and source links as JSON; subawards are excluded.

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

## Pricing

$1.50 / 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 Federal Awards & Contracts

USAspending awards scraper returns public federal prime award records with recipients, amounts, agencies, dates, and source links. USAspending API search exports matching contracts, grants, loans, direct payments, other awards, or IDVs as structured dataset rows.

### What it does

Filter the official USAspending award search by category, dates, agency, recipient, or classification. Select the date basis with `dateType`; the default uses action dates. Error rows have `status` and `error` details. This actor returns prime awards, not subawards or solicitations.

### Input example

```json
{
  "awardType": "contracts",
  "keyword": "software",
  "maxItems": 10
}
```

The example uses fields defined in the actor input schema. Other filters can be set in the Apify input form.

### Output fields

Examples below come from the first record in [sample_output.json](sample_output.json); long strings and arrays are shown as excerpts. Other modes and error rows can have different fields.

| Field | Type in sample | Example value |
|---|---|---|
| `record_type` | string | `"award"` |
| `status` | string | `"ok"` |
| `error` | null | `null` |
| `award_id` | string | `"VA11817F1888"` |
| `generated_internal_id` | string | `"CONT_AWD_VA11817F1888_3600_GS35F0884P_4730"` |
| `internal_id` | number | `347651074` |
| `award_group` | string | `"contracts"` |
| `award_type` | string | `"DELIVERY ORDER"` |
| `recipient` | string | `"DELL FEDERAL SYSTEMS L.P"` |
| `recipient_uei` | string | `"N1C5QLNPJLS4"` |
| `recipient_duns` | null | `null` |
| `award_amount` | number | `1730532626.58` |
| `total_outlays` | number | `196186.26` |
| `loan_value` | null | `null` |
| `subsidy_cost` | null | `null` |
| `description` | string | `"THE PURPOSE OF THIS ACQUISITION IS TO PROVIDE THE DEPARTMENT OF VETERANS AFFAIRS …` |
| `awarding_agency` | string | `"Department of Veterans Affairs"` |
| `awarding_sub_agency` | string | `"Department of Veterans Affairs"` |
| `funding_agency` | string | `"Department of Veterans Affairs"` |
| `funding_sub_agency` | string | `"Department of Veterans Affairs"` |
| `start_date` | string | `"2017-04-01"` |
| `end_date` | string | `"2022-03-31"` |
| `last_date_to_order` | null | `null` |
| `last_modified_date` | string | `"2024-05-07 14:12:54"` |
| `naics_code` | string | `"541519"` |
| `naics_description` | string | `"OTHER COMPUTER RELATED SERVICES"` |
| `psc_code` | string | `"D319"` |
| `psc_description` | string | `"IT AND TELECOM- ANNUAL SOFTWARE MAINTENANCE SERVICE PLANS"` |
| `assistance_listings` | array | `[]` |
| `recipient_location` | object | `{"location_country_code": "USA", "country_name": "UNITED STATES", "state_code": "T…` |
| `place_of_performance` | object | `{"location_country_code": "USA", "country_name": "UNITED STATES", "state_code": "T…` |
| `source_url` | string | `"https://www.usaspending.gov/award/CONT_AWD_VA11817F1888_3600_GS35F0884P_4730"` |
| `fetched_at` | string | `"2026-10-05T12:22:51.961Z"` |

### Output example

A trimmed record copied from [sample_output.json](sample_output.json):

```json
{
  "record_type": "award",
  "status": "ok",
  "award_id": "VA11817F1888",
  "generated_internal_id": "CONT_AWD_VA11817F1888_3600_GS35F0884P_4730",
  "award_group": "contracts",
  "award_type": "DELIVERY ORDER",
  "recipient": "DELL FEDERAL SYSTEMS L.P",
  "award_amount": 1730532626.58,
  "total_outlays": 196186.26,
  "awarding_agency": "Department of Veterans Affairs",
  "start_date": "2017-04-01",
  "last_modified_date": "2024-05-07 14:12:54",
  "naics_code": "541519",
  "source_url": "https://www.usaspending.gov/award/CONT_AWD_VA11817F1888_3600_GS35F0884P_4730",
  "fetched_at": "2026-10-05T12:22:51.961Z"
}
```

### FAQ

**What limits the search?** `maxItems` caps all saved rows, including errors. The source search window is 10,000 results; narrow filters for larger searches.

**Do I need an API key, proxy, or login?** The public USAspending endpoint used here requires none of those.

**What is the pricing model?** The proposed `award` event costs $0.0015 per unique usable award saved. Error rows and within-run duplicates have no custom event. The owner must configure monetization in Apify before publication.

**How does the actor handle rate limits?** Network failures and HTTP 429/500/502/503/504 receive up to four attempts with bounded backoff and `Retry-After` handling. A failed page produces an error row.

**How current are awards and amounts?** The actor retrieves published records when run, but USAspending reporting can lag or be corrected. Use `last_modified_date` and `fetched_at` when comparing results; `loan_value` is not an obligation.

### Use with AI agents / MCP

After this actor is available to your account, configure it as an actor tool in the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp), or start a run through the [Apify API](https://docs.apify.com/api/v2) with the same input JSON. Give the agent the actor identifier and access through your Apify credentials. Read the completed run’s default dataset through the returned run or dataset reference, check error fields before using records, and keep source URLs with quoted data. Limit the input to the task the agent is answering.

### Source and reuse notes

A source field can be null when it is unavailable or inapplicable. An IDV value need not equal the sum of child contracts. Within-run deduplication does not make repeated runs incremental.

# Actor input Schema

## `keyword` (type: `string`):

A search phrase sent to USAspending keyword search. Omit for no keyword filter.

## `agency` (type: `string`):

Official agency name, e.g. Department of Veterans Affairs. Use the exact public name.

## `agencyType` (type: `string`):

Whether the agency filter matches the awarding or funding agency.

## `agencyTier` (type: `string`):

Top-level department or named sub-agency. A shared sub-agency name may match several departments.

## `recipient` (type: `string`):

One recipient search phrase. Searches the published recipient name, UEI or DUNS.

## `naics` (type: `string`):

Comma-separated 2 to 6 digit industry codes, e.g. 54,541519. Contracts and IDVs only; prefixes include descendants.

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

Search one category per run. Fields and amount sorting adapt to the selected category.

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

Inclusive YYYY-MM-DD date, earliest 2007-10-01. Supply endDate together with this field.

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

Inclusive YYYY-MM-DD date. Supply startDate together with this field.

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

How the source applies the date range. action_date can include awards whose start date is much earlier.

## `minAmount` (type: `number`):

Inclusive minimum passed to the official award_amounts filter. Negative amounts are allowed. Loan amount-filter semantics are determined by the source.

## `maxAmount` (type: `number`):

Inclusive maximum passed to the official award_amounts filter. Must be at least minAmount when both are set.

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

Hard cap on total dataset rows, including uncharged errors. Existing rows in this storage count toward the cap.

## `concurrency` (type: `integer`):

Maximum simultaneous public API requests. The first page is fetched separately to check pagination.

## Actor input object example

```json
{
  "keyword": "software",
  "agencyType": "awarding",
  "agencyTier": "toptier",
  "awardType": "contracts",
  "dateType": "action_date",
  "maxItems": 100,
  "concurrency": 3
}
```

# Actor output Schema

## `dataset` (type: `string`):

Download the default dataset as JSON award rows.

# 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 = {
    "keyword": "software"
};

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

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,grit-77/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/8YczaEZUasjmOrjNV/builds/6NVqc64Bbhg6gs6w2/openapi.json
