# SAM.gov Scraper - Federal Contracts, RFPs & Officer Emails (`hoanle0126/sam-gov-contracts-leads-scraper`) Actor

Extract active SAM.gov federal contract opportunities, RFPs, Sources Sought, NAICS codes, Small Business Set-Asides, and Contracting Officer (.gov/.mil) emails & phones without SAM API keys.

- **URL**: https://apify.com/hoanle0126/sam-gov-contracts-leads-scraper.md
- **Developed by:** [Hoan Le](https://apify.com/hoanle0126) (community)
- **Categories:** Lead generation, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.96 / 1,000 dataset items

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

## SAM.gov Scraper - US Federal Contracts, RFPs & Contracting Officer Emails

Extract active **US Federal Government contract opportunities (`RFPs`, `Sources Sought`, `Presolicitations`, `Combined Synopsis/Solicitations`, `Award Notices`)** from **SAM.gov** - complete with **Contracting Officer (`POC`) `.gov` / `.mil` email addresses**, **phone numbers**, **NAICS & PSC codes**, **Small Business Set-Asides (`SBA`, `8A`, `SDVOSBC`, `WOSB`)**, **response deadlines**, and **agency hierarchies** - **with zero SAM.gov API key required**.

Runs on **pure lightweight HTTP HAL+JSON (`256 MB` RAM, zero browser overhead, zero residential proxy cost)**.

***

### Key Capabilities

- **No SAM.gov API Key Required:** Queries SAM.gov's public `HAL+JSON` search and `opps/v2` detail endpoints directly without daily 10-request unverified API key bottlenecks.
- **Direct Contracting Officer (`POC`) Lead Extraction:** Captures `primaryContactName`, `primaryContactEmail` (e.g. `*.civ@mail.mil`, `*@va.gov`), `primaryContactPhone`, and `allContactEmails`.
- **GovCon Qualification Metadata:** Extracts `solicitationNumber`, `naicsCode`, `pscCode`, `setAside` (`SBA`, `8A`, `SDVOSBC`, `WOSB`), `department`, `agency`, `office`, `placeOfPerformance`, and `responseDeadline`.

***

### Input Parameters

| Field | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `keywords` | `string[]` | `["cybersecurity", "artificial intelligence"]` | Search keywords, NAICS codes (`541512`), solicitation numbers, or `sam.gov/opp/...` URLs. |
| `activeOnly` | `boolean` | `true` | Keep only active, non-archived solicitations. |
| `setAsideFilter` | `string` | `""` | Optional set-aside code filter (`SBA`, `8A`, `SDVOSBC`, `WOSB`). |
| `requireContactEmail` | `boolean` | `false` | Only output opportunities containing at least one Contracting Officer email. |
| `enrichOfficerContacts` | `boolean` | `true` | Fetch `opps/v2` detail JSON for POC emails, phones, NAICS, and set-asides. |
| `maxItemsPerKeyword` | `integer` | `15` | Max opportunities per keyword (`0` = unlimited). |

***

### Sample Output Record

```json
{
  "opportunityId": "009941e4ea9e4b1588976bedeb1323ee",
  "solicitationNumber": "N00019-27-RFPREQ-APM299-0678",
  "title": "MH-60 Airborne Mine Countermeasure Obsolescence Support",
  "noticeType": "Sources Sought",
  "isActive": true,
  "department": "DEPT OF DEFENSE",
  "agency": "DEPT OF THE NAVY",
  "office": "NAVAL AIR SYSTEMS COMMAND",
  "naicsCode": "334511",
  "pscCode": "K016",
  "setAside": "SBA",
  "responseDeadline": "2026-12-04T15:00:00-05:00",
  "placeOfPerformance": "Patuxent River, MD, USA",
  "primaryContactName": "Lauren R Martz",
  "primaryContactEmail": "lauren.r.martz.civ@us.navy.mil",
  "allContactEmails": [
    "lauren.r.martz.civ@us.navy.mil",
    "eric.j.richey.mil@us.navy.mil"
  ],
  "samUrl": "https://sam.gov/opp/009941e4ea9e4b1588976bedeb1323ee/view"
}
```

***

### How Much Does It Cost to Scrape SAM.gov Federal Contracts & Officer Emails?

This Actor uses transparent **Pay-Per-Event (`PPE`)** pricing - you only pay for actual dataset records returned, with **zero Actor start fees** and ultra-lightweight `256 MB` HTTP execution (`< $0.0001` platform compute per run).

- **Try for Free (`$5.00` Monthly Credit Included):** Every Apify Free plan includes `$5.00` in monthly usage credits, letting you extract approximately **`1,785` records every month completely free**.
- **Automatic Store Tier Discounts (Up to `30%` Off):**
  - **Free Tier:** `$2.80` per `1,000` records (`$0.0028` / record)
  - **Bronze Tier:** `$2.52` per `1,000` records
  - **Silver Tier:** `$2.24` per `1,000` records
  - **Gold / Platinum / Diamond Tiers:** `$1.96` per `1,000` records

***

### AI Agents (MCP), Automation & API Quickstart

- **Apify MCP Server (`Claude`, `Cursor`, `Windsurf`, `OpenAI Agents`):** Connect `https://mcp.apify.com` and reference `hoanle0126/sam-gov-contracts-leads-scraper` - full input and output schemas are exposed automatically for autonomous tool calling.
- **No-Code Workflows:** Plug directly into **n8n**, **Make**, **Clay**, **Zapier**, **Google Sheets**, or webhooks for scheduled pipelines.

#### Node.js (`apify-client`)

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('hoanle0126/sam-gov-contracts-leads-scraper').call({
  "keywords": [
    "cybersecurity",
    "artificial intelligence"
  ],
  "activeOnly": true,
  "setAsideFilter": "",
  "requireContactEmail": false,
  "enrichOfficerContacts": true,
  "maxItemsPerKeyword": 15
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### cURL REST API

```bash
curl -X POST "https://api.apify.com/v2/acts/hoanle0126~sam-gov-contracts-leads-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"keywords":["cybersecurity","artificial intelligence"],"activeOnly":true,"setAsideFilter":"","requireContactEmail":false,"enrichOfficerContacts":true,"maxItemsPerKeyword":15}'
```

***

### Frequently Asked Questions (FAQ)

#### Do I need to register for a SAM.gov API key?

No. Unlike tools gated by SAM.gov public API key rate limits (10 requests/day for unverified accounts), this Actor queries public SAM.gov `HAL+JSON` and `opps/v2` notice endpoints directly with zero API keys.

#### Does it extract direct `.gov` and `.mil` Contracting Officer emails and phone numbers?

Yes. With `enrichOfficerContacts: true` (default), Point-of-Contact (`POC`) blocks are parsed into `primaryContactName`, `primaryContactEmail`, `primaryContactPhone`, and `allContactEmails`.

#### Can GovCon BD teams filter by Small Business Set-Asides or NAICS codes?

Yes. Pass NAICS codes (`"541512"`) or solicitation numbers in `keywords`, filter `setAsideFilter` (`"SBA"`, `"8A"`, `"SDVOSBC"`, `"WOSB"`), and optionally set `requireContactEmail: true`.

#### Is all extracted procurement data compliant public government data?

Yes. Every record comes strictly from public US federal solicitation notices published on `sam.gov`.

# Actor input Schema

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

Enter keywords (e.g. 'cybersecurity', 'artificial intelligence', 'cloud migration', 'medical supplies'), NAICS codes ('541512'), or direct sam.gov/opp/... URLs.

## `activeOnly` (type: `boolean`):

Keep only active, non-archived SAM.gov contract opportunities.

## `setAsideFilter` (type: `string`):

Optional small-business set-aside filter substring (e.g. 'SBA', '8A', 'SDVOSBC', 'WOSB', 'HZC'). Leave blank for all.

## `requireContactEmail` (type: `boolean`):

Skip opportunities that do not list at least one Contracting Officer email address.

## `enrichOfficerContacts` (type: `boolean`):

Fetch each opportunity's v2 detail record to extract primary & secondary Contracting Officer (.gov/.mil) emails, phone numbers, NAICS, PSC, and place of performance.

## `maxItemsPerKeyword` (type: `integer`):

Maximum number of contract opportunities to extract per keyword (0 = unlimited).

## Actor input object example

```json
{
  "keywords": [
    "cybersecurity",
    "artificial intelligence"
  ],
  "activeOnly": true,
  "setAsideFilter": "",
  "requireContactEmail": false,
  "enrichOfficerContacts": true,
  "maxItemsPerKeyword": 15
}
```

# 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 = {
    "keywords": [
        "cybersecurity",
        "artificial intelligence"
    ],
    "maxItemsPerKeyword": 15
};

// Run the Actor and wait for it to finish
const run = await client.actor("hoanle0126/sam-gov-contracts-leads-scraper").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",
        "artificial intelligence",
    ],
    "maxItemsPerKeyword": 15,
}

# Run the Actor and wait for it to finish
run = client.actor("hoanle0126/sam-gov-contracts-leads-scraper").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",
    "artificial intelligence"
  ],
  "maxItemsPerKeyword": 15
}' |
apify call hoanle0126/sam-gov-contracts-leads-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,hoanle0126/sam-gov-contracts-leads-scraper"
        }
    }
}
```

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/tI28kPu9D4v2B1eOt/builds/iZQ3kQPRsQZeq1Chh/openapi.json
