# US Government Contracts - USASpending Official (`slanlabs/usaspending-contracts`) Actor

Federal contracts, grants and loans via the official USASpending.gov API. Search by keyword, agency, NAICS, recipient, amount. Agent-ready pay-per-event pricing.

- **URL**: https://apify.com/slanlabs/usaspending-contracts.md
- **Developed by:** [SlanLabs](https://apify.com/slanlabs) (community)
- **Categories:** Lead generation, Business
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$3.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 Government Spending & Contracts (USASpending)

Search the official USASpending.gov API - the US government's definitive open database of federal awards. Contracts, grants and loans: who won what, for how much, from which agency. No login, no API key, no scraping of SAM.gov.

### Why USASpending data

Federal spending is public, but making it useful is work. USASpending is the post-award system of record: every obligated dollar, tied to a recipient, an agency, a NAICS industry code and a product/service code. GovCon BD teams use it to find incumbents and expiring contracts, analysts to map agency spending, journalists to follow the money, and sales teams to size government markets. This Actor turns the official API into clean rows with pay-per-award pricing.

### Modes

- `search-awards` - search across contracts, grants and loans with rich filters
- `award-detail` - the full record for one award (transactions, place of performance, sub-awards) by its `internalId`

### What you get per award

- `awardId`, `recipient`, `amount`
- `startDate`, `endDate`
- `awardingAgency`, `awardingSubAgency`, `fundingAgency`
- `naics`, `psc` - industry and product/service codes with descriptions
- `awardType`, `internalId`, `detailUrl` on usaspending.gov

### Inputs

| Field | Required | Description |
| --- | --- | --- |
| `mode` | yes | `search-awards` or `award-detail` |
| `keywords` | no | Comma-separated, matched against award descriptions |
| `agency` | no | Top-tier agency, e.g. `Department of Defense` |
| `naics` | no | Comma-separated NAICS codes, e.g. `541512` |
| `recipientName` | no | e.g. `Booz Allen Hamilton` |
| `awardType` | no | `contracts` (default), `grants`, `loans`, `all` |
| `minAmount` | no | Minimum award dollars |
| `dateFrom` / `dateTo` | no | Start-date bounds (default: last 90 days) |
| `awardId` | award-detail | `internalId` from a search result |
| `maxResults` | no | Default 100, max 1000 |

### Example

Recent large cybersecurity contracts from the Department of Energy:

```json
{ "mode": "search-awards", "keywords": "cybersecurity", "agency": "Department of Energy", "awardType": "contracts", "minAmount": 1000000 }
```

### FAQ

**Is this official?** Yes - api.usaspending.gov is the US Treasury's public API, no key required.

**Contracts only?** No - contracts, grants, loans, direct payments; filter with `awardType`.

**How current?** Awards appear as agencies report them; typically days to weeks after obligation.

**What does it cost?** Pay-per-event: $3 per 1,000 awards.

**Can I track a competitor's awards?** Yes - `recipientName` plus a schedule gives you their new wins automatically.

**Can agents call it?** Yes - limited-permissions and pay-per-event.

### Pipeline patterns

**Competitive incumbent tracking.** `recipientName` on a competitor, scheduled monthly, answers "what did they win lately" - including award amounts and which agency is buying.

**Whitespace discovery.** `keywords` plus `naics` maps who is buying in your niche; cross-reference with `minAmount` to focus on contracts worth pursuing.

**Recompete pipeline.** Contracts have `endDate`. Filter a competitor's awards or an agency's awards and flag everything ending in the next 12 months - that is your recompete target list.

**Agency budget research.** Aggregate by `awardingAgency` across keywords to see which agencies actually spend on a capability, with real dollars attached.

### Field notes

`amount` is the current total obligation (base plus modifications to date), so re-running later can show growth on the same award. `internalId` (the `CONT_AWD_...` style ID) is the join key for `award-detail` mode and for usaspending.gov links. `naics` and `psc` come back with their official descriptions, so rows are self-explanatory. Awards report with a lag - days for DoD, sometimes weeks for civilian agencies - so absolute freshness varies by agency.

### More FAQ

**Does this replace SAM.gov?** Complementary. SAM.gov hosts pre-award opportunities; USASpending is post-award actuals. For opportunity scraping you would pair this with a SAM.gov source; for who-won-what intelligence, USASpending is the system of record.

**State and local spending?** Federal only - USASpending covers US federal awards, including sub-awards visible in `award-detail`.

**Sub-award data?** `award-detail` includes sub-award rollups where reported.

**Why is `awardType` sometimes empty?** Some older records lack the type description; the code-based filters still classify them correctly.

**Grants research use?** Yes - set `awardType=grants` with keywords like `SBIR` or research-area terms to map federal grant funding.

**Cost for large sweeps?** $3 per 1,000 awards; a full quarterly agency sweep is typically cents.

### More official-API Actors from SlanLabs

- [App Store Reviews (Official Apple Feeds)](https://apify.com/slanlabs/app-store-reviews) - every public review for any iOS app, any country
- [App Store Top Charts (Official Apple Feeds)](https://apify.com/slanlabs/app-store-top-charts) - live top free, paid and grossing charts for apps, books, podcasts and music
- [Bluesky Scraper - Posts, Profiles, Search](https://apify.com/slanlabs/bluesky-scraper) - posts, profiles, search and threads via the open AT Protocol
- [SEC EDGAR Filings Search & Monitor](https://apify.com/slanlabs/sec-edgar-filings) - full-text search and company feeds from the SEC's official APIs
- [GDELT Global News Monitor](https://apify.com/slanlabs/gdelt-news-monitor) - worldwide news coverage in 65+ languages, updated every 15 minutes
- [Hacker News Search & Monitor](https://apify.com/slanlabs/hackernews-monitor) - every story and comment since 2006, plus the live front page

# Actor input Schema

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

search-awards: search federal contracts, grants and loans. award-detail: full detail for one award by its internal ID.

## `keywords` (type: `string`):

Comma-separated keywords matched against award descriptions, e.g. cybersecurity, cloud migration.

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

Top-tier agency name, e.g. Department of Defense, Department of Energy.

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

Comma-separated NAICS industry codes, e.g. 541512, 541715.

## `recipientName` (type: `string`):

Company or organization receiving the award, e.g. Booz Allen Hamilton.

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

contracts (A-D), grants (02-05), loans (07-08), or all.

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

Only awards at or above this dollar amount.

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

YYYY-MM-DD. Awards starting on/after this date. Defaults to 90 days ago.

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

YYYY-MM-DD. Awards starting on/before this date. Defaults to today.

## `awardId` (type: `string`):

award-detail only. The internalId value from a search-awards result (e.g. CONT_AWD\_...).

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

Stop after this many awards.

## Actor input object example

```json
{
  "keywords": "cybersecurity",
  "agency": "Department of Energy",
  "awardType": "contracts",
  "maxResults": 100
}
```

# Actor output Schema

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

USASpending awards dataset

## `summary` (type: `string`):

Run summary (counts)

# 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",
    "agency": "Department of Energy"
};

// Run the Actor and wait for it to finish
const run = await client.actor("slanlabs/usaspending-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 = {
    "keywords": "cybersecurity",
    "agency": "Department of Energy",
}

# Run the Actor and wait for it to finish
run = client.actor("slanlabs/usaspending-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 '{
  "keywords": "cybersecurity",
  "agency": "Department of Energy"
}' |
apify call slanlabs/usaspending-contracts --silent --output-dataset

```

## MCP server setup

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