# US Federal Contract Winners & Subcontracting Leads Scraper (`grimbles/us-gov-contract-winners-leads`) Actor

Extract companies that just won US Federal Government contracts (DoD, HHS, Energy, NASA, DHS) from the official USAspending.gov API v2. Delivers winning recipient name, UEI, exact award amount ($), awarding agency, NAICS code, and subcontracting score.

- **URL**: https://apify.com/grimbles/us-gov-contract-winners-leads.md
- **Developed by:** [Grimbles Data Labs](https://apify.com/grimbles) (community)
- **Categories:** Lead generation, Automation, AI
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.35 / 1,000 us federal contract winner lead extracteds

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

## US Federal Contract Winners & Subcontracting Leads Scraper (USAspending.gov API v2)

**Extract companies that just won US Federal Government prime contracts (Department of Defense, HHS, Energy, NASA, Homeland Security, VA) directly from the official US Treasury `USAspending.gov` REST API v2.**

When a company wins a **$100,000 to $50,000,000+ federal government contract**, it immediately has guaranteed budget and urgent procurement needs for **subcontractors, technical staffing, cybersecurity compliance (CMMC / FedRAMP), cloud infrastructure, and specialized equipment**. This Actor queries the official USAspending.gov API v2, extracts the **Winning Recipient Company, Unique Entity Identifier (`recipientUei`), Exact Award Amount (`$`), Awarding Agency & Sub-Agency, Contract Scope, and Performance Dates**, and ranks every winner by a **Subcontracting Opportunity Score (`0–100`)**.

***

### Key Features

- **100% Official US Treasury Open Data (`api.usaspending.gov/api/v2/search/spending_by_award/`)**: Zero anti-bot blocks, zero proxies required, built-in rate limiting and `429` retry handling.
- **High-Ticket Prime Contract Filtering**: Filter by `minAwardAmountUsd` (default `$100,000`), `keywords` (e.g. `cybersecurity`, `cloud`, `artificial intelligence`, `construction`), and `daysBack`.
- **Actionable `subcontractingScore` (`0–100`)**: Ranks contract winners by award size (`$500k+`, `$2M+`, `$10M+`), long-term active performance window, high-subcontracting agencies (`DoD`, `Energy`, `HHS`, `NASA`), and UEI availability.

***

### Sample Output JSON

```json
{
  "awardId": "W911NF26C0042",
  "recipientName": "VANGUARD DEFENSE TECHNOLOGIES LLC",
  "recipientUei": "J8K2M9N4P1Q7",
  "awardAmountUsd": 4850000.0,
  "awardingAgency": "Department of Defense",
  "awardingSubAgency": "Department of the Army",
  "contractAwardType": "DEFINITIVE CONTRACT",
  "startDate": "2026-11-01",
  "endDate": "2028-10-31",
  "awardDescription": "AI-ENABLED AUTONOMOUS CYBERSECURITY THREAT DETECTION PLATFORM",
  "internalId": "CONT_AWD_W911NF26C0042_9700_-NONE-_-NONE-",
  "subcontractingScore": 95,
  "awardUrl": "https://www.usaspending.gov/award/CONT_AWD_W911NF26C0042_9700_-NONE-_-NONE-"
}
```

***

### AI Agent (MCP) & n8n Integration

Connect this Actor directly to **Claude Desktop**, **Cursor**, or any MCP-compatible AI agent using the Apify MCP Server:

```json
{
  "mcpServers": {
    "us-gov-contract-winners-leads": {
      "url": "https://mcp.apify.com/?tools=grimbles/us-gov-contract-winners-leads",
      "headers": {
        "Authorization": "Bearer <YOUR_APIFY_API_TOKEN>"
      }
    }
  }
}
```

For **n8n**, call `POST https://api.apify.com/v2/acts/grimbles~us-gov-contract-winners-leads/run-sync-get-dataset-items?token=<YOUR_APIFY_API_TOKEN>` with your desired JSON filter payload on a weekday cron schedule.

# Actor input Schema

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

Optional keywords to filter awarded federal contracts by description or sector.

## `minAwardAmountUsd` (type: `integer`):

Only return contract winners whose award amount is at least this USD value (default: $100,000).

## `daysBack` (type: `integer`):

How many days back to search newly awarded US federal contracts (1 to 365).

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

Maximum number of federal contract winner leads to extract.

## Actor input object example

```json
{
  "keywords": [],
  "minAwardAmountUsd": 100000,
  "daysBack": 60,
  "maxResults": 25
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing extracted US federal contract winners, award values, agencies, and subcontracting scores.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("grimbles/us-gov-contract-winners-leads").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("grimbles/us-gov-contract-winners-leads").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 '{}' |
apify call grimbles/us-gov-contract-winners-leads --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,grimbles/us-gov-contract-winners-leads"
        }
    }
}
```

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/Lkuk8ctbij7toya1q/builds/9QqNtucqlR70YzVav/openapi.json
