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

Federal contract opportunities from the official SAM.gov public daily extract (no API key). Filter by NAICS, PSC, set-aside, agency, state and keywords; monitor mode returns only new, changed and removed notices.

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

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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 & Monitor

**Get US federal contract opportunities from SAM.gov as clean JSON, CSV or Excel, and get alerts for only the new ones.** The Actor reads the **official public SAM.gov Contract Opportunities extract** (the daily file SAM.gov publishes for data.gov), so there's no API key, no login, no rate-limit problems and no browser scraping. Filter by **NAICS, PSC, set-aside, agency, place of performance, notice type, posted date and keywords**. Schedule it daily and each run returns only the **new, changed and removed** notices.

### Why this SAM.gov scraper?

- ✅ **No SAM.gov API key needed**. The public API needs a key and has tight daily limits; this uses the official bulk extract instead.
- 🔁 **Monitor mode**: only new or changed notices (e.g. a new response deadline, amendment text, award posted) plus removed or archived ones
- 💸 **Cheap repeat runs**: if SAM.gov hasn't published a new extract since your last run, the Actor exits in seconds
- 🎯 Filters for NAICS (prefix), PSC, set-aside (SBA, 8A, SDVOSBC, WOSB, HZC…), agency, state, notice type and keywords
- 🏆 Award notices include award number, date, amount and awardee
- 🔒 No personal data: point-of-contact names, emails and phones are never output, and emails and phone numbers in descriptions are redacted

### Who is it for?

Government contractors and BD teams, GovCon consultants, proposal writers, small businesses tracking set-asides, market researchers, and anyone building a federal bid-alert feed for Slack, email or a CRM.

### Input example

```json
{
  "naicsCodes": ["5415"],
  "setAsideCodes": ["SBA", "8A"],
  "keywords": ["cloud", "software"],
  "noticeTypes": ["solicitation", "combined synopsis"],
  "emitMode": "changes",
  "stateName": "it-set-asides"
}
```

### Output example

```json
{
  "changeType": "new",
  "noticeId": "ffd716b84569432cac0e9dd945b3d8f7",
  "title": "Q511--OFL CSS/IOT Lab Management Software and Digital Lens Calculations",
  "solicitationNumber": "36C26026Q0472",
  "department": "VETERANS AFFAIRS, DEPARTMENT OF",
  "office": "260-NETWORK CONTRACT OFFICE 20 (36C260)",
  "postedDate": "2026-10-16 13:21:21",
  "type": "Award Notice",
  "setAsideCode": "SBA",
  "setAside": "Small Business Set Aside - Total",
  "responseDeadline": null,
  "naicsCode": "541519",
  "classificationCode": "Q511",
  "placeOfPerformance": {"city": null, "state": null, "zip": null, "country": null},
  "awardNumber": "36C26027P0039",
  "awardDate": "2026-10-16",
  "awardAmount": 2292230.56,
  "awardee": "OPTICAL SYSTEMS GROUP, INC. BELLEAIR BEACH 33786 FLK",
  "link": "https://sam.gov/workspace/contract/opp/ffd716b84569432cac0e9dd945b3d8f7/view",
  "firstSeenAt": "2026-10-20T09:46:46+00:00"
}
```

The run summary (rows scanned, matches, new/changed/removed counts, extract version) is in the key-value store record `OUTPUT`.

### How to schedule daily bid alerts

1. Set your filters and a **State name** (e.g. `it-set-asides`).
2. Run it once: every current match is output as `new`.
3. Create a **Schedule** (e.g. daily at 08:00 ET) and connect the dataset to Slack, email, Google Sheets, Zapier, Make or a webhook.

### Notes and limits

- SAM.gov regenerates the extract roughly once a day, so running more often than daily won't find anything newer.
- `removed` means the notice is no longer in the active extract (archived or cancelled) **or** no longer matches your filters (for example its deadline passed while `openOnly` is on).
- Data source: SAM.gov Contract Opportunities public extract (U.S. General Services Administration). This is US government public data. This Actor isn't affiliated with or endorsed by GSA or SAM.gov.

### FAQ

**Do I need a SAM.gov account or API key?** No.
**How fresh is it?** As fresh as SAM.gov's daily public extract.
**Can I get contact emails?** No. This Actor deliberately outputs no personal contact data. Use the notice `link` to view it on SAM.gov.

*Built by Kestrel Data.*

# Actor input Schema

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

Case-insensitive match in title or description, e.g. 'cybersecurity', 'janitorial'.

## `excludeKeywords` (type: `array`):

Drop notices whose title/description contains any of these.

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

e.g. 5415 matches 541511, 541512, 541519…

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

Product Service Codes, e.g. D3 or R4.

## `setAsideCodes` (type: `array`):

Exact codes, e.g. SBA, 8A, SDVOSBC, WOSB, HZC.

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

Matched against department, sub-tier and office, e.g. 'veterans affairs', 'army'.

## `popStates` (type: `array`):

Two-letter codes, e.g. VA, TX.

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

e.g. 'solicitation', 'combined synopsis', 'sources sought', 'award notice', 'presolicitation'.

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

0 = any posted date.

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

Skip notices SAM.gov marks inactive.

## `openOnly` (type: `boolean`):

Drop notices whose response deadline has passed (notices without a deadline, e.g. awards, are kept).

## `emitMode` (type: `string`):

Monitor mode compares with the previous run that used the same state name and filters. The first run outputs all matches as 'new'.

## `includeRemoved` (type: `boolean`):

Output a 'removed' row for notices that were archived or no longer match your filters.

## `includeDescription` (type: `boolean`):

Full notice description (emails and phone numbers are redacted). Description changes are always detected.

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

0 = no limit. When the limit is hit, removed-notice detection is skipped.

## `stateName` (type: `string`):

Separate monitors need separate state names.

## `resetState` (type: `boolean`):

Treat every match as new this run.

## `forceDownload` (type: `boolean`):

By default, monitor runs exit immediately (and cheaply) when SAM.gov has not published a new extract since the last run.

## Actor input object example

```json
{
  "keywords": [
    "software"
  ],
  "naicsCodes": [
    "5415"
  ],
  "postedWithinDays": 0,
  "activeOnly": true,
  "openOnly": true,
  "emitMode": "changes",
  "includeRemoved": true,
  "includeDescription": false,
  "maxResults": 0,
  "stateName": "default",
  "resetState": false,
  "forceDownload": false
}
```

# Actor output Schema

## `results` (type: `string`):

Notices (new/changed/removed in monitor mode).

## `summary` (type: `string`):

Rows scanned, matches, counts and extract version.

# 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": [
        "software"
    ],
    "naicsCodes": [
        "5415"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("kestreldata/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": ["software"],
    "naicsCodes": ["5415"],
}

# Run the Actor and wait for it to finish
run = client.actor("kestreldata/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": [
    "software"
  ],
  "naicsCodes": [
    "5415"
  ]
}' |
apify call kestreldata/sam-gov-contract-opportunities --silent --output-dataset

```

## MCP server setup

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