# USAspending Federal Contracts & Grants API (`unforgettable_cornet/usaspending-federal-awards`) Actor

Search US federal contracts, grants, loans and IDVs from USAspending.gov by keyword, agency, NAICS, PSC, state, recipient and amount. Uses the public USAspending.gov API. Independent tool, not affiliated with the U.S. Treasury. No key.

- **URL**: https://apify.com/unforgettable_cornet/usaspending-federal-awards.md
- **Developed by:** [Daren Data Tools](https://apify.com/unforgettable_cornet) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.90 / 1,000 award 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 Contracts & Grants API – US Government Spending Data

Search **US federal government spending** data from **USAspending.gov**: **federal contracts**, **contract IDVs**, **grants**, **loans** and **direct payments**. Filter by keyword, awarding agency, **NAICS**, **PSC**, place-of-performance state, recipient, award amount and date. Each result includes award ID, recipient, obligated amount, outlays, agency/sub-agency, award type, dates, NAICS/PSC or CFDA assistance listing, and a link to the award page.

### Why this Actor

- **Source**: the public USAspending.gov API, operated by the U.S. Department of the Treasury, Bureau of the Fiscal Service. No HTML scraping, no login, no API key.
- **Pagination up to 10,000 awards per run** (default 500), with retries. The per-run cap exists because recipient names and addresses may include Dun & Bradstreet data, which may not be redistributed in bulk (see below). For larger analyses, run narrower, filtered queries.
- **Clean, flat JSON**, ready for CSV/Excel, BI tools and LLM pipelines.

### Use cases

GovCon and public-sector market research, grant research, journalism, investment research on government contractors, budget analytics.

### Input example

```json
{"keywords":["cybersecurity"],"awardCategory":"contracts","dateFrom":"2025-01-01","awardingAgency":"Department of Defense","naicsCodes":["541512"],"states":["VA"],"minAmount":100000,"maxResults":500}
```

### Output example

```json
{"awardId":"W91ZRU25FA002","awardCategory":"contracts","recipientName":"MICROTECHNOLOGIES LLC","awardAmount":30127.4,"awardingAgency":"Department of Defense","startDate":"2025-11-19","naics":{"code":"511210","description":"SOFTWARE PUBLISHERS"},"placeOfPerformanceState":"AK","awardUrl":"https://www.usaspending.gov/award/CONT_AWD_W91ZRU25FA002_9700_W52P1J20D0060_9700"}
```

The Actor does not output recipient street addresses, DUNS numbers or parent-company data.

### Pricing

Pay per result: charged per award returned. Set "Max results" to cap your cost.

### Notes

Keyword search requires at least 3 characters; shorter keywords are ignored. Records may include names of individuals doing business as federal recipients.

### Dun & Bradstreet attribution

Some recipient business names and addresses, especially in records dated before April 4, 2022, are supplied by **Dun & Bradstreet, Inc. (D\&B)**. Recipient data © Dun & Bradstreet, Inc., provided via USAspending.gov. D\&B data is subject to the Limitation on Permissible Use of Dun & Bradstreet, Inc. Data (https://www.usaspending.gov/db_info), including written attribution to D\&B and no bulk redistribution. Do not use this Actor's output to rebuild or substitute for D\&B products, or for D\&B-restricted marketing purposes.

### Source & disclaimer

Data from USAspending.gov (U.S. Department of the Treasury, Bureau of the Fiscal Service), which makes its data available for commercial and non-commercial use subject to the D\&B limitation above. This independent tool is not affiliated with or endorsed by the U.S. Treasury or any federal agency or other government body. Data is reproduced as published, may be revised by agencies, may be delayed or incomplete, and is provided as-is, without warranty of any kind. Verify against usaspending.gov before relying on it.

# Actor input Schema

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

Search award descriptions, e.g. cybersecurity, drones.

## `awardCategory` (type: `string`):

Type of federal award.

## `dateFrom` (type: `string`):

Earliest action date (USAspending data starts 2007-10-01).

## `dateTo` (type: `string`):

Latest action date.

## `awardingAgency` (type: `string`):

Exact top-tier agency name, e.g. Department of Defense.

## `recipientSearch` (type: `string`):

Filter by recipient name or UEI.

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

e.g. 541512 (contracts only).

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

Product/service codes, e.g. 7J20 (contracts only).

## `states` (type: `array`):

Two-letter US state codes, e.g. CA, TX.

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

Lower bound on award amount.

## `maxAmount` (type: `integer`):

Upper bound on award amount.

## `sortBy` (type: `string`):

Largest awards or newest first.

## `maxResults` (type: `integer`):

Maximum awards to return (capped at 10,000 per run because recipient names/addresses may include Dun & Bradstreet data that may not be redistributed in bulk).

## Actor input object example

```json
{
  "keywords": [
    "cybersecurity"
  ],
  "awardCategory": "contracts",
  "dateFrom": "2024-01-01",
  "sortBy": "amount",
  "maxResults": 100
}
```

# Actor output Schema

## `awards` (type: `string`):

All awards returned by the run.

# 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"
    ],
    "maxResults": 100
};

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

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

```

## MCP server setup

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