# USAspending \[$0.50 💰] Federal Awards & Contracts (`scrapecrafter/usaspending-0-50-federal-awards-contracts`) Actor

$0.50 per 1,000 results — Search U.S. federal awards and contracts with recipient, agency, keyword, NAICS, PSC, location, date, amount and award-type filters.

- **URL**: https://apify.com/scrapecrafter/usaspending-0-50-federal-awards-contracts.md
- **Developed by:** [Debashish Biswas](https://apify.com/scrapecrafter) (community)
- **Categories:** Jobs, Lead generation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.50 / 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 Awards

Extract U.S. federal contract and award data directly from the official **USAspending.gov API** using a lightweight, API-based Apify Actor.

This Actor is designed for users who need clean federal award data without browser automation, Google Places, AI enrichment, or proxy infrastructure.

### What this Actor does

- Searches USAspending federal awards and subawards.
- Searches by recipient/company name, UEI, or DUNS.
- Filters by award type, keywords, dates, agencies, NAICS, PSC, country, recipient type, and award amount.
- Automatically paginates through USAspending API results.
- Supports up to **1,000,000 results per run**, subject to source availability and run limits.
- Uses a maximum of **100 records per USAspending API request** and automatically continues to the next page.
- Produces normalized, analysis-friendly JSON dataset items.
- Preserves the complete original USAspending record in the `raw` field.
- Generates a direct USAspending award URL when an Award ID is available.

### Why use this Actor?

#### Low-cost architecture

The Actor uses the USAspending API directly:

```text
Apify Actor
    ↓
USAspending.gov API
    ↓
JSON response
    ↓
Normalization
    ↓
Apify Dataset
```

It does **not** require:

- Selenium or Chrome
- residential proxies
- Google Places API
- OpenAI/LLM calls
- paid data enrichment services

This keeps the architecture simple and helps keep execution costs low.

### Data fields

Each dataset item can contain:

#### Award

- `award_id`
- `usaspending_url`
- `award_amount`
- `total_outlays`
- `start_date`
- `end_date`
- `award_type`
- `contract_award_type`
- `description`

#### Recipient

- `recipient_name`
- `recipient_uei`
- `recipient_duns`
- `recipient_address`
- `recipient_city`
- `recipient_state`
- `recipient_state_name`
- `recipient_zip`
- `recipient_zip4`
- `recipient_country`
- `recipient_country_name`
- `recipient_county`
- `recipient_county_name`

#### Agencies

- `awarding_agency`
- `awarding_sub_agency`
- `funding_agency`
- `funding_sub_agency`

#### Classification

- `naics`
- `naics_description`
- `psc`
- `psc_description`

#### Place of performance

- `performance_address`
- `performance_city`
- `performance_state`
- `performance_state_name`
- `performance_zip`
- `performance_country`
- `performance_country_name`

#### Source

- `source`
- `raw`

The `raw` field contains the original USAspending record so users can access additional source fields that are not separately normalized by the Actor.

### Award type codes

USAspending requires `award_type_codes`, and the API requires codes from **one award-type group per request**.

#### Contracts

```text
A
B
C
D
```

#### Grants

```text
02
03
04
05
F001
F002
```

#### Loans

```text
07
08
F003
F004
```

#### Indefinite Delivery Vehicles (IDVs)

```text
IDV_A
IDV_B
IDV_B_A
IDV_B_B
IDV_B_C
IDV_C
IDV_D
IDV_E
```

#### Other financial assistance

```text
06
10
```

If no award type codes are supplied, this Actor defaults to **contracts (`A`, `B`, `C`, `D`)**.

Do not mix groups in one request, for example:

```json
{
  "awardTypeCodes": ["A", "02"]
}
```

This will be rejected by the Actor because `A` is a contract code while `02` is a grant code.

### Input example

A simple company search:

```json
{
  "recipient": "Microsoft",
  "maxItems": 1000,
  "pageSize": 100
}
```

The default award type is contracts.

A contracts-only search can also be explicit:

```json
{
  "recipient": "Microsoft",
  "awardTypeCodes": ["A", "B", "C", "D"],
  "maxItems": 1000,
  "pageSize": 100
}
```

A grants search:

```json
{
  "recipient": "Microsoft",
  "awardTypeCodes": [
    "02",
    "03",
    "04",
    "05",
    "F001",
    "F002"
  ],
  "maxItems": 1000,
  "pageSize": 100
}
```

### Available input options

| Input | Description |
|---|---|
| `mode` | `awards` or `recipients`. Recipient mode requires a recipient or UEI/DUNS filter and remains based on the award-search API. |
| `recipient` | Recipient/company name, UEI, or DUNS search. |
| `recipientIds` | Optional UEI/DUNS list; the first value is used. |
| `keywords` | Keyword search terms. |
| `awardTypeCodes` | Award codes from one group. Defaults to contracts. |
| `spendingLevel` | `awards` or `subawards`. |
| `startDate` | Start date in `YYYY-MM-DD` format. |
| `endDate` | End date in `YYYY-MM-DD` format. |
| `recipientScope` | `all`, `domestic`, or `foreign`. |
| `placeOfPerformanceScope` | `all`, `domestic`, or `foreign`. |
| `recipientCountry` | Recipient country code. |
| `performanceCountry` | Place-of-performance country code. |
| `recipientTypes` | USAspending recipient/business type names. |
| `agencies` | Advanced USAspending agency filter objects. |
| `naicsCodes` | NAICS codes to require. |
| `pscCodes` | Product and Service Codes to filter. |
| `minAwardAmount` | Minimum award amount in USD. |
| `maxAwardAmount` | Maximum award amount in USD. |
| `maxItems` | Maximum number of output records; maximum configured value is 1,000,000. |
| `pageSize` | USAspending API page size; maximum is 100. |
| `fields` | Optional advanced USAspending source field list. |

### Pagination

USAspending currently limits the request page size used by this Actor to 100.

For example:

```text
maxItems = 1,000
pageSize = 100

Page 1  → 100
Page 2  → 100
Page 3  → 100
...
Page 10 → 100
```

The Actor automatically continues until it reaches the requested maximum or the source has no more matching records.

### Output example

A normalized result looks like:

```json
{
  "award_id": "HT940216C0001",
  "usaspending_url": "https://www.usaspending.gov/award/HT940216C0001",
  "recipient_name": "HUMANA MILITARY SERVICES LLC",
  "recipient_uei": "ZCGFQJ8YJ9P1",
  "recipient_duns": "088193617",
  "recipient_address": "500 W MAIN STREET",
  "recipient_city": "LOUISVILLE",
  "recipient_state": "KY",
  "recipient_state_name": "Kentucky",
  "recipient_zip": "40202",
  "recipient_country": "USA",
  "recipient_country_name": "UNITED STATES",
  "award_amount": 44683648,
  "start_date": "2016-01-01",
  "end_date": "2016-12-31",
  "awarding_agency": "DEPT OF DEFENSE",
  "naics": "524114",
  "naics_description": "DIRECT HEALTH AND MEDICAL INSURANCE CARRIERS",
  "psc": "Q201",
  "psc_description": "MEDICAL- MANAGED HEALTHCARE",
  "source": "USAspending.gov"
}
```

The complete source response is also retained under:

```text
raw
```

### Cost and pricing

#### USAspending source cost

The Actor uses the public USAspending API and does not use a paid Google Places API, LLM API, browser service, or proxy service.

#### Proposed Actor Store price

The Store price is:

**$0.50 per 1,000 results**

This is the proposed product price and should be confirmed in the Apify Store monetization configuration before publication.

Apify supports Pay per Event and Pay per Usage monetization models. For this Actor, the intended model is a result-based event using dataset items as the billable result. Apify's monetization configuration allows the developer to set event prices and choose whether platform usage costs are passed to users.

### Running locally

For local development, Apify Actors use the Actor input stored in the local Apify storage:

```text
storage/key_value_stores/default/INPUT.json
```

Example:

```json
{
  "recipient": "Microsoft",
  "maxItems": 1000,
  "pageSize": 100
}
```

Then run the Actor using the local Apify development workflow.

The first recommended tests are:

```text
1,000 results
10,000 results
100,000 results
```

After successful testing, a larger run can be used to measure actual Apify platform usage.

### Measuring operating cost

A local Windows run is useful for validating:

- API connectivity
- pagination
- output quality
- execution time
- error handling

However, local execution does not represent the Apify platform's compute cost.

For real cost measurement, run the Actor on Apify and record:

- Compute Units (CU)
- runtime
- dataset size
- total platform usage

This can then be used to calculate the actual cost per 1,000 results and validate the Store price.

### Source

Data is retrieved from the official:

**USAspending.gov**

API:

```text
https://api.usaspending.gov/
```

USAspending provides public federal spending information through its API.

Users are responsible for complying with applicable source terms, laws, regulations, and any restrictions applicable to their intended use or redistribution of data.

### FAQ

#### Does this Actor use Google Places?

No.

#### Does it use AI?

No. The current production Actor does not call an AI/LLM service.

#### Does it use Selenium?

No.

#### Does it require an USAspending API key?

The current implementation uses the public USAspending API endpoints and does not require an API key.

#### Can I retrieve 1 million results?

The Actor is configured to accept up to 1,000,000 requested results, but the actual number returned depends on matching records available from USAspending and the practical limits of an individual Actor run.

#### Why is the API page size limited to 100?

The Actor respects the USAspending API request limit and automatically paginates instead of requesting all records in a single API call.

#### Can I request contracts and grants together?

No. USAspending requires award type codes from a single award group per request. Run separate Actor calls for different groups.

#### Where are the results stored?

Results are pushed to the Actor's default Apify Dataset. The `SUMMARY` key-value entry also contains a run summary.

### Support

If an input combination produces an unexpected result, first verify:

1. Award type codes belong to one group.
2. Dates use `YYYY-MM-DD`.
3. `pageSize` is between 1 and 100.
4. The requested `maxItems` is realistic for the selected filters.

For large runs, start with a small `maxItems` value to verify the filters before requesting a large dataset.

# Actor input Schema

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

Choose award-level or recipient-focused award search.

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

Search by recipient/company name, UEI, or DUNS.

## `recipientIds` (type: `array`):

Optional UEI or DUNS values. The first value is used.

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

Keywords to search in award information.

## `awardTypeCodes` (type: `array`):

Codes from one award group only. Contracts: A,B,C,D. Grants: 02,03,04,05,F001,F002. Loans: 07,08,F003,F004. IDVs: IDV\_A,IDV\_B,IDV\_B\_A,IDV\_B\_B,IDV\_B\_C,IDV\_C,IDV\_D,IDV\_E. Other financial assistance: 06,10. Defaults to contracts.

## `spendingLevel` (type: `string`):

Search awards or subawards.

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

Start date in YYYY-MM-DD format.

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

End date in YYYY-MM-DD format.

## `recipientScope` (type: `string`):

Limit recipients to domestic or foreign entities.

## `placeOfPerformanceScope` (type: `string`):

Limit performance locations to domestic or foreign.

## `recipientCountry` (type: `string`):

USAspending recipient country code.

## `performanceCountry` (type: `string`):

USAspending place-of-performance country code.

## `recipientTypes` (type: `array`):

USAspending recipient/business type names.

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

Advanced USAspending agency filter objects.

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

NAICS codes to require.

## `pscCodes` (type: `array`):

Product and Service Codes to filter.

## `minAwardAmount` (type: `number`):

Minimum award amount in USD.

## `maxAwardAmount` (type: `number`):

Maximum award amount in USD.

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

Maximum number of dataset items to return.

## `pageSize` (type: `integer`):

Number of records requested per USAspending API call. Maximum is 100.

## `fields` (type: `array`):

Optional advanced USAspending field names. Leave empty to use the Actor's standard output fields.

## Actor input object example

```json
{
  "mode": "awards",
  "recipientIds": [],
  "keywords": [],
  "awardTypeCodes": [
    "A",
    "B",
    "C",
    "D"
  ],
  "spendingLevel": "awards",
  "recipientScope": "all",
  "placeOfPerformanceScope": "all",
  "recipientTypes": [],
  "agencies": [],
  "naicsCodes": [],
  "pscCodes": [],
  "maxItems": 1000,
  "pageSize": 100,
  "fields": []
}
```

# Actor output Schema

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

Normalized federal award and recipient records.

# 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("scrapecrafter/usaspending-0-50-federal-awards-contracts").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("scrapecrafter/usaspending-0-50-federal-awards-contracts").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 scrapecrafter/usaspending-0-50-federal-awards-contracts --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrapecrafter/usaspending-0-50-federal-awards-contracts"
        }
    }
}

```

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/4S815EzbcMAFqizuL/builds/dOJdVEf2fbgdgtwfS/openapi.json
