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

Scrape SAM.gov federal contract opportunities: solicitations, sources sought, RFIs and awards with NAICS, PSC, set-aside, deadline, agency, place of performance and contracting officer contacts. Filter by keyword, NAICS, state, date. No API key. $3 per 1,000.

- **URL**: https://apify.com/data_factory_nerd/sam-gov-contract-opportunities.md
- **Developed by:** [Joe Pena](https://apify.com/data_factory_nerd) (community)
- **Categories:** Lead generation, Business, Automation
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.70 / 1,000 results

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

### What is SAM.gov Contract Opportunities Scraper?

**SAM.gov Contract Opportunities Scraper** gets **US federal government contract opportunities from SAM.gov** (formerly FedBizOpps / FBO) as clean, structured data. It covers solicitations, combined synopsis/solicitations, presolicitations, **sources sought / RFIs**, special notices and **award notices**.

Every row includes the **agency, NAICS code, PSC code, set-aside (small business, 8(a), HUBZone, SDVOSB, WOSB), response deadline, place of performance, full description and the official contracting officer contacts**. **No SAM.gov account or API key is needed.** Search by keyword, NAICS code, set-aside, notice type, state and posting date, then export to JSON, CSV or Excel, or send new bids to your CRM every day.

### What data can you extract from SAM.gov?

| Field | Example |
|---|---|
| `title` | Janitorial Services Needed for the Eleven Point Ranger District |
| `noticeType` | Combined Synopsis/Solicitation |
| `department` / `subTier` / `office` | AGRICULTURE, DEPARTMENT OF / FOREST SERVICE / USDA-FS, CSA EAST 6 |
| `naicsCode` / `pscCode` | 561720 / S201 |
| `setAsideCode` / `setAside` | SBA / Total Small Business Set-Aside (FAR 19.5) |
| `postedDate` / `responseDeadline` | 2026-11-05 / 2026-11-13 (UTC ISO 8601) |
| `placeOfPerformanceCity` / `placeOfPerformanceState` | Doniphan / MO |
| `contacts` | Official points of contact: name, email, phone |
| `attachments` | Solicitation PDFs, amendments and Q\&A with direct download links (optional) |
| `url` | Link to the notice on sam.gov |

All fields: noticeId, title, solicitationNumber, noticeType, noticeTypeCode, department, subTier, office, officeAddress, postedDate, modifiedDate, responseDeadline, responseTimeZone, isActive, isCanceled, awardee, awardAmount, awardDate, url, descriptionSnippet, naicsCode, pscCode, setAsideCode, setAside, placeOfPerformanceCity/State/Zip/Country, contacts, description, attachments, scrapedAt.

### SAM.gov scraper features

- 🔎 **Search filters**: keywords, NAICS codes, PSC codes, agencies, notice types, set-asides, place-of-performance states, posted within N days
- 📎 **Attachment links**: solicitation documents, amendments and Q\&A with direct download URLs
- 🔔 **Monitor mode**: return only notices that are new since the last run, for daily bid alerts
- ⏰ **Still open for responses**: drop notices whose response deadline has passed
- 📇 **Contracting officer contacts** from each notice
- 🏛️ **Full agency hierarchy** (department, sub-tier, office), filled in from SAM.gov's federal hierarchy when a notice omits it
- 🔁 **Built for daily monitoring**: turn on monitor mode, schedule it, and send results to Google Sheets, Slack, email or your CRM
- 🧹 De-duplicated across keywords, normalized UTC dates, plain-text descriptions

### How to find federal contract opportunities on SAM.gov

1. Enter keywords (e.g. `cybersecurity`, `janitorial`) and/or NAICS codes (e.g. `541512`).
2. Optionally add PSC codes (e.g. `S201`) or agencies (e.g. `FOREST SERVICE`, `DEPT OF THE NAVY`), pick notice types and set-asides, turn on **Still open for responses**, or set **Posted within last N days**.
3. Click **Start**, then export from the **Output** tab or use the API.

#### Input examples

Daily feed of new small-business IT bids:

```json
{ "naicsCodes": ["541511", "541512", "541519"], "setAsides": ["SBA"], "noticeTypes": ["o", "k", "p", "r"], "postedWithinDays": 1, "maxItems": 500 }
```

Research a topic, open bids only:

```json
{ "keywords": ["cybersecurity"], "sortBy": "relevance", "openForResponseOnly": true, "maxItems": 100 }
```

Janitorial bids from the Forest Service with attachment links:

```json
{ "pscCodes": ["S201"], "agencies": ["FOREST SERVICE"], "includeAttachments": true, "openForResponseOnly": true, "maxItems": 50 }
```

**Agencies** accept the official name from SAM.gov's federal hierarchy, a common acronym (`GSA`, `DOD`) or a numeric org ID. The run log shows which organization each entry matched; entries that can't be matched are skipped with a warning.

#### Output example

```json
{
  "noticeId": "4c022b2d855042b19d7da16523a179f7",
  "title": "Janitorial Services Needed for the Eleven Point Ranger District- Mark Twain N.F.",
  "solicitationNumber": "12444527Q0007",
  "noticeType": "Combined Synopsis/Solicitation",
  "department": "AGRICULTURE, DEPARTMENT OF",
  "subTier": "FOREST SERVICE",
  "office": "USDA-FS, CSA EAST 6",
  "naicsCode": "561720",
  "pscCode": "S201",
  "setAsideCode": "SBA",
  "setAside": "Total Small Business Set-Aside (FAR 19.5)",
  "postedDate": "2026-11-05T17:01:00+00:00",
  "responseDeadline": "2026-11-13T15:00:00+00:00",
  "placeOfPerformanceCity": "Doniphan",
  "placeOfPerformanceState": "MO",
  "url": "https://sam.gov/opp/4c022b2d855042b19d7da16523a179f7/view",
  "contacts": [
    {
      "type": "primary",
      "name": "(contracting officer name)",
      "email": "(official .gov/.mil email)",
      "phone": "(phone)"
    }
  ]
}
```

### Monitor mode: only new notices since the last run

Turn on **Only new notices since last run** (`onlyNew: true`) and the Actor remembers every notice it has returned for that search. The next run returns only notices it hasn't returned before, so you pay only for new results.

- The first run returns everything that currently matches and saves it as the baseline.
- Seen IDs are stored in a named key-value store in **your** Apify account (`data-factory-samgov-monitor`), one record per search. The record name comes from your search filters, so different searches keep separate histories.
- Want to keep one history while you adjust filters? Set **Monitor name** (`monitorKey`), e.g. `"daily-alert"`.
- To start over, delete that record (or the whole store) in **Storage → Key-value stores**.

#### Schedule it for daily alerts

1. Configure your search, turn on **Only new notices since last run**, and save it as a task.
2. Create an Apify Schedule for that task (daily or hourly).
3. Add an integration (Slack, email, Google Sheets, Zapier, Make or a webhook) to push each run's new notices where your team works.

```json
{ "naicsCodes": ["541511", "541512", "541519"], "noticeTypes": ["o", "k", "p", "r"], "openForResponseOnly": true, "onlyNew": true, "maxItems": 500 }
```

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

Pay-per-result: **$3.00 per 1,000 notices** ($0.003 per notice), with full details and contacts included.

- 100 contract opportunities = $0.30
- 1,000 contract opportunities = $3.00
- Apify's free plan includes $5 of monthly usage, which covers roughly 1,600 notices with this Actor.

Use **Max notices** to cap the cost of any run.

### Who uses SAM.gov contract data?

- **Government contractors and small businesses** looking for bids to win
- **GovCon consultants and proposal writers** building pipelines for clients
- **BD and sales teams** that sell to agencies and need the contracting officer's details
- **Researchers and journalists** tracking federal procurement

### SAM.gov API alternative: run it from your code

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("data_factory_nerd/sam-gov-contract-opportunities").call(
    run_input={"naicsCodes": ["541512"], "setAsides": ["SBA"], "postedWithinDays": 7, "maxItems": 200}
)
for notice in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(notice["title"], notice["responseDeadline"], notice["url"])
```

### FAQ

#### Is SAM.gov data public?

Yes. SAM.gov contract opportunities are public US government information. Contacts are the official government points of contact published on each notice.

#### Do I need a SAM.gov account or API key?

No.

#### How fresh is the data?

Every run queries SAM.gov live.

#### What do the notice type codes mean?

o = Solicitation, k = Combined Synopsis/Solicitation, p = Presolicitation, r = Sources Sought, s = Special Notice, a = Award Notice, u = Justification (J\&A), i = Intent to Bundle, g = Sale of Surplus Property.

#### Can I download the solicitation documents?

Yes. Turn on **Include attachment links**. Each notice gets an `attachments` list with the file name, size, posted date and a sam.gov download URL that redirects to the file.

#### Need awards history by vendor?

Open an issue on the **Issues** tab. Requests decide what we build next.

### Related Actors by data_factory_nerd

| Actor | What it does |
|---|---|
| [Greenhouse Jobs Scraper](https://apify.com/data_factory_nerd/greenhouse-jobs-scraper) | All open jobs from any company's Greenhouse careers page, with salaries |
| [Multi-ATS Jobs Scraper](https://apify.com/data_factory_nerd/ats-jobs-scraper) | Greenhouse, Lever, Ashby, Workable, Recruitee and SmartRecruiters jobs in one dataset |

# Actor input Schema

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

Search terms, e.g. 'cybersecurity', 'janitorial', 'drone'. Each entry is a separate search (results are de-duplicated). Leave empty to list all notices matching the other filters.

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

Match each keyword entry as an exact phrase instead of all words.

## `sortBy` (type: `string`):

'Newest' is best for monitoring; 'relevance' is best for one-off research on a topic.

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

Filter by NAICS code, e.g. 541512 (computer systems design), 236220 (commercial construction), 561720 (janitorial). Each code is searched separately.

## `pscCodes` (type: `array`):

Filter by Product Service Code, e.g. S201 (custodial/janitorial), D399 (IT services), R425 (engineering/technical). Matches any listed code.

## `agencies` (type: `array`):

Filter by agency: official name as in SAM.gov's federal hierarchy (e.g. 'FOREST SERVICE', 'VETERANS AFFAIRS, DEPARTMENT OF', 'DEPT OF THE NAVY') or a numeric org ID. Unrecognised names are reported in the log and skipped.

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

Leave empty for all types. Bidders usually want Solicitation, Combined Synopsis/Solicitation, Presolicitation and Sources Sought.

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

Small-business set-aside programs. Leave empty for all.

## `placeOfPerformanceStates` (type: `array`):

Two-letter US state codes, e.g. TX, VA. Requires notice details (fetched automatically).

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

Only notices posted in the last N days. Great for daily or weekly monitoring runs.

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

Skip archived/inactive notices.

## `openForResponseOnly` (type: `boolean`):

Drop notices whose response deadline has already passed.

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

Adds NAICS, PSC, set-aside, place of performance, full description and official government points of contact (one extra request per notice).

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

Adds the notice's public attachments (solicitation PDFs, amendments, Q\&A) with direct download links. One extra request per notice.

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

Stop after this many notices (controls cost).

## `maxItemsPerSearch` (type: `integer`):

Optional cap per keyword (and per NAICS code) so one broad term doesn't use the whole budget.

## `onlyNew` (type: `boolean`):

Return only notices not returned by a previous run of this same search. Seen notice IDs are stored in a named key-value store in your account. The first run returns everything and remembers it. Combine with Apify Schedules for a daily new-bids alert.

## `monitorKey` (type: `string`):

Optional name for this monitor's memory. By default it is derived from your search filters, so changing the search starts a fresh history.

## Actor input object example

```json
{
  "keywords": [
    "cybersecurity"
  ],
  "exactPhrase": false,
  "sortBy": "newest",
  "noticeTypes": [
    "o",
    "k",
    "p",
    "r"
  ],
  "activeOnly": true,
  "openForResponseOnly": true,
  "includeDetails": true,
  "includeAttachments": true,
  "maxItems": 20,
  "onlyNew": false
}
```

# Actor output Schema

## `opportunities` (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"
    ],
    "noticeTypes": [
        "o",
        "k",
        "p",
        "r"
    ],
    "openForResponseOnly": true,
    "includeAttachments": true,
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("data_factory_nerd/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 = {
    "keywords": ["cybersecurity"],
    "noticeTypes": [
        "o",
        "k",
        "p",
        "r",
    ],
    "openForResponseOnly": True,
    "includeAttachments": True,
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("data_factory_nerd/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 '{
  "keywords": [
    "cybersecurity"
  ],
  "noticeTypes": [
    "o",
    "k",
    "p",
    "r"
  ],
  "openForResponseOnly": true,
  "includeAttachments": true,
  "maxItems": 20
}' |
apify call data_factory_nerd/sam-gov-contract-opportunities --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,data_factory_nerd/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/0rsbpBQxDvkBabbRZ/builds/o8JJzd5w7OgPKHaeh/openapi.json
