# SAM.gov Federal Contract Opportunity Alert (`scrapebench/samgov-opportunity-alert`) Actor

Get alerted to new US federal contract opportunities matching your NAICS, agency, keyword, and set-aside filters — from the official SAM.gov registry.

- **URL**: https://apify.com/scrapebench/samgov-opportunity-alert.md
- **Developed by:** [ScrapeBench](https://apify.com/scrapebench) (community)
- **Categories:** Lead generation
- **Stats:** 18 total users, 9 monthly users, 82.2% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.01 / new opportunity

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## SAM.gov Federal Contract Opportunity Alert

### Pain points

- SAM.gov isn't built for automation — you re-run the same search by hand and copy results out.
- Generic SAM scrapers dump every notice; you re-filter to the NAICS/agency/set-aside you actually bid.
- Missing a solicitation's response deadline means missing the bid entirely.

### What we solve

- Returns the current opportunities matching your NAICS, agency, keyword, and set-aside — filtered, not the whole haystack.
- Structured rows with deadline, set-aside, agency, and the direct SAM.gov link — ready for a CRM or Slack.
- Runs on a schedule with Apify's native email/Slack/webhook integrations so new dataset items reach your team.

### Summary

Search SAM.gov for federal contract opportunities that fit your business. Set your NAICS codes, agency, title keyword, set-aside, and how many days back to look — each run returns the matching opportunities with response deadline, set-aside, agency, and a direct SAM.gov link. Schedule it and pipe new dataset items to email/Slack/webhook via Apify's native integrations. You pay per result.

### Who it's for

- Government contractors and BD teams tracking new solicitations
- Small businesses bidding set-aside opportunities (8(a), WOSB, SDVOSB)
- Capture managers monitoring specific agencies or NAICS codes
- GovCon consultants and proposal shops

### How to use

Set the input, run the actor, and collect results from the run's dataset (export to JSON/CSV/Excel, or pull via the Apify API). Example input:

```json
{
  "naicsCodes": [
    "541512"
  ],
  "setAside": "SBA",
  "lookbackDays": 1,
  "maxResults": 100
}
```

See **Inputs** below for every available field.

### What you get

One row per record:

| Field | Description |
|---|---|
| `notice_id` | SAM.gov notice ID |
| `title` | Opportunity title |
| `solicitation_number` | Solicitation number |
| `agency` | Buying agency / department hierarchy |
| `notice_type` | Notice type (Solicitation, Combined Synopsis, etc.) |
| `naics_code` | NAICS industry code |
| `set_aside` | Set-aside type (e.g. Total Small Business) |
| `posted_date` | Date the notice was posted |
| `response_deadline` | Offer/response due date |
| `archive_date` | Date the notice archives |
| `place_of_performance_state` | State where work is performed |
| `contact_name` | Primary point of contact |
| `contact_email` | Primary contact email |
| `ui_link` | Direct link to the opportunity on SAM.gov |

Sample:

```json
{
  "notice_id": "abc123def456",
  "title": "IT Support Services",
  "solicitation_number": "W912-26-R-0001",
  "agency": "DEPT OF DEFENSE.DEPT OF THE ARMY.ACC",
  "notice_type": "Solicitation",
  "naics_code": "541512",
  "set_aside": "Total Small Business Set-Aside (FAR 19.5)",
  "posted_date": "2026-06-20",
  "response_deadline": "2026-07-05T17:00:00-04:00",
  "archive_date": "2026-07-20",
  "place_of_performance_state": "VA",
  "contact_name": "Jane Doe",
  "contact_email": "jane.doe@army.mil",
  "ui_link": "https://sam.gov/workspace/contract/opp/abc123def456/view",
  "source_url": "https://sam.gov/workspace/contract/opp/abc123def456/view"
}
```

### Inputs

| Field | Required | Type | Default | Description |
|---|---|---|---|---|
| `naicsCodes` | no | array | `["541512"]` | Industry codes to match (e.g. '541512'). Leave empty to match any industry. |
| `keyword` | no | string | — | Free-text match on the opportunity title (e.g. 'cybersecurity'). |
| `agency` | no | string | — | Buying department name (e.g. 'GENERAL SERVICES ADMINISTRATION'). |
| `setAside` | no | string | — | Set-aside code, e.g. SBA (small business), 8A, WOSB, SDVOSBC. Leave empty for all. |
| `lookbackDays` | no | integer | `1` | Fetch opportunities posted within this many days. Every run returns everything in the window that matches, so a wide window on a frequent schedule returns the same notices again. |
| `maxResults` | no | integer | `100` | Cap on opportunities fetched per run. |

### Pricing (Pay Per Event)

You pay per result (`dataset-item`) — **no charge for empty runs**. Example: **50 opportunities returned** at *$0.01/result* ≈ **$0.50**.

Illustrative — final per-result price set at publish time. Runs that return no matches are free. Apify platform usage billed separately.

### Use cases

- Daily feed — schedule a run per NAICS/agency and get the matching opportunities each morning.
- Set-aside monitoring — track small-business or 8(a) solicitations as they post.
- Agency watch — follow a target agency's contract notices.
- Pipeline feed — pipe matches into a CRM or Slack via Apify integrations.

### Why this actor

- Filtered: results match your NAICS/agency/keyword/set-aside, not the whole SAM.gov firehose.
- Official source: the GSA Get Opportunities API, not a stale third-party copy.
- Pay per result; runs with no matches are free.

### Limitations & updates

Covers the SAM.gov 'Contract Opportunities' dataset via the official GSA API. Results reflect the live registry. Each run returns the current matches within your lookback window — it does not dedupe against previous runs, so a daily schedule with a short lookbackDays keeps results focused on recent postings. Contract-value filtering isn't supported (SAM.gov only publishes amounts on awarded notices).

### FAQ

**Where does the data come from?**

The official GSA Get Opportunities (SAM.gov) public API.

**Does each run only return new opportunities?**

No — each run returns the current opportunities matching your filters within your lookback window. Use a short lookbackDays (e.g. 1) on a daily schedule to keep results focused on recent postings.

**Can I get email or Slack alerts?**

Yes — schedule the actor and connect Apify's native email/Slack/webhook integrations to new dataset items.

**Can I filter by contract value?**

Not reliably — SAM.gov only publishes a dollar amount on awarded notices, not open solicitations, so value filtering isn't offered.

**How am I charged?**

Per opportunity returned. Runs that return no matches are free.

### Which actor to choose

Part of the public-data lead-gen suite — pick the one that fits your goal:

- **Multi-State Contractor License Lookup** — You need to verify contractor/trade licenses across US states.
- **California Contractor Directory** — You want CSLB contractor lead lists by class and county.

### Guides & use cases

Written up on **[scrapebench.dev](https://scrapebench.dev)** — the bench that runs and verifies this actor against the live source every night:

- **How-to:** [How to run SAM.gov Federal Contract Opportunity Alert](https://scrapebench.dev/guides/how-to-samgov-opportunity-alert/)
- **Use case:** [Alert: New Federal IT Services Contracts](https://scrapebench.dev/use-cases/alert-new-it-services-contracts/)
- **Use case:** [Monitor Small-Business Set-Aside Opportunities](https://scrapebench.dev/use-cases/monitor-small-business-set-aside-opportunities/)
- **Use case:** [Watch a Federal Agency for New Contracts](https://scrapebench.dev/use-cases/watch-an-agency-for-new-contracts/)

More actors, coverage and nightly verification results: **[scrapebench.dev](https://scrapebench.dev)**

# Actor input Schema

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

Industry codes to match (e.g. '541512'). Leave empty to match any industry.

## `keyword` (type: `string`):

Free-text match on the opportunity title (e.g. 'cybersecurity').

## `agency` (type: `string`):

Buying department name (e.g. 'GENERAL SERVICES ADMINISTRATION').

## `setAside` (type: `string`):

Set-aside code, e.g. SBA (small business), 8A, WOSB, SDVOSBC. Leave empty for all.

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

Fetch opportunities posted within this many days. Every run returns everything in the window that matches, so a wide window on a frequent schedule returns the same notices again.

## `maxResults` (type: `integer`):

Cap on opportunities fetched per run.

## `samGovApiKey` (type: `string`):

Optional. Leave blank to use the shared key that ships with this actor - fine for trying it out, but that key has a low DAILY quota shared by every user of this actor, so once it is spent no one gets results until 00:00 UTC. Paste your own key (free and instant from sam.gov -> Account Details -> API Key) to get your own quota and reliable runs. Your key is used only for your run and is never stored.

## Actor input object example

```json
{
  "naicsCodes": [
    "541512"
  ],
  "lookbackDays": 1,
  "maxResults": 100
}
```

# Actor output Schema

## `opportunities` (type: `string`):

Matching opportunities — title, agency, NAICS, set-aside, deadline, and link.

# 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 = {
    "naicsCodes": [
        "541512"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapebench/samgov-opportunity-alert").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 = { "naicsCodes": ["541512"] }

# Run the Actor and wait for it to finish
run = client.actor("scrapebench/samgov-opportunity-alert").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "naicsCodes": [
    "541512"
  ]
}' |
apify call scrapebench/samgov-opportunity-alert --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=scrapebench/samgov-opportunity-alert",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/TrJINsslJxKEAdVy1/builds/BuMwlYxeIqHaydtAZ/openapi.json
