# SAM.gov Contract Opportunities & Bid Alerts (`surefeed/sam-gov-scraper`) Actor

Find US federal contract opportunities on SAM.gov by keyword, NAICS, PSC, notice type, set-aside, state, agency and deadline. Each notice with details, contracting contacts, description, attachment links and award data. Daily alerts for new and updated bids.

- **URL**: https://apify.com/surefeed/sam-gov-scraper.md
- **Developed by:** [gianluca de dominicis](https://apify.com/surefeed) (community)
- **Categories:** Lead generation, Business, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.33 / 1,000 contract notices

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

## SAM.gov Contract Opportunities & Bid Alerts

Find **US federal contract opportunities** on SAM.gov — solicitations, RFPs, RFQs, sources sought, presolicitations and award notices — by keyword, **NAICS**, **PSC**, notice type, **set-aside**, state, agency and deadline. Every notice comes **fully enriched**: NAICS and PSC codes, set-aside, response deadline (with days left), place of performance, agency hierarchy, **contracting officer contacts**, clean description text, **direct attachment download links** and **award data** (awardee, UEI, amount).

Turn on **bid alerts** and schedule it daily: you get only the notices that are **new or updated** since the last run — with a flag when the **deadline moved**.

- **No API key, no quota** — uses the public SAM.gov data the website shows.
- **One row = one complete notice** — details and attachments are included in the price.
- **Bid alerts** — new and modified notices only, `deadlineChanged` and the previous deadline.
- **Deadline focus** — `daysUntilDeadline` on every notice, plus a "due within N days" filter.
- **Market research** — switch off `Active notices only` and filter on Award Notices to see who won what, for how much.
- **Reliable** — automatic retries and proxy fallback; one keyword that fails never throws away the notices already saved.

### Quick start

| You want | Input |
|---|---|
| Try it | Leave the prefilled `cybersecurity` example and press Start (20 notices) |
| Open IT bids for small businesses | `naicsCodes: ["541511","541512"]`, `noticeTypes: ["o","k"]`, `setAsides: ["SBA"]` |
| SDVOSB janitorial work in Virginia due within 30 days | `naicsCodes: ["561720"]`, `setAsides: ["SDVOSBC"]`, `states: ["VA"]`, `deadlineWithinDays: 30` |
| Early opportunities to shape | `keywords: ["drone"]`, `noticeTypes: ["r","p"]` |
| Daily bid alert | your filters + `onlyNewOrUpdated: true`, `updatedWithinDays: 2`, schedule daily |
| Who won recent awards | `naicsCodes: ["541330"]`, `noticeTypes: ["a"]`, `activeOnly: false`, `updatedWithinDays: 90` |

```json
{
  "keywords": ["cybersecurity"],
  "naicsCodes": ["541512"],
  "noticeTypes": ["o", "k"],
  "setAsides": ["SBA", "SDVOSBC"],
  "deadlineWithinDays": 30,
  "onlyNewOrUpdated": true
}
```

### Input

| Field | Meaning |
|---|---|
| `keywords` | One search per keyword. Empty = filters only |
| `naicsCodes` | NAICS codes (2–6 digits); any of them matches |
| `pscCodes` | Product/service codes, e.g. `D399`, `J065` |
| `noticeTypes` | `p` Presolicitation, `o` Solicitation, `k` Combined Synopsis/Solicitation, `r` Sources Sought, `s` Special Notice, `a` Award Notice, `u` Justification (J\&A), `i` Intent to Bundle, `g` Sale of Surplus Property |
| `setAsides` | `SBA`, `SBP`, `8A`, `8AN`, `HZC`, `HZS`, `SDVOSBC`, `SDVOSBS`, `WOSB`, `WOSBSS`, `EDWOSB`, `EDWOSBSS`, `VSA`, `VSS` |
| `states` | Place of performance, 2-letter codes |
| `agencyIds` | SAM.gov organization IDs (e.g. `100000000` = Department of Defense) |
| `updatedWithinDays` | Posted or modified in the last N days |
| `deadlineWithinDays` | Response due between today and N days from now (active notices) |
| `activeOnly` | Default on; off = archived/inactive notices |
| `includeAttachments` | Attachment names and direct download links (default on) |
| `maxResultsPerSearch` / `maxTotalResults` / `maxRunSeconds` | Limits (0 = none) |
| `onlyNewOrUpdated` / `monitorKey` | Bid alerts and an optional name for separate alert memories |
| `deduplicateAcrossSearches` | Return and charge each notice once per run (default on) |

Inputs SAM.gov cannot use (an unknown set-aside code, a 7-digit NAICS, a deadline filter on archived notices...) end the run with an **"Input problem"** status message, no results and no charge.

### Output

```json
{
  "noticeId": "04b7dd9b381e4f5eb9aca61fd1de8778",
  "title": "Notice Of Intent to Sole Source Vantive PRISMAX & THERMAX Service",
  "solicitationNumber": "HT941026N0080",
  "noticeType": "Solicitation",
  "noticeTypeCode": "o",
  "url": "https://sam.gov/opp/04b7dd9b381e4f5eb9aca61fd1de8778/view",
  "isActive": true,
  "postedAt": "2026-11-10T00:40:39+00:00",
  "modifiedAt": "2026-11-10T00:40:39+00:00",
  "responseDeadline": "2026-11-19T13:00:00+00:00",
  "daysUntilDeadline": 9,
  "department": "DEPT OF DEFENSE",
  "subTier": "DEFENSE HEALTH AGENCY (DHA)",
  "office": "W6QM MRDC-WRMC",
  "naicsCodes": ["811210"],
  "pscCode": "J065",
  "setAsideCode": null,
  "setAside": null,
  "placeOfPerformance": { "city": "San Diego", "state": "CA", "zip": "92134", "country": "USA" },
  "contacts": [{ "type": "primary", "name": "Jojie Urrete", "email": "jojie.n.urrete.civ@health.mil", "phone": null, "title": null }],
  "description": "Notice of Intent to Award Sole Source to Vantive US Healthcare, LLC ...",
  "attachments": [{ "name": "Task Order PWS Template - Prismax - Thermax.pdf", "url": "https://sam.gov/api/prod/opps/v3/opportunities/resources/files/4941bdc3fbdf4ffa9c3ef89a42567074/download", "type": "file", "mimeType": ".pdf", "sizeBytes": 425703 }],
  "award": null,
  "changeType": "new",
  "deadlineChanged": false,
  "previousResponseDeadline": null,
  "detailsStatus": "complete"
}
```

Award notices fill `award` with `date`, `amount`, `number`, `awardeeName`, `awardeeUei`, `awardeeCageCode`, `awardeeCity`, `awardeeState`. `contacts` are the official contracting contacts published on the notice. Descriptions are plain text (up to 20,000 characters).

**Check `RUN_SUMMARY`** in the key-value store for pages read per search, notices skipped as unchanged or duplicate, and why each search stopped.

### Pricing

Pay per event, no start fee: **$2 per 1,000 notices**, details and attachment links included. Unchanged notices skipped by alerts and duplicates are never charged. Set a maximum cost per run and the Actor stops cleanly before exceeding it.

### Bid alert setup

1. Build your search (keywords, NAICS/PSC, set-asides, states). Add `updatedWithinDays: 2` to keep daily runs light.
2. Turn on `onlyNewOrUpdated`. The first run returns the current matches; later runs return only new and modified notices.
3. Schedule it daily in Apify and connect email, Slack or a webhook to the run's dataset.
4. Watch `deadlineChanged` — amendments that move a due date are the ones you don't want to miss.

### More business data tools

- [Funding Rounds & Recently Funded Companies](https://apify.com/surefeed/recently-funded-companies) — US companies that just raised money, from official SEC filings: amount, round size, industry, executives.
- [US New Business Registrations & LLC Leads](https://apify.com/surefeed/us-new-business-registrations) — businesses newly registered in six states, from official state open data.
- [UK New Companies & Companies House Leads](https://apify.com/surefeed/uk-companies-house-scraper) — UK companies incorporated in any period, with SIC codes and directors.

### Notes

- Data comes from public SAM.gov contract opportunity records (US government information). SAM.gov returns at most 10,000 records per search; narrow the filters for more.
- This Actor is not affiliated with or endorsed by the US government or GSA.
- Something wrong or missing? Open an issue with the run link and the expected result.

# Actor input Schema

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

Words to search in notices, one search per line (e.g. cybersecurity, janitorial services, drone). Leave empty to use only the filters below.

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

Industry codes, e.g. 541511 (custom programming), 541512, 561720 (janitorial). Any of them matches.

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

Product/service codes, e.g. D399, J065, R425. Any of them matches.

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

Leave empty for all types. Use Solicitation + Combined Synopsis for open bids, Sources Sought for early opportunities, Award Notice for competitor research.

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

Small-business programs (8(a), HUBZone, SDVOSB, WOSB...). Leave empty for all.

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

2-letter state codes, e.g. VA, MD, DC, CA.

## `agencyIds` (type: `array`):

SAM.gov organization IDs, e.g. 100000000 = Department of Defense. The ID is in the agency link on sam.gov.

## `updatedWithinDays` (type: `integer`):

Only notices posted or modified in the last N days. 0 = any time.

## `deadlineWithinDays` (type: `integer`):

Only notices whose response is due between today and N days from now. 0 = any deadline.

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

Off = archived/inactive notices (e.g. past awards for market research).

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

List public attachments (RFP, SOW, drawings) with direct download links.

## `maxResultsPerSearch` (type: `integer`):

Per keyword. 0 = no limit (SAM.gov returns at most 10,000 per search).

## `maxTotalResults` (type: `integer`):

Stop the run after this many notices. 0 = no limit.

## `maxRunSeconds` (type: `integer`):

Soft time limit. 0 = no limit.

## `onlyNewOrUpdated` (type: `boolean`):

Remembers what earlier runs of the same search saw (in your account) and returns only new notices and notices modified since then, flagging moved deadlines. Schedule it daily for bid alerts.

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

Optional. Keep separate alert memories for the same search.

## `deduplicateAcrossSearches` (type: `boolean`):

Return and charge each notice once even if several keywords find it.

## Actor input object example

```json
{
  "keywords": [
    "cybersecurity"
  ],
  "updatedWithinDays": 0,
  "deadlineWithinDays": 0,
  "activeOnly": true,
  "includeAttachments": true,
  "maxResultsPerSearch": 20,
  "maxTotalResults": 0,
  "maxRunSeconds": 0,
  "onlyNewOrUpdated": false,
  "deduplicateAcrossSearches": true
}
```

# Actor output Schema

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

Notices produced by the run.

## `runSummary` (type: `string`):

Charged notices, pages read per search, skipped notices and why each search stopped.

# 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"
    ],
    "maxResultsPerSearch": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("surefeed/sam-gov-scraper").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"],
    "maxResultsPerSearch": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("surefeed/sam-gov-scraper").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"
  ],
  "maxResultsPerSearch": 20
}' |
apify call surefeed/sam-gov-scraper --silent --output-dataset

```

## MCP server setup

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

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/D19HGE0bnqs9d421s/builds/Kb6ogFQIOMDH1MRiy/openapi.json
