# Sam Gov Federal Procurement Harvester (`zodiacxs/sam-gov-federal-procurement-harvester`) Actor

- **URL**: https://apify.com/zodiacxs/sam-gov-federal-procurement-harvester.md
- **Developed by:** [Apoorv A S](https://apify.com/zodiacxs) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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

## SAM.gov Scraper — Federal Contract Opportunities, Defense RFPs & Set-Aside Harvester

[![Apify Actor](https://img.shields.io/badge/Apify_Store-SAM.gov_Harvester-00C853?logo=apify)](https://apify.com/zodiacxs/sam-gov-federal-procurement-harvester)
[![Memory Footprint](https://img.shields.io/badge/RAM_Footprint-20MB_Avg_%2F_128MB_Tier-blue)](#)
[![Pricing Model](https://img.shields.io/badge/Pricing-Pay--Per--Event_\(PPE\)-orange)](#)

Extract active **U.S. federal contract opportunities, defense solicitations (DoD, Army, Air Force, Navy, DHS, VA), Sources Sought notices, small business set-asides (8(a), SDVOSB, WOSB, HUBZone), award notices, and direct RFP/Statement of Work (SOW) PDF download links** from **SAM.gov** in seconds—**with zero SAM.gov API key required**.

Built for **GovCon business development (BD) teams, capture managers, proposal writers, cold-email lead generation agencies (Clay / n8n / Make), and AI procurement agents (MCP)** who need real-time federal tender feeds without waiting 10+ business days for GSA API key approval or hitting daily rate limits.

### Why GovCon BD Teams & AI Agents Choose This SAM.gov Scraper

- **No SAM.gov API Key Required (Keyless + BYOK Dual Engine):** Queries SAM.gov's internal SGS v1 network layer via HTTP/2 TLS session impersonation (`curl-cffi`) out of the box, or routes through `api.sam.gov/prod/opportunities/v2/search` if you supply an optional `samApiKey`.
- **Direct RFP & Statement of Work (SOW) PDF Links:** Optionally traverses SAM.gov's v3 attachment resource tree (`/opps/v3/opportunities/{id}/resources`) to resolve direct download URLs for Section C Statements of Work, Section L/M proposal instructions, pricing spreadsheets, and amendments.
- **Sub-Second Execution on a 128MB Micro Container:** Operates purely at the socket layer with zero headless Chromium overhead (~20.2 MB average RSS, <35 MB peak), parsing 30+ federal opportunities in ~1 second.
- **Strict Pydantic Schema & Deduplication:** Every notice is normalized and validated into clean, CRM-ready JSON (`notice_id`, `solicitation_number`, `agency_code`, `agency_name`, `naics_code`, `set_aside`, `posted_date`, `response_deadline`, `award_amount`, `awardee_name`, `awardee_uei`, `source_url`, `attachments`).
- **Predictable Pay-Per-Event (PPE) Pricing:** Zero monthly subscription—pay strictly for validated results pushed to your dataset.

### High-ROI GovCon Workflows You Can Automate Today

1. **Daily Set-Aside Bid Radar (8(a) / SDVOSB / WOSB / Total Small Business):** Schedule this Actor every morning on Apify to pull newly posted solicitations in your exact 6-digit NAICS codes (`541511`, `541512`, `541519`, `541330`, `541611`) and push matching tenders directly to Slack, Microsoft Teams, HubSpot, or Salesforce.
2. **Automated RFP / SOW RAG Pipelines for Proposal Teams:** Enable `includeAttachments: true` to feed live Statement of Work PDF URLs into an LLM / vector database so capture engineers can score Pwin (Probability of Win) and draft compliance matrices automatically.
3. **B2B GovCon Agency Outbound (Clay + n8n + Make):** Pull freshly posted `Sources Sought` and `Presolicitation` notices, enrich the incumbent contractor via our companion **[USASpending Incumbent & Recompete Enricher](https://apify.com/zodiacxs/usaspending-incumbent-recompete-enricher)**, and pitch teaming or proposal-writing services to qualified primes.

### Input Parameters

All parameters match `.actor/input_schema.json` for seamless UI, REST API, and MCP agent execution:

| Parameter | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `searchKeywords` | `string` | `"artificial intelligence cybersecurity"` | Keywords, technical phrases, or specific solicitation numbers (e.g., `"zero trust"`, `"cloud migration"`, `"W911NF"`). |
| `naicsCodes` | `array<string>` | `["541511", "541512"]` | Up to 25 6-digit NAICS codes to filter opportunities (e.g., `541511` Custom Computer Programming, `541512` Computer Systems Design). |
| `setAsideTypes` | `string` | `"ALL"` | Filter by federal small business set-aside: `"ALL"`, `"SBA"` (Total Small Business), `"8A"` (8(a)), `"HZC"` (HUBZone), `"SDVOSBC"` (Service-Disabled Veteran-Owned), `"WOSB"`, or `"EDWOSB"`. |
| `postedWithinDays` | `integer` | `14` | Harvest opportunities posted or modified within the last `1` to `365` days. |
| `maxRecords` | `integer` | `100` | Hard cap on total validated opportunities to harvest (`1`–`10000`). Controls your maximum PPE spend per run. |
| `includeAttachments` | `boolean` | `false` | When `true`, fetches the secondary notice resource tree to extract direct download links for RFP/SOW PDFs (`+$0.02` per attachment). |
| `samApiKey` | `string` | `""` | Optional BYOK SAM.gov Public API key (`open.gsa.gov`). Leave blank to use the built-in keyless TLS harvester. |
| `proxyConfiguration` | `object` | `{"useApifyProxy": true}` | Optional Apify Proxy or custom proxy configuration for high-volume institutional runs. |

### Pay-Per-Event (PPE) Pricing & Cost Examples

You only pay for validated records delivered to your dataset:

| Event Name | Price (USD) | Trigger Condition |
| :--- | :--- | :--- |
| `actor-start` | **$0.05** | Charged once when the Actor run initializes. |
| `opportunity-harvested` | **$0.03** | Charged per Pydantic-validated SAM.gov opportunity pushed to the dataset. |
| `solicitation-attachment-extracted` | **$0.02** | Charged per non-deleted RFP/SOW attachment download link extracted (only when `includeAttachments: true`). |

- **Example 1 (Daily NAICS Monitoring — 50 Solicitations, No Attachments):** `$0.05 + (50 × $0.03)` = **$1.55 total**.
- **Example 2 (Deep Capture Run — 100 Solicitations + 40 SOW PDF Links):** `$0.05 + (100 × $0.03) + (40 × $0.02)` = **$3.85 total**.

### Sample Input JSON (Apify API / Clay / n8n / Make)

```json
{
  "searchKeywords": "zero trust cybersecurity",
  "naicsCodes": ["541511", "541512"],
  "setAsideTypes": "SBA",
  "postedWithinDays": 14,
  "maxRecords": 50,
  "includeAttachments": true
}
```

### Sample Output Record

```json
{
  "notice_id": "SAM-2026-HQ0034-0192",
  "title": "Enterprise Cloud Architecture & Zero Trust Migration",
  "solicitation_number": "HQ003426R0012",
  "notice_type": "Solicitation",
  "agency_code": "DEPT OF DEFENSE.DEPT OF THE ARMY.AMC",
  "agency_name": "Department of Defense.Department of the Army.AMC",
  "naics_code": "541512",
  "set_aside": "Total Small Business Set-Aside (FAR 19.5)",
  "posted_date": "2026-10-25T14:30:00Z",
  "response_deadline": "2026-11-30T17:00:00Z",
  "award_amount": 450000.0,
  "awardee_name": "AEGIS FEDERAL CYBER LLC",
  "awardee_uei": "J8K2L9M4N1P2",
  "source_url": "https://sam.gov/opp/SAM-2026-HQ0034-0192/view",
  "attachments": [
    {
      "name": "Statement_of_Work_Section_C.pdf",
      "url": "https://sam.gov/api/prod/opps/v3/opportunities/resources/files/res-0192-sow/download",
      "resource_id": "res-0192-sow",
      "mime_type": ".pdf",
      "size_bytes": 482910,
      "access_level": "public",
      "posted_date": "2026-10-25T14:00:00Z"
    }
  ]
}
```

### Pair With Actor #2 for Full-Cycle Capture Intelligence

SAM.gov shows **open pre-award solicitations**, while **USASpending.gov (FPDS)** holds the **historical prime awards, IDIQ task orders, option modifications, and expiring incumbent contracts** (including 22,000+ contractors whose task orders never post as standalone SAM Award Notices).

Chain this Actor with **[USASpending Incumbent & Recompete Enricher](https://apify.com/zodiacxs/usaspending-incumbent-recompete-enricher)** to:

1. Harvest active solicitations or NAICS codes from SAM.gov.
2. Automatically identify the **incumbent prime contractor (UEI + Legal Name)**, **past award ceiling**, **number of offers received (single-bid vulnerability)**, and **contracts expiring in the next 30–180 days**.

### Compliance & Data Provenance

Operates strictly against public U.S. federal procurement transparency data pursuant to the Federal Acquisition Regulation (FAR) and Freedom of Information Act (FOIA).

# Actor input Schema

## `searchKeywords` (type: `string`):

Keywords, solicitation numbers, or technical terms (e.g., 'cybersecurity', 'zero trust', 'LLM', 'W911NF').

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

List of 6-digit NAICS codes to filter opportunities (e.g., 541511 for Custom Computer Programming, 541512 for Systems Design).

## `setAsideTypes` (type: `string`):

Filter by federal set-aside classification.

## `postedWithinDays` (type: `integer`):

Harvest opportunities posted or modified within the last N days.

## `maxRecords` (type: `integer`):

Hard ceiling on total records harvested in this run ($0.03 per validated record).

## `includeAttachments` (type: `boolean`):

When enabled, fetches the secondary notice resource tree to extract direct download URLs for RFP PDFs and Statements of Work.

## `samApiKey` (type: `string`):

Optional: Supply your own SAM.gov API key to route via official open.gsa.gov endpoints; leave blank to use native TLS network harvesting.

## `proxyConfiguration` (type: `object`):

Optional proxy settings for high-volume institutional runs.

## Actor input object example

```json
{
  "searchKeywords": "artificial intelligence cybersecurity",
  "naicsCodes": [
    "541511",
    "541512"
  ],
  "setAsideTypes": "ALL",
  "postedWithinDays": 14,
  "maxRecords": 100,
  "includeAttachments": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `datasetItems` (type: `string`):

Browse or download all validated SAM.gov opportunities from this run.

## `runTelemetry` (type: `string`):

Execution speed, PPE counts, and live RSS memory footprint.

# 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 = {
    "searchKeywords": "artificial intelligence cybersecurity"
};

// Run the Actor and wait for it to finish
const run = await client.actor("zodiacxs/sam-gov-federal-procurement-harvester").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 = { "searchKeywords": "artificial intelligence cybersecurity" }

# Run the Actor and wait for it to finish
run = client.actor("zodiacxs/sam-gov-federal-procurement-harvester").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 '{
  "searchKeywords": "artificial intelligence cybersecurity"
}' |
apify call zodiacxs/sam-gov-federal-procurement-harvester --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,zodiacxs/sam-gov-federal-procurement-harvester"
        }
    }
}
```

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/ft85Jv8RP2mVgKgaf/builds/cm4Aprc3Pb0EfZFkS/openapi.json
