# 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:** 3 total users, 1 monthly users, 81.6% 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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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.

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

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "SAM.gov Federal Contract Opportunity Alert",
        "description": "Get alerted to new US federal contract opportunities matching your NAICS, agency, keyword, and set-aside filters — from the official SAM.gov registry.",
        "version": "0.1",
        "x-build-id": "ZGPlbkwQjdbLnT5L0"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/scrapebench~samgov-opportunity-alert/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-scrapebench-samgov-opportunity-alert",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/scrapebench~samgov-opportunity-alert/runs": {
            "post": {
                "operationId": "runs-sync-scrapebench-samgov-opportunity-alert",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/scrapebench~samgov-opportunity-alert/run-sync": {
            "post": {
                "operationId": "run-sync-scrapebench-samgov-opportunity-alert",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "naicsCodes": {
                        "title": "NAICS codes",
                        "type": "array",
                        "description": "Industry codes to match (e.g. '541512'). Leave empty to match any industry.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "keyword": {
                        "title": "Title keyword",
                        "type": "string",
                        "description": "Free-text match on the opportunity title (e.g. 'cybersecurity')."
                    },
                    "agency": {
                        "title": "Agency / department",
                        "type": "string",
                        "description": "Buying department name (e.g. 'GENERAL SERVICES ADMINISTRATION')."
                    },
                    "setAside": {
                        "title": "Set-aside type",
                        "type": "string",
                        "description": "Set-aside code, e.g. SBA (small business), 8A, WOSB, SDVOSBC. Leave empty for all."
                    },
                    "lookbackDays": {
                        "title": "Look-back window (days)",
                        "minimum": 1,
                        "maximum": 365,
                        "type": "integer",
                        "description": "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.",
                        "default": 1
                    },
                    "maxResults": {
                        "title": "Maximum results",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Cap on opportunities fetched per run.",
                        "default": 100
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
