# SAM.gov Scraper — Federal Contract Opportunities & Bid Alerts (`rhymed_santolina/sam-gov-opportunities`) Actor

Get daily SAM.gov bid alerts for your NAICS code, set-aside or state. Pulls new federal contract opportunities (solicitations, sources sought, awards) from the official SAM.gov API with your free key; returns only new notices each run. No login, no scraping. Part of the Arachne toolkit.

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

## Pricing

from $5.00 / 1,000 results

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 Scraper: Federal Contract Opportunities & Bid Alerts

Get **daily SAM.gov bid alerts for your NAICS code**, with no more manual searching. Each morning you get only the *new* federal opportunities that match your NAICS, set-aside (SBA, 8(a), WOSB, SDVOSB, HUBZone), agency or state, straight from the **official SAM.gov API**.

**Use it to:**

- 🔔 **Get daily bid alerts for small businesses.** For example, `naicsCode: "541511"`, `setAsideCode: "SBA"`, scheduled daily and sent to email or Slack.
- 🧭 **Run a capture or BD pipeline.** Spot sources-sought and presolicitation notices early, before the RFP drops.
- 🏆 **Research competitors and awards.** Track award notices with awardee names and amounts.
- 📊 **Feed CRMs and Google Sheets** with Apify integrations, Make or Zapier.

**Why this Actor:** it uses the official API, so nothing breaks when the website changes. It handles paging and SAM.gov's daily limits, removes contact-person details, and charges only for new results.

### You need a free SAM.gov API key

