# SAM.gov Opportunity Monitor — New Bids Daily, No Login (`chimerical_quicklime/sam-gov-opportunity-monitor`) Actor

Schedule it daily and get only the NEW or UPDATED SAM.gov opportunities matching your keywords, NAICS codes, set-asides, states and agencies. Remembers what it has seen, flags changes, posts to your webhook. No API key. No login or API key. MCP-ready for AI agents. $10 per 1,000 alerts.

- **URL**: https://apify.com/chimerical\_quicklime/sam-gov-opportunity-monitor.md
- **Developed by:** [Khrystyna Skotte](https://apify.com/chimerical_quicklime) (community)
- **Categories:** Lead generation, Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 opportunities

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 Opportunity Monitor — daily new & updated federal contracts

Get a **daily feed of only the new or updated SAM.gov opportunities that match your profile** — keywords,
NAICS codes, notice types, set-asides, place-of-performance states and agencies. The monitor remembers
every notice it has already reported, so a scheduled run emits just the delta (marked `new` or `updated`),
posts a summary to your webhook, and costs you only for what actually changed. No SAM.gov API key needed.

Use it instead of re-scraping the whole search every morning and diffing spreadsheets yourself.

### How it works

1. Queries SAM.gov's public search for notices **modified in the last `lookbackDays`** matching your filters.
2. Compares each notice against the monitor's saved state (`noticeId → modifiedDate`).
3. Emits a record when the notice is unseen (`changeType: "new"`) or its modified date advanced
   (`changeType: "updated"`), enriched with NAICS, PSC, set-aside, place of performance and a description
   snippet from the notice detail page.
4. Saves the updated state, then POSTs a run summary to `webhookUrl` if set.

State lives in a named key-value store `samgov-monitor-<hash of monitorId>` in your Apify account, capped at
50,000 notices (oldest by modified date are dropped). Delete the store to reset a monitor.

### Input

| Field | Default | Notes |
|---|---|---|
| `keywords` | `["cybersecurity"]` | OR-ed full-text terms. Empty = no keyword restriction |
| `naicsCodes` | `[]` | e.g. `["541512", "541519"]` |
| `noticeTypes` | `["o","p","k"]` | Codes or names: `o` Solicitation, `p` Presolicitation, `k` Combined Synopsis/Solicitation, `r` Sources Sought, `s` Special Notice, `a` Award Notice, `u` Justification, `i` Intent to Bundle, `v` Consolidate/Bundle, `g` Surplus Sale. Empty = all |
| `setAsides` | `[]` | `SBA`, `8A`, `8AN`, `HZC`, `SDVOSBC`, `WOSB`, `EDWOSB`, `VSA`, … |
| `states` | `[]` | Place-of-performance state codes, e.g. `["VA","MD","DC"]` |
| `agencies` | `[]` | Case-insensitive substring match on department / sub-agency / office names |
| `lookbackDays` | `3` | Notices modified within N days. 2–3 gives a safe overlap for a daily schedule |
| `maxNewOpportunities` | `10` | Cap per run; anything beyond stays unseen and comes out next run |
| `firstRunMode` | `emitAll` | `emitAll` reports every current match on the first run; `baseline` records them silently |
| `webhookUrl` | `""` | Optional POST target for the run summary |
| `monitorId` | `default` | One state store per ID — run several watchlists side by side |

### Recommended setup for a daily feed

1. Create a task with your filters and set `monitorId` to something meaningful (`it-services-va`).
2. **First run: set `firstRunMode` to `baseline`** and `lookbackDays` to 30. This records everything
   currently on SAM.gov that matches, emits nothing, and stops your first day from being a 500-row backlog.
3. Switch `firstRunMode` back to `emitAll` (it only matters when the state is empty anyway), set
   `lookbackDays` to 3 and `maxNewOpportunities` to 200+.
4. **Schedule the task daily at 06:00 America/New\_York.** SAM.gov posts most notices during the East Coast
   business day, so a 06:00 ET run catches everything from the previous day before your team starts.
5. Point `webhookUrl` at Slack (incoming webhook), Zapier, Make, or your own endpoint.

The default settings (`{}`) run in `emitAll` mode with the `cybersecurity` keyword so you see real output
on the first try.

### Example: NAICS watchlist for an IT services small business

```json
{
  "keywords": [],
  "naicsCodes": ["541511", "541512", "541519", "518210"],
  "noticeTypes": ["o", "p", "k", "r"],
  "setAsides": ["SBA", "8A", "SDVOSBC"],
  "states": [],
  "agencies": ["Veterans Affairs", "Health and Human Services"],
  "lookbackDays": 3,
  "maxNewOpportunities": 200,
  "firstRunMode": "baseline",
  "webhookUrl": "https://hooks.slack.com/services/XXX/YYY/ZZZ",
  "monitorId": "it-smallbiz-va-hhs"
}
```

Other quick profiles:

- **Construction in Texas**: `naicsCodes: ["236220","237310"]`, `states: ["TX"]`, `noticeTypes: ["o","p","k"]`
- **Award intelligence** (who is winning what): `noticeTypes: ["a"]`, `naicsCodes: [...]`, `keywords: []`
- **Sources Sought only** (shape the requirement early): `noticeTypes: ["r"]`, `keywords: ["cloud", "zero trust"]`

### Output

One record per new or updated notice:

```json
{
  "noticeId": "45970579afdb4df89b2dd61c5f38e007",
  "title": "Antennas",
  "solicitationNumber": "N6660426Q0264",
  "noticeType": "Combined Synopsis/Solicitation",
  "noticeTypeCode": "k",
  "agency": "DEPT OF DEFENSE",
  "subAgency": "DEPT OF THE NAVY",
  "office": "NUWC DIV NEWPORT",
  "naicsCode": "334419",
  "pscCode": "5985",
  "setAside": "SBA",
  "postedDate": "2026-09-28T18:36:52+00:00",
  "modifiedDate": "2026-09-28T18:36:52+00:00",
  "responseDeadline": "2026-10-28T18:00:00+00:00",
  "placeOfPerformance": { "city": "Newport", "state": "RI", "stateName": "Rhode Island", "zip": "02841", "country": "USA" },
  "description": "This is an amended combined synopsis and solicitation for commercial items …",
  "samUrl": "https://sam.gov/opp/45970579afdb4df89b2dd61c5f38e007/view",
  "changeType": "new",
  "firstSeenAt": "2026-09-28T19:02:11.412Z",
  "matchedKeywords": ["cybersecurity"],
  "monitorId": "default"
}
```

`firstSeenAt` is set on `new` records; `updated` records carry `null` there and the new `modifiedDate`.
`matchedKeywords` lists which of your keywords appear in the title, solicitation number or description
snippet (SAM.gov also matches attachments and full text, so an empty list does not mean a false positive).

### Webhook payload

POSTed once per run as `application/json`, also saved as the `SUMMARY` record in the run's key-value store:

```json
{
  "monitorId": "it-smallbiz-va-hhs",
  "runAt": "2026-09-29T10:00:03.118Z",
  "newCount": 4,
  "updatedCount": 1,
  "scanned": 137,
  "seenTotal": 812,
  "baseline": false,
  "opportunities": [ { "...first 50 records, same shape as the dataset..." } ]
}
```

The full list is always in the run's dataset; use the Apify API or an integration to pull it if a run
produces more than 50.

### Pricing

Pay per event: a small start fee plus a per-opportunity fee **only for records emitted**. A daily monitor
that finds nothing new costs just the start fee.

### Notes

- Only active notices are considered (`is_active=true`), which is what a bid team wants; archived notices never appear.
- A run scans at most 2,000 notices (sorted newest-modified first). Narrow filters or a shorter lookback if
  your profile exceeds that.
- SAM.gov's search is public but rate-limited; the actor paces requests and retries transient errors.

# Actor input Schema

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

Search terms matched against the full notice (title, description, solicitation number). Multiple keywords are OR-ed: a notice matches if it contains any of them. Leave empty to match everything within the other filters.

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

Restrict to these NAICS codes, e.g. 541512, 541519, 236220. Empty = all.

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

Codes or names: o = Solicitation, p = Presolicitation, k = Combined Synopsis/Solicitation, r = Sources Sought, s = Special Notice, a = Award Notice, u = Justification, i = Intent to Bundle, v = Consolidate/Bundle, g = Sale of Surplus Property. Names like "Sources Sought" are accepted too. Empty = all types.

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

SAM.gov set-aside codes, e.g. SBA (Total Small Business), 8A, 8AN, HZC, SDVOSBC, WOSB, EDWOSB, VSA, HZS. Empty = all.

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

Two-letter US state codes for the place of performance, e.g. TX, VA, CA. Empty = all.

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

Case-insensitive text matched against the department, sub-agency and office names, e.g. "DEPT OF THE NAVY", "Veterans Affairs", "GSA". A notice matches if any level of its organisation hierarchy contains any of these. Empty = all.

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

Only consider notices modified within this many days. For a daily schedule 2-3 days gives a safe overlap; the seen-state prevents duplicates.

## `maxNewOpportunities` (type: `integer`):

Stop after emitting this many new or updated notices. Notices beyond the cap stay unseen and are emitted on the next run.

## `firstRunMode` (type: `string`):

What to do when the monitor has no saved state yet. emitAll: treat every current match as new and emit it (good for a one-off pull or a first test). baseline: silently record every current match as seen and emit nothing, so the next scheduled run reports only what changed since.

## `webhookUrl` (type: `string`):

Optional. After each run a JSON summary {monitorId, runAt, newCount, updatedCount, opportunities\[first 50]} is POSTed here (Slack/Zapier/Make/your API).

## `monitorId` (type: `string`):

Name of this watchlist. Each monitor ID keeps its own seen-state in a key-value store named samgov-monitor-<hash>, so you can run several profiles (e.g. "it-services-va", "construction-tx") side by side.

## Actor input object example

```json
{
  "keywords": [
    "cybersecurity"
  ],
  "naicsCodes": [],
  "noticeTypes": [
    "o",
    "p",
    "k"
  ],
  "setAsides": [],
  "states": [],
  "agencies": [],
  "lookbackDays": 3,
  "maxNewOpportunities": 10,
  "firstRunMode": "emitAll",
  "webhookUrl": "",
  "monitorId": "default"
}
```

# Actor output Schema

## `records` (type: `string`):

Dataset of new or updated SAM.gov opportunities found in this run (JSON).

# 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",
        "p",
        "k"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("chimerical_quicklime/sam-gov-opportunity-monitor").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",
        "p",
        "k",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("chimerical_quicklime/sam-gov-opportunity-monitor").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",
    "p",
    "k"
  ]
}' |
apify call chimerical_quicklime/sam-gov-opportunity-monitor --silent --output-dataset

```

## MCP server setup

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

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/yBHS5wtaxYIHK3NeN/builds/DUT6l5QycRPAeCZ0K/openapi.json
