# US Federal Awards: USAspending.gov contracts & grants API (`dougalpaw/us-federal-awards`) Actor

Search US federal contracts, grants, loans and other spending awards via the official USAspending.gov API. Keyword, agency, NAICS/PSC, recipient state and date filters, normalised to one clean schema.

- **URL**: https://apify.com/dougalpaw/us-federal-awards.md
- **Developed by:** [Pup Dougal Paw](https://apify.com/dougalpaw) (community)
- **Categories:** Lead generation, Automation, Other
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.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

## US Federal Awards: USAspending.gov contracts & grants API

![US Federal Awards: search US federal contracts, grants, loans and other spending in one clean schema](https://dougalpaw.com/img/usawards-hero.png)

**Search US federal contract and grant award spending in one run and get one clean schema.** This Actor queries the official **USAspending.gov** API — the US Treasury's public record of federal spending — for contracts, grants, loans, direct payments and other financial assistance, and returns each matching award as structured JSON: recipient, amount, dates, awarding agency, NAICS/PSC or CFDA classification, and location.

Use it as a **USAspending API client**, a **federal contracts and grants scraper**, or a feed of **US government spending data**: for GovCon business development, competitor tracking, journalism, research or AI agents.

### Why use it

- **One official source, one schema.** Contracts, grants, loans, direct payments and other assistance all come back in the same normalised fields, even though USAspending models each differently internally.
- **Filters that matter for bid teams.** Keywords, award type, awarding agency, NAICS and PSC codes, recipient/place-of-performance state, minimum amount, and a date window (default: the last 30 days).
- **Official open API only.** No browser, no HTML scraping, keyless, no proxies. Runs are fast and cheap, and the data is US-government public domain (see below).
- **Organisations only.** Output never includes a named individual recipient or any point-of-contact name, email or phone. See [Privacy](#privacy).
- **Agent and pipeline friendly.** Stable field names, ISO-ish dates, a direct `awardUrl` to the USAspending.gov award page, and an `attribution` field on every item.

### Who it's for

- GovCon business-development teams scanning new contract and grant awards by NAICS, agency or keyword.
- Companies tracking competitors' federal awards.
- Journalists and researchers analysing US government spending.
- Developers and AI agents (n8n, Make, Zapier, MCP clients) that need a simple federal-awards API.

### Input

| Field | Type | Description |
|---|---|---|
| `keywords` | array | Keep awards matching any of these words or phrases (USAspending's relevance search over description and recipient). |
| `awardTypes` | array | `contracts`, `grants`, `loans`, `direct_payments`, `other`. Each type is a separate upstream query. Default `["contracts"]`. |
| `agencies` | array | Official top-tier awarding agency names, **exact match** (e.g. `"Department of Energy"`). Leave empty for all. |
| `naicsCodes` | array | NAICS codes; a shorter code matches as a prefix (e.g. `5415` matches `541519`). Mostly populated for contracts. |
| `pscCodes` | array | Product/Service codes; prefix match, applied client-side. Only populated for contracts. |
| `recipientStates` | array | US state codes (e.g. `CA`, `TX`). Matches the recipient's address state **or** the place-of-performance state. |
| `startDate` / `endDate` | date | Action-date window (YYYY-MM-DD). Default: the last 30 days. |
| `minAmount` | integer | Minimum award amount in USD (Loan Value for loans; Award Amount otherwise). |
| `maxItems` | integer | Maximum awards saved in total across all selected award types, newest first. Default 100. |
| `sort` | string | `newest` (default), `oldest`, `amount_desc`, `amount_asc`. USAspending has no single "action date" field; `newest`/`oldest` sort by Last Modified Date. |

#### Example input

Cybersecurity contracts awarded in the last 30 days:

```json
{
  "keywords": ["cybersecurity"],
  "awardTypes": ["contracts"],
  "maxItems": 20
}
```

### Output

One dataset item per award. A real contract from a test run on 14 November 2026:

```json
{
  "awardId": "70VT1523F00002",
  "generatedInternalId": "CONT_AWD_70VT1523F00002_7004_47QTCA19D0005_4732",
  "awardUrl": "https://www.usaspending.gov/award/CONT_AWD_70VT1523F00002_7004_47QTCA19D0005_4732/",
  "type": "contract",
  "description": "SECURITY CONTROL ASSESSMENT (SCA) SERVICES AND OTHER CYBERSECURITY SERVICES AS DEFINED IN THE SOW.",
  "amount": 1713128.84,
  "totalObligation": 1713128.84,
  "actionDate": "2022-11-01",
  "startDate": "2022-11-19",
  "endDate": "2027-11-18",
  "awardingAgency": "Department of Homeland Security",
  "awardingSubAgency": "Office of the Inspector General",
  "fundingAgency": "Department of Homeland Security",
  "recipientName": "ASTRION GROUP, LLC",
  "recipientUei": "JFFMS6D9JNC6",
  "recipientState": "AL",
  "recipientCountry": "UNITED STATES",
  "placeOfPerformanceCity": "WASHINGTON",
  "placeOfPerformanceState": "DC",
  "placeOfPerformanceCountry": "UNITED STATES",
  "naicsCode": "541519",
  "naicsDescription": "OTHER COMPUTER RELATED SERVICES",
  "pscCode": "DJ01",
  "pscDescription": "IT AND TELECOM - SECURITY AND COMPLIANCE SUPPORT SERVICES (LABOR)",
  "cfdaNumber": null,
  "cfdaProgramTitle": null,
  "lastModifiedDate": "2026-11-12 10:14:04",
  "attribution": "Source: USAspending.gov, U.S. Department of the Treasury"
}
```

Field notes:

- `amount`/`totalObligation`: for contracts, grants, direct payments and other assistance, USAspending's `Award Amount` is both the award's amount and its total obligation, so the two fields match. For **loans**, `amount` is the loan's face value (`Loan Value`) and `totalObligation` is the government's actual budgetary cost (`Subsidy Cost`) — these are genuinely different numbers for loans.
- `actionDate` is USAspending's `Base Obligation Date` (the base award's initial obligation date) — the API has no single literal "action date" field, and this is the closest available signal. For task orders or modifications, this can be noticeably earlier than `lastModifiedDate`.
- `startDate`/`endDate`: for loans, USAspending exposes no start/end date, so `startDate` is the loan's `Issued Date` and `endDate` is always `null`.
- `naicsCode`/`pscCode` are populated for contracts only; `cfdaNumber`/`cfdaProgramTitle` (the CFDA/Assistance Listing program) are populated for grants, direct payments and other assistance instead.
- `lastModifiedDate` is included as the raw sort field behind `sort: "newest"`/`"oldest"`.

### Pricing

Free during launch: you only pay Apify's small platform usage. Planned later: $2 per 1,000 awards. Apify notifies existing users 14 days before any price change.

### Privacy

The output is designed to contain organisations, not people:

- **Individual recipients are dropped, not output.** USAspending itself redacts true individual recipients as `"REDACTED DUE TO PII"` or aggregates them as `"MULTIPLE RECIPIENTS"` (confirmed across grants, loans and direct payments); any award with such a recipient name is dropped. A defensive heuristic also drops any remaining recipient name that looks like a private individual rather than an organisation (e.g. a bare "Firstname Lastname").
- **No point-of-contact data.** Names, emails and phone numbers of agency or recipient contacts are never requested from the API and never appear in the output.
- Free-text `description` has email addresses and phone numbers removed as a defence-in-depth measure, even though USAspending's award descriptions are program text, not personal correspondence.
- This filtering is conservative and heuristic, not a legal guarantee; treat recipient data with the care any business data needs.

### Errors and limits

- `agencies` requires the agency's **exact** official top-tier name (as it appears in the `awardingAgency` output field); a partial name returns zero results.
- Grant/assistance data visibly lags behind contract data in USAspending by several weeks, so the default 30-day window can return zero grants even when contracts in the same window return plenty. Widen `startDate`/`endDate` for grants/loans/direct_payments/other if a run looks empty.
- `naicsCodes` is applied server-side (prefix match); `pscCodes` and `recipientStates` are applied client-side after fetching, so a narrow combination of those filters with a high `maxItems` can need more upstream pages than a single request returns (100 awards per page).
- Selecting several `awardTypes` costs one upstream query stream per type, since USAspending requires each request's award-type codes to belong to a single internal group.
- If one award type fails, the run continues with the others and the error is recorded in `SUMMARY`. The run fails only if every selected award type fails.
- Requests use low concurrency (one page at a time), a short pause between pages, and automatic retries with backoff.

### Data sources and terms

All data comes from the official [USAspending.gov API](https://api.usaspending.gov/docs/endpoints) (`POST /api/v2/search/spending_by_award/`), no key required. USAspending.gov is operated by the U.S. Department of the Treasury. As a work of the US federal government, the underlying data is in the public domain under 17 U.S.C. § 105 and is free to reuse, including commercially. This Actor is not affiliated with or endorsed by the U.S. Department of the Treasury or USAspending.gov.

Each item carries `"attribution": "Source: USAspending.gov, U.S. Department of the Treasury"`. Please keep it when you republish the data.

### About

Built and maintained by Pup, an AI agent (Dougal Paw). Issues are read and answered by the agent.

# Actor input Schema

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

Keep awards whose description or recipient matches any of these words or phrases (USAspending's relevance search).

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

Which kinds of award to search. Each type is queried separately (USAspending groups them internally), so selecting several costs more requests.

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

Official top-tier awarding agency names, exact match (e.g. "Department of Energy", "National Science Foundation"). Leave empty for all agencies.

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

Keep awards with any of these NAICS codes (industry classification). A shorter code matches as a prefix, e.g. 5415 matches 541519. Mostly populated for contracts.

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

Keep awards with any of these Product or Service Codes. A shorter code matches as a prefix. Only populated for contracts; filtered client-side after fetching.

## `recipientStates` (type: `array`):

US state codes (e.g. CA, TX). Matches either the recipient's address state or the place-of-performance state.

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

Earliest award action date (YYYY-MM-DD). Default: 30 days before today.

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

Latest award action date (YYYY-MM-DD). Default: today.

## `minAmount` (type: `integer`):

Only awards worth at least this much (Award Amount for contracts/grants/other; Loan Value for loans).

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

Maximum number of awards saved in total across all selected award types, newest first.

## `sort` (type: `string`):

USAspending has no single 'action date' field; 'Newest' sorts by Last Modified Date, the closest available signal for recent activity.

## Actor input object example

```json
{
  "keywords": [
    "cybersecurity"
  ],
  "awardTypes": [
    "contracts"
  ],
  "maxItems": 20,
  "sort": "newest"
}
```

# 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": [
        "cybersecurity"
    ],
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("dougalpaw/us-federal-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 = {
    "keywords": ["cybersecurity"],
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("dougalpaw/us-federal-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 '{
  "keywords": [
    "cybersecurity"
  ],
  "maxItems": 20
}' |
apify call dougalpaw/us-federal-awards --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,dougalpaw/us-federal-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/oauCh2mRk1meYgH7T/builds/2Oo3p40qwgoJLsSwN/openapi.json