1. Sign in at [sam.gov](https://sam.gov), open **Account Details** and request a **Public API Key**.
2. Paste the key into the `samApiKey` input. It's stored as a secret.

SAM.gov sets your daily request limit based on your account role. Each run uses roughly one request per 1,000 results.

### Example inputs

Small-business IT work in Texas, last 3 days, new only:

```json
{ "samApiKey": "YOUR_KEY", "naicsCode": "541511", "setAsideCode": "SBA", "state": "TX", "lookbackDays": 3 }
```

Solicitations and combined synopses mentioning "cybersecurity", kept separate from other saved searches:

```json
{ "samApiKey": "YOUR_KEY", "noticeTypes": ["o", "k"], "keywords": ["cybersecurity"], "stateKey": "cyber" }
```

8(a) IT work in Virginia:

```json
{"samApiKey": "YOUR_KEY", "naicsCode": "541512", "setAsideCode": "8A", "state": "VA"}
```

Last week's award notices (competitor and award research):

```json
{"samApiKey": "YOUR_KEY", "noticeTypes": ["a"], "lookbackDays": 7, "stateKey": "awards"}
```

### Output (one row per opportunity)

`noticeId, title, solicitationNumber, agencyPath, noticeType, postedDate, responseDeadline, naicsCode, classificationCode, setAside, placeOfPerformanceCity/State/Country, officeCity/State, awardAmount, awardDate, awardeeName, descriptionUrl, url, isNew`

Individual point-of-contact details (names, emails, phones) are **intentionally left out**. Use the SAM.gov link to see them.

### Scheduling

Create a Schedule (for example daily at 07:00) with the same input. Keep the same `stateKey` so the Actor remembers what it has already returned.

### Pricing (pay per event)

- $0.005 per run start. This is charged only after SAM.gov accepts the request.
- $0.005 per opportunity returned.

You can cap your spend with `maxResults` or the platform's "Max total charge".

### Notes

- SAM.gov answers **404 (no data)** both for empty searches and for invalid keys. If you get 0 results unexpectedly, check your key.
- The posted-date range is limited to 1 year (`lookbackDays` max 365).
- Results are paged 1,000 per request (`pageSize`, advanced), so large searches return everything up to `maxResults`.

### More Arachne tools

- [UK Tenders Scraper — Contracts Finder & Find a Tender Alerts](https://apify.com/rhymed_santolina/uk-tenders): New UK public-sector tenders and awards from Contracts Finder and Find a Tender in one feed.
- [EU TED Tenders Scraper — Public Procurement Notices & Alerts](https://apify.com/rhymed_santolina/ted-eu-tenders): New EU public procurement notices from TED (Tenders Electronic Daily), filtered by country, CPV and keyword.
- [CanadaBuys Scraper — Canada Government Tenders & Bid Alerts](https://apify.com/rhymed_santolina/canadabuys-tenders): New Government of Canada tenders from CanadaBuys open data, filtered by category, UNSPSC and region.
- [AusTender Scraper — Australian Government Contracts & Suppliers](https://apify.com/rhymed_santolina/austender-contracts): Australian Government contract notices from AusTender with agency, supplier, value and UNSPSC.
- [Grants.gov Scraper — Federal Grant Opportunities & Alerts](https://apify.com/rhymed_santolina/grants-gov-opportunities): New US federal grant opportunities from Grants.gov with funding, eligibility and deadlines.
- [SEC Form D Scraper — Startup Funding & Private Placement Alerts](https://apify.com/rhymed_santolina/sec-form-d-funding-alerts): New SEC Form D filings (startup funding and private placements) from official EDGAR data.
- [Domain Expiry Checker — RDAP Domain Expiration & Status Monitor](https://apify.com/rhymed_santolina/domain-rdap-expiry-monitor): Bulk domain expiry, registrar and status checks via official RDAP, with alerts for soon-to-expire domains.

***

🕸️ **Part of the Arachne toolkit:** official open-data feeds turned into clean, ready-to-use datasets. More Arachne Actors: [apify.com/rhymed_santolina](https://apify.com/rhymed_santolina).

# Actor input Schema

## `samApiKey` (type: `string`):

Needed to get results: your own free SAM.gov public API key (sign in at sam.gov > Account Details > Public API Key). Without it the run ends with 0 results and instructions.

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

How many days of notices to scan each run.

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

Only return notices whose text contains any of these words (case-insensitive). Empty = all.

## `onlyNew` (type: `boolean`):

Skip notices already returned by a previous run with the same State key.

## `stateKey` (type: `string`):

Name for the 'seen' memory. Use different keys for different saved searches.

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

Stop after this many results (caps your cost).

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

SAM ptype codes: o=Solicitation, p=Presolicitation, k=Combined synopsis/solicitation, r=Sources sought, s=Special notice, a=Award, u=J\&A, g=Sale of surplus, i=Intent to bundle.

## `naicsCode` (type: `string`):

e.g. 541511

## `setAsideCode` (type: `string`):

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

## `state` (type: `string`):

Two-letter code, e.g. TX

## `titleQuery` (type: `string`):

Title contains (server-side).

## `organizationName` (type: `string`):

Agency / organization name.

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

Active notices only.

## `pageSize` (type: `integer`):

Records per SAM.gov API request (max 1000). Keep 1000 to use the fewest requests against your SAM.gov daily quota.

## Actor input object example

```json
{
  "lookbackDays": 3,
  "onlyNew": true,
  "stateKey": "default",
  "maxResults": 20,
  "naicsCode": "541511",
  "activeOnly": true,
  "pageSize": 1000
}
```

# Actor output Schema

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

SAM.gov opportunities returned by this run (only new ones when onlyNew=true).

# 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 = {
    "samApiKey": "",
    "lookbackDays": 3,
    "maxResults": 20,
    "naicsCode": "541511"
};

// Run the Actor and wait for it to finish
const run = await client.actor("rhymed_santolina/sam-gov-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 = {
    "samApiKey": "",
    "lookbackDays": 3,
    "maxResults": 20,
    "naicsCode": "541511",
}

# Run the Actor and wait for it to finish
run = client.actor("rhymed_santolina/sam-gov-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 '{
  "samApiKey": "",
  "lookbackDays": 3,
  "maxResults": 20,
  "naicsCode": "541511"
}' |
apify call rhymed_santolina/sam-gov-opportunities --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,rhymed_santolina/sam-gov-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/WpfCDnyTXoctWDGdF/builds/2IVPLfXfsXQIC7J9M/openapi.json
