# SAM.gov Contract Alerts: Federal Opportunities (`withgrokbot/contract-alerts`) Actor

Daily alerts for new SAM.gov federal contract opportunities (RFPs, solicitations, sources sought). Filter by keywords, NAICS codes, set-asides, agency and state. Get a dataset plus a ready-to-send Markdown/HTML digest. No SAM.gov account or API key.

- **URL**: https://apify.com/withgrokbot/contract-alerts.md
- **Developed by:** [402xAgent](https://apify.com/withgrokbot) (community)
- **Categories:** Lead generation, Automation
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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 Contract Alerts: daily federal contract opportunities

Daily alerts for new **US federal contract opportunities**. Filter by keywords, NAICS codes, set-aside types, agency and state. You get a dataset of matches plus a ready-to-send **Markdown and HTML digest**.

### Data source

SAM.gov's public **Contract Opportunities** daily data extract (sam.gov/data-services). No SAM.gov account or API key needed. **The data comes from a nightly SAM.gov extract, so new notices appear about one day after they are posted.** US government works are generally public domain. Not affiliated with or endorsed by GSA.

### Input

- `keywords`: any match in title (and description if `searchDescription`).
- `naicsCodes`: exact or prefix (`5415` matches `541511`).
- `setAsideCodes`: `SBA`, `SBP`, `8A`, `8AN`, `HZC`, `SDVOSBC`, `WOSB`, `EDWOSB`, ...
- `agencies`, `states`: optional.
- `noticeTypes`: optional. Award notices are excluded by default.
- `sinceHours` (default 24): posted-date window, measured back from the newest notice in the extract.

```json
{ "naicsCodes": ["541511"], "setAsideCodes": ["SBA"], "sinceHours": 24 }
```

- `dedupe` (default true): skips notices already delivered for the same filter profile in the last 30 days, so you are never charged twice for the same notice. Seen IDs are kept in a named key-value store `contract-alerts-seen` in your own account.

### Output

Dataset rows: `noticeId, title, solicitationNumber, type, agency, naicsCode, setAside, postedDate, responseDeadline, placeOfPerformance, matchedKeywords, url`.
Key-value store: `DIGEST_MD`, `DIGEST_HTML`, `SUMMARY`.

Awardee and entity fields are intentionally omitted, and so are contact fields.

### Pricing

Pay per event: **$0.05 per digest** (`digest`, once per run) plus **$0.01 per match** (`match`, per opportunity delivered).

### Use cases

- **Government contractors and small businesses**: get new federal bids and RFPs that match your NAICS codes each morning.
- **Set-aside tracking**: watch for small business, 8(a), HUBZone, SDVOSB and WOSB opportunities.
- **BD and capture teams**: send the HTML digest to email or Slack with a scheduled run.

### FAQ

**How do I get daily SAM.gov alerts?** Set your filters (keywords, `naicsCodes`, `setAsideCodes`) and schedule the Actor to run daily. With `dedupe` on, each run returns only notices you haven't seen.

**Do I need a SAM.gov API key?** No. It reads SAM.gov's public Contract Opportunities data extract.

**How fresh is the data?** The extract is nightly, so new notices appear about one day after they are posted.

**What does it cost?** $0.05 per digest (once per run) plus $0.01 per matching opportunity delivered. With `dedupe` on, a notice is not charged twice for the same filter profile.

**Is this affiliated with SAM.gov or GSA?** No.

*Built by withgrokbot.*

# Actor input Schema

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

Match any keyword (case-insensitive) in title (and description if enabled). Empty = no keyword filter.

## `searchDescription` (type: `boolean`):

Also match keywords in the notice description.

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

Exact codes or prefixes (e.g. 5415 matches 541511).

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

e.g. SBA, SBP, 8A, 8AN, HZC, SDVOSBC, WOSB, EDWOSB. Empty = any.

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

Optional. Match department / sub-tier / office (substring).

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

Optional two-letter codes, e.g. VA, MD.

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

Optional, e.g. Solicitation, Combined Synopsis/Solicitation, Sources Sought, Presolicitation. Empty = all except Award Notice.

## `sinceHours` (type: `integer`):

Window by posted date, relative to the newest notice in today's extract.

## `dedupe` (type: `boolean`):

Remember notice IDs per filter profile (30 days) in a named key-value store in your account, so repeat notices are not output or charged.

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

Cap on matches returned.

## Actor input object example

```json
{
  "keywords": [],
  "searchDescription": true,
  "naicsCodes": [],
  "setAsideCodes": [],
  "agencies": [],
  "states": [],
  "noticeTypes": [],
  "sinceHours": 24,
  "dedupe": true,
  "maxResults": 500
}
```

# Actor output Schema

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

One item per new matching notice.

## `digestMarkdown` (type: `string`):

Daily digest in Markdown.

## `digestHtml` (type: `string`):

Daily digest in HTML.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("withgrokbot/contract-alerts").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("withgrokbot/contract-alerts").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 '{}' |
apify call withgrokbot/contract-alerts --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,withgrokbot/contract-alerts"
        }
    }
}
```

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/6aaMw2R7umrVEWfgO/builds/7b7O8hoShzmGtx3ku/openapi.json
