# SAM.gov Contract Opportunities Scraper (`waags/sam-gov-contract-opportunities`) Actor

Scrape SAM.gov federal contract opportunities: RFPs, solicitations, sources sought and awards. Filter by keyword, NAICS, set-aside, state and date. Get contacts, deadlines, NAICS/PSC and attachments. No API key.

- **URL**: https://apify.com/waags/sam-gov-contract-opportunities.md
- **Developed by:** [Andres Garcia](https://apify.com/waags) (community)
- **Categories:** Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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

## SAM.gov Contract Opportunities Scraper: Federal RFPs, Bids & Contacts

Export **federal contract opportunities from SAM.gov** (solicitations, RFPs, RFQs, sources sought, presolicitations and award notices) as clean JSON, CSV or Excel. Filter by keyword, **NAICS code**, **set-aside** (8(a), HUBZone, SDVOSB, WOSB, small business), place-of-performance state and posting date. Each row includes the **contracting officer's name, email and phone**, the response deadline, NAICS/PSC codes and attachment links.

**No SAM.gov API key, no login, no proxies.** The actor reads the same public JSON endpoints that power the SAM.gov website, so runs are fast and cheap.

### What can this SAM.gov scraper do?

- 🔎 **Search all active federal opportunities** by keyword, with optional exact-phrase and title-only matching
- 🏷️ **Filter by NAICS codes, notice type, set-aside program and state**, the same filters govcon BD teams use every day
- 📅 **Relative date windows** ("posted in the last 7 days", "deadline from today") for daily or weekly scheduled monitoring
- 👤 **Contracting officer contacts**: primary and secondary point of contact with name, email and E.164 phone
- ⏰ **Response deadline + "days left"** so you can prioritize bids that are still open
- 🏛️ **Department, agency, office and office address**
- 🏆 **Award notices**: awardee name, UEI, contract number, award amount and date (great for competitor intelligence)
- 📎 **Attachment links** (SOW, PWS, specifications, amendments) and the official SAM.gov URL
- 📝 **Plain-text description** (HTML stripped, optional length limit)
- 💰 **Pay only for results**, with a hard `maxItems` cap

### Who uses it?

| Use case | How |
| --- | --- |
| **Government contractors / BD teams** | Schedule a daily run with your NAICS codes and set-asides, then push new RFPs to Slack, email or your CRM |
| **Proposal writers & consultants** | Build pipelines of open solicitations with deadlines and contacts for clients |
| **Lead generation for B2B sellers** | Find agencies buying your category and the contracting officers behind them |
| **Competitive intelligence** | Track award notices: who won, for how much, at which agency |
| **Market research & AI agents** | Feed structured federal procurement data into dashboards, LLMs and RAG pipelines |

### How to use it

1. Click **Try for free** (or **Start**). The input is prefilled with IT-services NAICS codes (541511, 541512, 541519) and the last 14 days, so the first run works in one click.
2. Adjust **keywords, NAICS codes, set-asides, states and dates** to match your niche.
3. Click **Start** and download the results as **JSON, CSV, Excel, XML or HTML**, or fetch them through the [Apify API](https://docs.apify.com/api/v2).
4. **Schedule it** (for example every morning with `Posted on or after = 1 day`) and connect an integration (Slack, Google Sheets, Zapier, Make, webhooks) to get new bids automatically.

#### Input example

```json
{
    "keywords": "janitorial",
    "noticeTypes": ["o", "k", "r"],
    "naicsCodes": ["561720"],
    "setAsides": ["SBA", "WOSB"],
    "states": ["TX", "OK"],
    "postedFrom": "7 days",
    "responseDueFrom": "+0 days",
    "maxItems": 200
}
```

| Field | Description |
| --- | --- |
| `keywords` | Full-text search. With **Keywords must appear in the title** on (default), only notices whose title contains all words are returned, which removes boilerplate matches. |
| `noticeTypes` | `o` Solicitation, `k` Combined Synopsis/Solicitation, `p` Presolicitation, `r` Sources Sought, `s` Special Notice, `a` Award Notice, `u` Justification, `i` Intent to Bundle, `g` Surplus Sale |
| `naicsCodes` | One or more NAICS codes |
| `setAsides` | SBA, SBP, 8A, 8AN, HZC, HZS, SDVOSBC, SDVOSBS, WOSB, WOSBSS, EDWOSB, EDWOSBSS, VSA, VSS, IEE, ISBEE, BICiv |
| `states` | Place-of-performance states (2-letter codes) |
| `postedFrom` / `postedTo` | `YYYY-MM-DD` or relative (`7 days` = 7 days ago) |
| `responseDueFrom` | Skip notices whose deadline has passed (`+0 days` = today) |
| `includeDetails` | Contacts, NAICS, PSC, set-aside, place of performance, award data and description (default on) |
| `includeAttachments` | Attachment and link URLs (default on) |
| `maxItems` | Maximum results (up to 10,000 per search) |

#### Output example

```json
{
    "noticeId": "afd976c236d1409ebfa10d80aee511af",
    "title": "AFSBn Snow Removal",
    "solicitationNumber": "W911S227QA003",
    "noticeType": "Combined Synopsis/Solicitation",
    "postedDate": "2026-09-30T23:54:57.907+00:00",
    "responseDeadline": "2026-10-16T10:00:00-04:00",
    "daysUntilResponseDeadline": 16,
    "department": "DEPT OF DEFENSE",
    "agency": "DEPT OF THE ARMY",
    "office": "W6QM FT DRUM CONTRACTING OFFICE",
    "naicsCodes": ["561730"],
    "pscCode": "S218",
    "setAsideCode": "SBA",
    "setAside": "Total Small Business Set-Aside (FAR 19.5)",
    "primaryContactName": "Mary Summerlin",
    "primaryContactEmail": "mary.e.summerlin3.civ@army.mil",
    "primaryContactPhone": "+13157725053",
    "contacts": [
        { "type": "primary", "name": "Mary Summerlin", "email": "mary.e.summerlin3.civ@army.mil", "phone": "+13157725053" },
        { "type": "secondary", "name": "Cody Bresette", "email": "cody.a.bresette.civ@army.mil", "phone": null }
    ],
    "description": "Fort Drum, NY has a requirement for snow plowing, salting, and snow removal…",
    "attachments": [{ "name": "PIEE Solicitation Module Link", "type": "link", "url": "https://piee.eb.mil/…" }],
    "url": "https://sam.gov/opp/afd976c236d1409ebfa10d80aee511af/view"
}
```

The dataset has two ready-made views: **Opportunities** (deadline, set-aside, contact) and **Awards** (awardee, UEI, amount).

### How much does it cost to scrape SAM.gov?

This actor uses **pay-per-event** pricing: you pay a small fee when a run starts and a fixed price per opportunity saved. There are no compute or proxy charges on top. The current prices are shown on the **Pricing** tab, at roughly **$1.75 per 1,000 opportunities**. A daily run that returns 50 new bids costs **about 9 cents**. Apify's free plan credits cover many runs per month.

Set `maxItems` (and optionally **Max cost per run** in the run options) to keep a hard cap on spend.

### Tips

- **Daily monitoring:** schedule with `postedFrom = "1 day"` and `responseDueFrom = "+0 days"`. You get only new, still-open bids.
- **Small-business pipelines:** combine `setAsides` (e.g. `SDVOSBC`, `8A`, `HZC`) with your NAICS codes.
- **Competitor tracking:** set `noticeTypes = ["a"]` and `activeOnly = false`, then filter the Awards view by awardee.
- **Broad discovery:** turn off **Keywords must appear in the title** to search inside descriptions too.

### FAQ

**Do I need a SAM.gov API key?** No. The actor uses SAM.gov's public website endpoints, which need no key or account.

**Is scraping SAM.gov legal?** SAM.gov opportunity data is public US government information published for anyone to read and reuse. This actor only reads public notices and does not access anything behind a login. Contact data is published by the agencies for vendor inquiries. Use it for legitimate business communication and follow applicable laws (e.g. CAN-SPAM).

**How fresh is the data?** Real time. Every run queries SAM.gov live.

**What's the maximum per run?** SAM.gov returns up to 10,000 notices per search. Split larger exports by date range or NAICS code.

**Can I get the attachments' files?** The actor returns direct download links. Files are not downloaded, which keeps runs fast and cheap.

**Something broke or you need a field?** Open an issue on the **Issues** tab. We monitor this actor daily and usually respond within 24 hours.

### Related actors by WAAGS

- [SEC Form D Funding Leads](https://apify.com/waags/sec-form-d-funding-leads): newly funded US companies with executives
- [FMCSA Trucking Carrier Leads](https://apify.com/waags/fmcsa-trucking-carrier-leads): US trucking companies with phone and email
- [Bulk Email Validator](https://apify.com/waags/bulk-email-validator): clean contact lists before outreach
- [US Phone Number Validator](https://apify.com/waags/us-phone-number-validator): E.164, line type, state and time zone

*Not affiliated with, endorsed by, or sponsored by the U.S. General Services Administration or SAM.gov.*

# Actor input Schema

## `keywords` (type: `string`):

Full-text search across titles, descriptions and solicitation numbers, e.g. "cybersecurity", "janitorial", "drone". Leave empty to get all opportunities that match the other filters.

## `exactPhrase` (type: `boolean`):

If enabled, the keywords must appear as an exact phrase. Otherwise all words must appear in any order.

## `titleOnly` (type: `boolean`):

SAM.gov's full-text search also matches boilerplate clauses inside descriptions (e.g. every DoD notice mentions "cybersecurity"). Keep this on to return only notices whose title contains your keywords. Turn it off for the broadest search.

## `noticeTypes` (type: `array`):

Only return these notice types. Leave empty for all types.

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

Filter by NAICS codes, e.g. 541512 (Computer Systems Design) or 236220 (Commercial Building Construction).

## `setAsides` (type: `array`):

Only return opportunities reserved for these small-business programs.

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

2-letter US state codes for the place of performance, e.g. TX, VA, CA.

## `postedFrom` (type: `string`):

Only notices published on or after this date. Use an absolute date (YYYY-MM-DD) or a relative one such as "30 days" (30 days ago). Relative values are recomputed on every run, which is ideal for daily schedules.

## `postedTo` (type: `string`):

Only notices published on or before this date (YYYY-MM-DD or relative such as "1 day").

## `responseDueFrom` (type: `string`):

Only notices whose response deadline is on or after this date. Use "+0 days" for today, or a fixed date, to skip opportunities that already closed.

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

Exclude archived and inactive notices.

## `sort` (type: `string`):

Order in which notices are collected.

## `includeDetails` (type: `boolean`):

Fetch each notice's detail page for contracting officer contacts, NAICS, PSC, set-aside, place of performance, award data and description. Disable for a faster, lighter listing.

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

List public attachment download links (SOW, specifications, amendments) for each notice. The files themselves are not downloaded.

## `descriptionMaxLength` (type: `integer`):

Truncate the plain-text description to this many characters. Use 0 for the full text.

## `maxItems` (type: `integer`):

Maximum number of opportunities to return (SAM.gov allows up to 10,000 per search). You are charged per result, so this also caps your cost.

## Actor input object example

```json
{
  "exactPhrase": false,
  "titleOnly": true,
  "noticeTypes": [
    "o",
    "k",
    "r"
  ],
  "naicsCodes": [
    "541511",
    "541512",
    "541519"
  ],
  "postedFrom": "14 days",
  "activeOnly": true,
  "sort": "newest",
  "includeDetails": true,
  "includeAttachments": true,
  "descriptionMaxLength": 5000,
  "maxItems": 50
}
```

# 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 = {
    "noticeTypes": [
        "o",
        "k",
        "r"
    ],
    "naicsCodes": [
        "541511",
        "541512",
        "541519"
    ],
    "postedFrom": "14 days",
    "maxItems": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("waags/sam-gov-contract-opportunities").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 = {
    "noticeTypes": [
        "o",
        "k",
        "r",
    ],
    "naicsCodes": [
        "541511",
        "541512",
        "541519",
    ],
    "postedFrom": "14 days",
    "maxItems": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("waags/sam-gov-contract-opportunities").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 '{
  "noticeTypes": [
    "o",
    "k",
    "r"
  ],
  "naicsCodes": [
    "541511",
    "541512",
    "541519"
  ],
  "postedFrom": "14 days",
  "maxItems": 50
}' |
apify call waags/sam-gov-contract-opportunities --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,waags/sam-gov-contract-opportunities"
        }
    }
}
```

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/07WwffdMEEB4Pp1bW/builds/nMawhbH69cabWt6yQ/openapi.json
