# USAspending & SAM.gov Contracts — Zero Proxy, $4.50/1K (`pipeforge/us-federal-contract-awards-expiring-incumbents`) Actor

Zero-proxy USAspending.gov & SAM.gov federal contract awards & expiring incumbents ($4.50/1K, >99% success). Extracts $100K-$50M+ prime contracts expiring in 30-365 days & fresh prime awards with 100% Recipient UEI, 6-digit NAICS/PSC, agency & sales hooks.

- **URL**: https://apify.com/pipeforge/us-federal-contract-awards-expiring-incumbents.md
- **Developed by:** [Yaşar Kaan Özdamur](https://apify.com/pipeforge) (community)
- **Categories:** Lead generation, MCP servers, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.50 / 1,000 verified federal contract leads

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 Federal Contract Awards & Expiring Incumbents Engine (USAspending.gov)

Zero-proxy US Treasury **USAspending.gov API v2** intelligence engine built for **GovCon BD teams, B2B outbound agencies, cyber/compliance consultancies (CMMC / FedRAMP), staffing firms, and subcontracting teams**.

Extracts **$100K to $50M+ prime federal contracts** across two high-intent modes with **100% Recipient SAM.gov UEI (`recipient_uei`)** and **100% NAICS Code (`naics_code`)** completeness:

> **Built as a direct zero-proxy upgrade over generic SAM.gov Scrapers and USAspending Federal Contract Scrapers (`$4.50 / 1,000`):** solves both the null `"NAICS Code"` API trap and the `2100-12-31` end-date sort bug to deliver clean 30–365 day re-compete incumbent lists and fresh prime awards.\
> **Step 2 (Cross-Actor Enrichment):** Pipe prime contractor domains into **[PipeForge B2B Domain Tech-Stack, SPF/DMARC/MX & SSL Trigger](https://apify.com/pipeforge/b2b-domain-tech-stack-dns-ssl-sales-trigger)** (`$3.50 / 1K`) to flag CMMC/FedRAMP email-security (`DMARC/SPF`) and TLS gaps before GovCon outreach. Available via Official MCP Registry (`io.github.3dComm/pipeforge-b2b-signals`).

### Generic GovCon Scrapers vs PipeForge ($4.50/1K)

| Metric | Generic USAspending / SAM.gov Scrapers | PipeForge Federal Contracts & Incumbents (`$4.50/1K`) |
| :--- | :--- | :--- |
| **NAICS & UEI Completeness** | Returns `null` `"NAICS Code"` fields from flat payloads | **100% populated 6-digit `naics_code`, `psc_code` & `recipient_uei`** |
| **Re-Compete Window Accuracy** | Broken `2100-12-31` end-date sort & action-date noise | **Deterministic 30–365 day expiring incumbent filter (`CRITICAL_30_90D` tiers)** |
| **Cost & Architecture** | Heavy browser / proxy scraping | **`$0` proxy, `256 MB` RAM, `>99%` success & ready `sales_pitch_hook`** |

***

1. **`expiring_incumbents` (Re-Compete & Incumbent Displacement Triggers — Default):** Identifies active prime federal contracts expiring within **30 to 365 days** (`CRITICAL_30_90D`, `HIGH_91_180D`, `PIPELINE_181_365D`). Federal agencies typically lock in re-compete RFPs, Bridge Contracts, and Teaming Agreements 3 to 9 months prior to the contract `End Date`.
2. **`new_awards` (Subcontracting & Prime Ramp-Up Triggers):** Extracts newly awarded prime federal contracts (`Start Date <= today`, filtering out future data-entry typos) where prime contractors immediately purchase software, cloud infrastructure, cybersecurity compliance, and specialized sub-contractor labor.

***

### Why This Engine Outperforms Generic GovCon Scrapers

- **Solved USAspending Nested `NAICS` & `PSC` Schema Trap:** Standard scrapers request `"NAICS Code"` in the USAspending v2 payload and receive `null`. This engine requests the nested `"NAICS"` and `"PSC"` dictionary objects directly from `/api/v2/search/spending_by_award/`, guaranteeing **100% populated 6-digit NAICS codes, industry descriptions, and Product/Service Codes (PSC)**.
- **Solved `time_period` Action-Date Trap:** In USAspending.gov, `filters.time_period` filters accounting action dates rather than contract expiration dates, and sorting by `End Date` returns `2100-12-31` placeholders or `1997` legacy modifications. This engine pulls top active prime contracts (`A`, `B`, `C`, `D` contract types) sorted by obligated value and applies deterministic in-memory expiration window (`30 <= days_until_expiration <= 365`) and future-typo sanitation (`Start Date <= today`).
- **Zero-Proxy, 256 MB RAM Architecture:** Runs directly against the public US Treasury JSON API using Python 3.12 standard library (`urllib.request`). Requires **zero residential proxies**, **zero browser overhead**, and completes 500-contract scans in seconds.
- **Outreach-Ready Sales Hooks:** Every row includes a pre-built `sales_pitch_hook` naming the prime contractor, SAM.gov UEI, exact dollar amount, awarding agency, NAICS scope, and expiration countdown.

***

### Input Configuration

| Parameter | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `mode` | `string` | `"expiring_incumbents"` | `"expiring_incumbents"` (expiring in 30-365 days) or `"new_awards"` (newly started prime awards). |
| `minAwardAmount` | `integer` | `250000` | Minimum obligated federal contract value in USD ($250,000 default). |
| `maxAwardAmount` | `integer` | `0` | Maximum contract value in USD (`0` = unlimited). |
| `naicsPrefixes` | `array<string>` | `["54","51","56","33","23"]` | NAICS prefixes (`54` IT/Engineering/Consulting, `51` Software/Cloud, `56` Facilities, `33` Defense/Mfg, `23` Construction). |
| `states` | `array<string>` | `[]` | Optional 2-letter US state codes for Place of Performance (e.g. `["VA","MD","DC","TX","CA"]`). |
| `keywords` | `array<string>` | `[]` | Optional contract description keywords (e.g. `["cybersecurity","cloud","software"]`). |
| `minDaysUntilExpiry` | `integer` | `30` | Minimum days remaining until contract `End Date` (`expiring_incumbents` mode). |
| `maxDaysUntilExpiry` | `integer` | `365` | Maximum days remaining until contract `End Date` (`expiring_incumbents` mode). |
| `lookbackDays` | `integer` | `90` | Days back from latest published start date (`new_awards` mode). |
| `maxPages` | `integer` | `5` | Number of 100-record USAspending API pages to scan (`1` to `15`). |
| `limit` | `integer` | `50` | Maximum verified prime contract records to emit (`1` to `2000`). |

***

### Output Schema (21 Enriched Fields)

| Field | Type | Description |
| :--- | :--- | :--- |
| `mode` | `string` | Harvest mode (`expiring_incumbents` or `new_awards`). |
| `award_id` | `string` | Official Federal Contract Award ID / PIID (e.g. `NNM07AB03C`, `N0001923C0009`). |
| `recipient_name` | `string` | Legal name of the Prime Contractor. |
| `recipient_uei` | `string` | 12-character SAM.gov Unique Entity Identifier (100% populated). |
| `award_amount_usd` | `number` | Obligated prime contract award value in USD. |
| `start_date` | `string` | Contract performance start date (`YYYY-MM-DD`). |
| `end_date` | `string` | Contract current end / expiration date (`YYYY-MM-DD`). |
| `days_until_expiration` | `integer` | Exact number of days remaining until `end_date`. |
| `recompete_urgency_tier` | `string` | `CRITICAL_30_90D`, `HIGH_91_180D`, `PIPELINE_181_365D`, or `NEW_AWARD_PRIME`. |
| `awarding_agency` | `string` | Top-tier federal awarding agency (e.g. `Department of Defense`, `NASA`). |
| `awarding_sub_agency` | `string` | Awarding sub-agency / command (e.g. `Department of the Navy`). |
| `contract_award_type` | `string` | Federal contract vehicle type (`DEFINITIVE CONTRACT`, `DELIVERY ORDER`, `BPA CALL`, `PURCHASE ORDER`). |
| `naics_code` | `string` | 6-digit NAICS code (100% populated, e.g. `541715`, `541512`). |
| `naics_description` | `string` | Full official NAICS industry description. |
| `psc_code` | `string` | Federal Product/Service Code (e.g. `AC13`, `R425`). |
| `psc_description` | `string` | Full Product/Service Code description. |
| `place_of_performance_state` | `string` | 2-letter US state code where contract work is performed. |
| `award_description` | `string` | Contract requirement / statement-of-work summary. |
| `sales_pitch_hook` | `string` | Pre-formatted B2B GovCon sales trigger sentence ready for outbound sequences. |
| `usaspending_award_url` | `string` | Direct deep link to the official USAspending.gov contract profile. |
| `scraped_at` | `string` | ISO-8601 UTC extraction timestamp. |

***

### Integration Guides (Clay, n8n & MCP AI Agents)

#### 1. Clay.com HTTP API Enrichment

Use Clay's **HTTP API** integration or native Apify source to trigger this actor and route `recipient_uei` + `recipient_name` into your contact waterfall:

- **Endpoint:** `POST https://api.apify.com/v2/acts/pipeforge~us-federal-contract-awards-expiring-incumbents/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN`
- **JSON Body:**

```json
{
  "mode": "expiring_incumbents",
  "minAwardAmount": 500000,
  "naicsPrefixes": ["54", "51"],
  "minDaysUntilExpiry": 30,
  "maxDaysUntilExpiry": 180,
  "limit": 50
}
```

- Map `recipient_name` to find VP of Capture, Director of Contracts, or CISO contacts, and inject `sales_pitch_hook` directly into your outbound email variable.

#### 2. n8n Automated GovCon Re-Compete Alert Workflow

1. Add a **Schedule Trigger** node (Weekly on Monday at 07:00 EST).
2. Add an **HTTP Request** node calling the Apify `run-sync-get-dataset-items` endpoint above with `mode: "expiring_incumbents"` and `maxDaysUntilExpiry: 120`.
3. Filter rows where `recompete_urgency_tier == "CRITICAL_30_90D"` and push alerts to Slack / HubSpot / Salesforce with `usaspending_award_url` and `sales_pitch_hook`.

#### 3. Model Context Protocol (MCP) for Claude, Cursor & AI Agents

Connect this engine directly to any MCP-compatible AI client via Apify's official Streamable HTTP MCP gateway:

```
https://mcp.apify.com/?tools=pipeforge/us-federal-contract-awards-expiring-incumbents
```

Example agent prompt:

> *"Find 20 prime federal IT and engineering contracts (NAICS 54 and 51) worth over $500,000 expiring in the next 30 to 180 days, and draft teaming outreach emails using their UEI and contract IDs."*

# Actor input Schema

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

Select 'expiring_incumbents' to extract active prime federal contracts expiring within 30-365 days (re-compete & teaming triggers), or 'new_awards' to extract newly awarded prime contracts (subcontracting & vendor ramp-up triggers).

## `minAwardAmount` (type: `integer`):

Minimum prime federal contract obligated award value in USD (default: $250,000).

## `maxAwardAmount` (type: `integer`):

Maximum prime federal contract award value in USD. Leave at 0 for no upper cap.

## `naicsPrefixes` (type: `array`):

NAICS prefixes to filter federal contracts. Default covers 54 (IT, Cyber, Engineering & Professional Services), 51 (Software, Cloud & Telecom), 56 (Facilities & Administrative Support), 33 (Defense, Aerospace & Electronics Mfg), and 23 (Commercial & Institutional Construction).

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

Optional list of 2-letter US state codes (e.g., \["VA", "MD", "DC", "TX", "CA"]). Leave empty to scan all US states and territories.

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

Optional keywords to filter contract descriptions or NAICS/PSC scopes (e.g., \["cybersecurity", "cloud", "software", "construction"]). Leave empty for all matching NAICS contracts.

## `minDaysUntilExpiry` (type: `integer`):

Minimum days remaining until the contract End Date (default: 30 days).

## `maxDaysUntilExpiry` (type: `integer`):

Maximum days remaining until the contract End Date (default: 365 days).

## `lookbackDays` (type: `integer`):

Number of days back from today to capture newly started prime awards (default: 90 days; excludes future typo start dates).

## `maxPages` (type: `integer`):

Maximum number of 100-record USAspending.gov API pages to scan and filter in memory (default: 5 pages = up to 500 prime contracts).

## `limit` (type: `integer`):

Maximum number of verified prime federal contract records (with 100% Recipient UEI and NAICS code completeness) to return.

## Actor input object example

```json
{
  "mode": "expiring_incumbents",
  "minAwardAmount": 250000,
  "maxAwardAmount": 0,
  "naicsPrefixes": [
    "54",
    "51",
    "56",
    "33",
    "23"
  ],
  "states": [],
  "keywords": [],
  "minDaysUntilExpiry": 30,
  "maxDaysUntilExpiry": 365,
  "lookbackDays": 90,
  "maxPages": 5,
  "limit": 50
}
```

# Actor output Schema

## `dataset` (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": "expiring_incumbents",
    "minAwardAmount": 250000,
    "maxAwardAmount": 0,
    "naicsPrefixes": [
        "54",
        "51",
        "56",
        "33",
        "23"
    ],
    "states": [],
    "keywords": [],
    "minDaysUntilExpiry": 30,
    "maxDaysUntilExpiry": 365,
    "lookbackDays": 90,
    "maxPages": 5,
    "limit": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("pipeforge/us-federal-contract-awards-expiring-incumbents").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": "expiring_incumbents",
    "minAwardAmount": 250000,
    "maxAwardAmount": 0,
    "naicsPrefixes": [
        "54",
        "51",
        "56",
        "33",
        "23",
    ],
    "states": [],
    "keywords": [],
    "minDaysUntilExpiry": 30,
    "maxDaysUntilExpiry": 365,
    "lookbackDays": 90,
    "maxPages": 5,
    "limit": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("pipeforge/us-federal-contract-awards-expiring-incumbents").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": "expiring_incumbents",
  "minAwardAmount": 250000,
  "maxAwardAmount": 0,
  "naicsPrefixes": [
    "54",
    "51",
    "56",
    "33",
    "23"
  ],
  "states": [],
  "keywords": [],
  "minDaysUntilExpiry": 30,
  "maxDaysUntilExpiry": 365,
  "lookbackDays": 90,
  "maxPages": 5,
  "limit": 50
}' |
apify call pipeforge/us-federal-contract-awards-expiring-incumbents --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,pipeforge/us-federal-contract-awards-expiring-incumbents"
        }
    }
}
```

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/mLKRg7bqVo7sIqZGD/builds/QhHhr8jRtYTaGp2Mh/openapi.json
