# 💰 USAspending Contracts Intelligence - Federal Data (`benthepythondev/usaspending-contracts-intelligence`) Actor

Extract $600B+ federal contracts, grants & spending with AI opportunity analysis

- **URL**: https://apify.com/benthepythondev/usaspending-contracts-intelligence.md
- **Developed by:** [Ben](https://apify.com/benthepythondev) (community)
- **Categories:** AI, Agents, Automation
- **Stats:** 17 total users, 0 monthly users, 100.0% runs succeeded, 2 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Government Contracts Intelligence — Federal Contracts, Grants & Recipient Data

Extract **federal government contracts, grants, loans and spending data** straight from
USAspending.gov — every award with the recipient, awarding agency, dollar amount, dates,
location and industry codes, plus an **AI opportunity score (0–100)** on each one. It's the
official record of where federal money goes, turned into clean, structured rows you can
actually work with — no scraping, no API key, no fighting with raw government JSON. Export to
JSON/CSV/Excel, run on a schedule, call via API, or connect to Make, Zapier or n8n.

### 🏛️ What is the USAspending Government Contracts Intelligence?

It turns the USAspending.gov database into a searchable dataset of federal awards. Give it a
few keywords (and optional filters for agency, recipient, state, date range, amount or
NAICS/PSC codes) and it returns every matching contract or grant with full details and an
opportunity score that ranks the most pursuit-worthy awards first — so contractors, business
development teams, consultants, journalists and researchers can find the right opportunities
without crawling through government portals by hand. A second mode looks up **recipients**
(companies and organizations) and their total award amounts.

#### What data does it extract?

- **Award ID, recipient name** and **award amount** (plus total obligation)
- **Awarding & funding agency** for every award
- **Description** of the work, and the **award type** (contract, grant, loan, etc.)
- **Start & end dates** and period-of-performance dates
- **Recipient location** (city, state) and **UEI / DUNS** identifiers
- **NAICS & PSC codes** with their descriptions (industry classification)
- **AI opportunity score (0–100)**, an **opportunity label** and a list of **insights**
- **Recipients mode:** company name, UEI, recipient level and **total award amount**

### ⬇️ Input

Run it two ways — search **awards** with filters, or look up **recipients** by keyword:

| Field | Description |
|-------|-------------|
| `mode` | `awards` (contracts/grants) or `recipients` (companies) |
| `keywords` | Search terms for awards, e.g. `software`, `cybersecurity`, `artificial intelligence` |
| `keyword` | Recipient name to look up (used in `recipients` mode), e.g. `Microsoft` |
| `awardType` | `all`, `contract`, `grant`, `loan`, `direct_payment` or `other` |
| `agency` | Awarding agency, e.g. `Department of Defense` |
| `recipient` | Filter by recipient / contractor name |
| `state` | Recipient state, 2-letter code, e.g. `CA`, `TX`, `NY` |
| `dateFrom` / `dateTo` | Date range, `YYYY-MM-DD` (data starts `2007-10-01`) |
| `minAmount` / `maxAmount` | Award amount range in USD |
| `naicsCodes` / `pscCodes` | Filter by industry (NAICS) or product/service (PSC) codes |
| `sortField` / `sortOrder` | Sort by Award Amount, Start/End Date or Recipient Name; `desc` or `asc` |
| `maxResults` | Cap the run (1–10,000) |
| `delaySeconds` | Delay between requests to respect rate limits (0.1–5.0s) |

#### Example input

```json
{
  "mode": "awards",
  "keywords": ["artificial intelligence", "machine learning"],
  "awardType": "contract",
  "agency": "Department of Defense",
  "dateFrom": "2024-01-01",
  "minAmount": 100000,
  "sortField": "Award Amount",
  "sortOrder": "desc",
  "maxResults": 100
}
```

### ⬆️ Output

Every award is one clean row (view as a **table**, or export **JSON / CSV / Excel**):

```json
{
  "award_id": "W91ZRU24P0012",
  "recipient_name": "MICROSOFT CORPORATION",
  "award_amount": 1500000.0,
  "total_obligation": 1500000.0,
  "awarding_agency": "Department of Defense",
  "funding_agency": "Department of Defense",
  "description": "Cloud infrastructure modernization and data analytics services",
  "award_type": "contract",
  "start_date": "2024-01-15",
  "end_date": "2025-01-14",
  "period_of_performance_start": "2024-01-15",
  "period_of_performance_end": "2025-01-14",
  "recipient_state": "WA",
  "recipient_city": "REDMOND",
  "recipient_uei": "FMVPEWNJGLM1",
  "naics_code": "541512",
  "naics_description": "Computer Systems Design Services",
  "psc_code": "D399",
  "psc_description": "IT AND TELECOM- OTHER IT AND TELECOMMUNICATIONS",
  "opportunity_score": 85,
  "opportunity_label": "High Value",
  "insights": [
    "Significant value ($1M+)",
    "Cloud related",
    "Defense sector opportunity",
    "IT services category"
  ]
}
```

In `recipients` mode each row is a company with its total award amount:

```json
{
  "id": "dd77b7c3-663e-cb91-229f-5766a50e9b7f-P",
  "name": "MICROSOFT CORPORATION",
  "uei": "FMVPEWNJGLM1",
  "recipient_level": "P",
  "total_amount": 381132752.31
}
```

### 💡 Use cases

- **🎯 Government contractors — find opportunities:** surface new contracts and grants in your
  niche, sorted by an opportunity score, and see which agencies are spending on what you sell.
- **📈 Business development — track competitors:** look up any contractor in `recipients` mode
  to see total federal dollars won, then dig into their individual awards.
- **📰 Journalists & watchdogs — follow the money:** investigate agency spending, big-ticket
  awards and contractor relationships with sourced, structured records.
- **🔬 Researchers & analysts — procurement trends:** analyze federal spending by agency,
  industry (NAICS/PSC), state or year for policy and market research.

### 🧮 How the opportunity score works

A transparent 0–100 score combining **award amount** (up to 40 pts), **high-value technology
keywords** in the description like AI, cloud and cybersecurity (up to 30 pts), the **awarding
agency** — high-spend agencies such as DoD, HHS and VA score higher (up to 20 pts) — and the
**award type** (up to 10 pts). Each award also gets a label: **High Value** (80–100),
**Promising** (60–79), **Moderate** (40–59), **Low Value** (20–39) or **Minimal** (0–19), so
you can sort and pursue the strongest opportunities first.

### ❓ FAQ

**How do I search federal contracts and grants?** Pick `awards` mode, add a few `keywords`
and any filters you like (agency, state, date range, amount, NAICS/PSC), then Run. You get
structured awards with recipient, amount, agency, dates and an opportunity score.

**Can I look up a specific contractor's total federal awards?** Yes — switch to `recipients`
mode and set `keyword` to the company name. Each result includes the recipient's UEI and
total award amount.

**Do I need an API key?** No. The actor uses the official, free USAspending.gov API, which
requires no authentication or login — just set your filters and Run.

**What's the difference between contracts, grants and loans?** Use `awardType` to choose:
`contract` (paid work/services), `grant` (funding), `loan`, `direct_payment` or `other`. Pick
`all` to default to contracts.

**How far back does the data go?** Federal award data is available from October 1, 2007
onward. Use `dateFrom` and `dateTo` to set any range within that window.

**What are NAICS and PSC codes?** NAICS codes classify the recipient's industry and PSC codes
classify the product or service purchased. Pass them in `naicsCodes` / `pscCodes` to filter
to a specific sector.

**How many awards can it return?** Up to your `maxResults` cap (1–10,000); it paginates
through the API automatically and respects the rate limit via `delaySeconds`.

**Can I run it on a schedule or via API?** Yes — schedule recurring runs in Apify, call it via
the API/SDK, or connect it to Make, Zapier or n8n to refresh your pipeline automatically.

**Is this legal?** Yes. USAspending.gov is the official U.S. government source of public
federal spending data, published by the Treasury Department for transparency. Use it
responsibly and follow applicable laws.

### 🔗 You might also like

- **[Congress Intelligence](https://apify.com/benthepythondev/congress-intelligence)** — US Congress bills, members & votes
- **[SEC Filings Intelligence](https://apify.com/benthepythondev/sec-filings-intelligence)** — SEC EDGAR company filings
- **[Federal Register Intelligence](https://apify.com/benthepythondev/federal-register-intelligence)** — federal rules & notices

***

**Keywords:** USAspending scraper, federal contracts scraper, government contracts data, federal grants data, government spending API, USAspending.gov API, federal procurement data, government contractor leads, NAICS PSC search, award recipients lookup, contract opportunity scoring, public spending transparency, FPDS alternative, govcon intelligence.

# Actor input Schema

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

Type of data to extract

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

Search keywords to filter awards (e.g., 'software', 'cybersecurity', 'artificial intelligence')

## `keyword` (type: `string`):

Keyword to search for recipients (used in recipients mode)

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

Type of federal award to search

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

Filter by awarding agency (e.g., 'Department of Defense', 'Department of Health and Human Services')

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

Filter by recipient/contractor name

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

Filter by recipient state (2-letter code, e.g., 'CA', 'TX', 'NY')

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

Start date for search (YYYY-MM-DD format, earliest: 2007-10-01)

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

End date for search (YYYY-MM-DD format)

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

Minimum award amount in USD

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

Maximum award amount in USD

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

Filter by NAICS industry codes

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

Filter by Product/Service Codes

## `sortField` (type: `string`):

Field to sort results by

## `sortOrder` (type: `string`):

Sort order for results

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

Maximum number of results to return

## `delaySeconds` (type: `number`):

Delay between API requests in seconds (to respect rate limits)

## Actor input object example

```json
{
  "mode": "awards",
  "keywords": [
    "software"
  ],
  "keyword": "Microsoft",
  "awardType": "contract",
  "dateFrom": "2024-01-01",
  "sortField": "Award Amount",
  "sortOrder": "desc",
  "maxResults": 5,
  "delaySeconds": 0.3
}
```

# 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 = {
    "mode": "awards",
    "keywords": [
        "software"
    ],
    "keyword": "Microsoft",
    "awardType": "contract",
    "dateFrom": "2024-01-01",
    "maxResults": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("benthepythondev/usaspending-contracts-intelligence").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 = {
    "mode": "awards",
    "keywords": ["software"],
    "keyword": "Microsoft",
    "awardType": "contract",
    "dateFrom": "2024-01-01",
    "maxResults": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("benthepythondev/usaspending-contracts-intelligence").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 '{
  "mode": "awards",
  "keywords": [
    "software"
  ],
  "keyword": "Microsoft",
  "awardType": "contract",
  "dateFrom": "2024-01-01",
  "maxResults": 5
}' |
apify call benthepythondev/usaspending-contracts-intelligence --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,benthepythondev/usaspending-contracts-intelligence"
        }
    }
}
```

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/chkpOVe49k81cBRc7/builds/Grp2vJx3k2l3FjRig/openapi.json
