# USAspending Federal Awards (Public API) (`akolere/usaspending-federal-awards`) Actor

Search U.S. federal contract and grant awards from the official USAspending.gov API. No key, no scraping. DUNS/UEI, street and contact fields removed. Recipient Name may include Dun & Bradstreet Open Data; D\&B attribution is on every row.

- **URL**: https://apify.com/akolere/usaspending-federal-awards.md
- **Developed by:** [Isaiah Williams](https://apify.com/akolere) (community)
- **Categories:** Business, Other
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.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?

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 (Public API)

Search U.S. federal **contract and assistance awards** from [USAspending.gov](https://www.usaspending.gov) through the **official public API** ([api.usaspending.gov](https://api.usaspending.gov/)). No API key is needed, and the Actor never scrapes HTML.

### What it does

You pick a date window and filters (award type, keywords, awarding agency, NAICS, place-of-performance state, amount range). The Actor pages through the USAspending `spending_by_award` search, keeps the rows that match, and streams them to your dataset. It stops as soon as it reaches `maxItems`.

Typical uses: tracking federal spending by agency or industry, market sizing for public-sector work, research and journalism, and dashboards on award trends.

### Output

Each item is one award: award id, recipient name, award amount, start/end dates, awarding agency and sub-agency, NAICS / PSC where available, place-of-performance state, the official USAspending award link, `extractedAt`, and `sourceAttribution`.

#### Left out on purpose

- **No DUNS or UEI identifiers**
- **No recipient street addresses**
- **No point-of-contact fields** (names, emails, phones)
- **No HTML scraping**

This Actor gives you federal award and spending records. **It is not a company directory, contact list or lead list,** and it shouldn't be used as one.

### Data source, license and D\&B attribution

Data comes from USAspending.gov (U.S. Department of the Treasury, Bureau of the Fiscal Service). USAspending's [About → Licensing](https://www.usaspending.gov/about) page says the data may be copied, adapted, redistributed or used commercially, **subject to** the [Limitation on Permissible Use of Dun & Bradstreet, Inc. (D\&B) Data](https://www.usaspending.gov/db_info).

**Recipient Name may include Dun & Bradstreet Open Data. Attribution to D\&B is required.** Every output row has a `sourceAttribution` field that states this. If you redistribute the output, keep that attribution. The D\&B terms limit bulk redistribution of recipient data as a substitute for D\&B products, so use the output for spending and award analysis and keep runs scoped with `maxItems`.

### Input

| Field | Description |
|---|---|
| `startDate` / `endDate` | `YYYY-MM-DD` window on award start date (start is required; end defaults to today) |
| `awardTypeCodes` | Defaults to `A, B, C, D` (contracts). Grants: `02, 03, 04, 05` |
| `keywords` | Matches any keyword in the description, recipient or award id |
| `awardingAgency` | Substring match on agency / sub-agency |
| `naics` | NAICS codes or prefixes |
| `state` | Two-letter place-of-performance state |
| `minAmount` / `maxAmount` | Award amount bounds |
| `maxItems` | Default 100, maximum 10,000 |
| `pageSize` | API page size (1–100) |

### Pricing

Pay per event:

- **$3.50 per 1,000 results** ($0.0035 per dataset item)
- **$0.005 per Actor start**

A default run (100 results) costs about $0.355.

### Limits

USAspending applies a global rate limit of roughly 1,000 requests per 5 minutes. The Actor spaces its requests and stops at `maxItems`.

### Changelog

- **0.1 (2026-11-09):** First Store release. Paginated API streaming, early exit, field stripping, D\&B attribution on every row.

# Actor input Schema

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

Inclusive lower bound on award Start Date. Required.

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

Inclusive upper bound on award Start Date. Empty = today (ET).

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

USAspending codes. Contracts: A B C D. Grants: 02 03 04 05. Empty defaults to A–D (contracts).

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

Case-insensitive match in description / recipient / award id (ANY).

## `awardingAgency` (type: `array`):

Substring match on awarding agency / sub-agency / slug (ANY).

## `naics` (type: `array`):

Exact codes or prefixes (e.g. 5415). Empty = any.

## `state` (type: `string`):

Two-letter state code (e.g. VA). Applied server-side when set.

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

Client-side floor on Award Amount.

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

Client-side ceiling on Award Amount.

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

Stop after this many matching rows (early exit). Default 100.

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

Results per USAspending page (1–100).

## `useCache` (type: `boolean`):

Reuse today's cached API pages for the same filter hash.

## Actor input object example

```json
{
  "startDate": "2026-11-01",
  "awardTypeCodes": [
    "A",
    "B",
    "C",
    "D"
  ],
  "keywords": [],
  "awardingAgency": [],
  "naics": [],
  "maxItems": 100,
  "pageSize": 100,
  "useCache": true
}
```

# 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 = {
    "startDate": "2026-11-01"
};

// Run the Actor and wait for it to finish
const run = await client.actor("akolere/usaspending-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 = { "startDate": "2026-11-01" }

# Run the Actor and wait for it to finish
run = client.actor("akolere/usaspending-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 '{
  "startDate": "2026-11-01"
}' |
apify call akolere/usaspending-federal-awards --silent --output-dataset

```

## MCP server setup

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