# Federal Contract Opportunities Feed (SAM.gov) (`thoob/sam-opportunities-feed`) Actor

Clean, flat US federal contract opportunities from the official SAM.gov API, searchable by keyword, NAICS, notice type, set-aside, state, and agency, with a what-changed-since-last-run mode. Billed only per delivered opportunity. No API key needed.

- **URL**: https://apify.com/thoob/sam-opportunities-feed.md
- **Developed by:** [Pono Data](https://apify.com/thoob) (community)
- **Categories:** Lead generation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.00 / 1,000 opportunity records

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 web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## Federal Contract Opportunities Feed (SAM.gov)

Clean, flat US federal contract opportunities from the official SAM.gov Get
Opportunities API. Search by keyword, NAICS, notice type, set-aside, place-of-
performance state, and agency. Run it in full mode for every match, or in changes
mode to get only what is new since your last run. You are billed only for a
delivered opportunity row.

### What this collects

- What this collects: public US federal contract opportunities (solicitations,
  presolicitations, sources sought, combined synopses, award notices, and the
  other SAM notice types), exactly as the government posts them.
- Source: the official SAM.gov API. Public records only. No logins, no paywalls,
  no access bypass, no scraping of the site.
- Scope: United States federal opportunities. Every row is stamped jurisdiction=US.
- Billing: charged only on a delivered opportunity row. A run that matches nothing
  is free. Errors are logged to a free rejects dataset, never billed.
- Provenance: every row carries its SAM.gov source URL, the retrieval time, and a
  confidence of 1.0, because each value is copied verbatim from the SAM record.

### No API key needed

SAM.gov requires a key for this dataset. The actor supplies one, so there is
nothing to sign up for and nothing to paste. Start a run and you get rows.

If you would rather run under your own SAM.gov account and its own rate limit,
generate a Public API Key under Account Details at sam.gov and paste it into the
apiKey field; the run uses yours instead. Either way the key is stored as a
secret and never written to the dataset or the log.

### Why this one

- One price, charged only on a delivered row. Several actors in this lane add a
  flat per-run start fee on top of per-item, so a hundred small queries cost you in
  start fees before a single row. There is no start fee here.
- No guessing. Every field is copied from the SAM record and is verifiable at the
  source URL on the same row.
- A changes-only mode, so a daily run returns just the new opportunities, not the
  whole list again.

### Input

- apiKey: optional. Your own SAM.gov public API key, if you would rather use it
  than the one the actor supplies. Stored as a secret.
- keyword: optional title search.
- noticeType: optional, one notice type (Solicitation, Award Notice, Sources
  Sought, and so on).
- naics: optional NAICS industry code.
- state: optional two-letter place-of-performance state.
- setAside: optional set-aside code (for example SBA, SDVOSBC, WOSB, 8A).
- organizationName: optional contracting agency or office name.
- postedFrom / postedTo: the posted-date window in MM/DD/YYYY, at most one year
  wide. Defaults to the last 30 days.
- mode: full or changes.
- maxRecords, pageSize: delivery cap and page size.

### Output

One row per opportunity. A real sample from a live run on 2026-06-19:

| title | noticeType | department | naics | setAside | sourceUrl |
|---|---|---|---|---|---|
| Hex Jam Nuts | Combined Synopsis/Solicitation | DEPT OF DEFENSE | 332722 | Total Small Business Set-Aside (FAR 19.5) | [view](https://sam.gov/workspace/contract/opp/f29a122869e64fa19982e9655482f397/view) |
| Patient Ceiling Lift Slings Replacement | Sources Sought | VETERANS AFFAIRS, DEPARTMENT OF | 339113 | No Set aside used | [view](https://sam.gov/workspace/contract/opp/dedd02b3424a4149b2823ccee9a76082/view) |
| F--GREEN RIVER FIRE DRILL SEEDING PROJECT | Award Notice | INTERIOR, DEPARTMENT OF THE | 562910 |  | [view](https://sam.gov/workspace/contract/opp/d77e7598ba6d477eb61e0b06735b2f77/view) |

Each row also carries the solicitation number, the primary point of contact (name,
email, phone), the place of performance, award fields on an award notice, and the
posted, response-deadline, and archive dates. Open the source URL to verify any row
on SAM.gov.

# Actor input Schema

## `apiKey` (type: `string`):

Optional. The actor supplies a working key, so you can leave this blank. Pass your own to run against your own quota. Stored as a secret; never written to the dataset or logs.

## `keyword` (type: `string`):

Optional. Keep only opportunities whose title matches this text.

## `noticeType` (type: `string`):

Optional. Restrict to one procurement notice type.

## `naics` (type: `string`):

Optional. Restrict to a NAICS industry code (for example 541512).

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

Optional. Two-letter state code for the place of performance (for example CA, TX).

## `setAside` (type: `string`):

Optional. Set-aside code (for example SBA for Total Small Business, SDVOSBC, WOSB, 8A).

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

Optional. Restrict to a contracting organization by name.

## `postedFrom` (type: `string`):

Start of the posted-date window, MM/DD/YYYY. The API requires a window at most one year wide. Defaults to 30 days ago.

## `postedTo` (type: `string`):

End of the posted-date window, MM/DD/YYYY. Defaults to today.

## `mode` (type: `string`):

full returns every matching opportunity. changes returns only opportunities not seen in this account's prior runs.

## `maxRecords` (type: `integer`):

Cap on delivered, billed rows. 0 means no cap. The platform spend cap is honored regardless.

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

Records per API page (1 to 1000).

## Actor input object example

```json
{
  "keyword": "construction",
  "noticeType": "",
  "mode": "full",
  "maxRecords": 500,
  "pageSize": 100
}
```

# Actor output Schema

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

One row per matching federal contract opportunity.

# 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 = {
    "keyword": "construction",
    "naics": "",
    "state": "",
    "setAside": "",
    "organizationName": "",
    "postedFrom": "",
    "postedTo": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("thoob/sam-opportunities-feed").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 = {
    "keyword": "construction",
    "naics": "",
    "state": "",
    "setAside": "",
    "organizationName": "",
    "postedFrom": "",
    "postedTo": "",
}

# Run the Actor and wait for it to finish
run = client.actor("thoob/sam-opportunities-feed").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 '{
  "keyword": "construction",
  "naics": "",
  "state": "",
  "setAside": "",
  "organizationName": "",
  "postedFrom": "",
  "postedTo": ""
}' |
apify call thoob/sam-opportunities-feed --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=thoob/sam-opportunities-feed",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/K184Qus6EANwQZ8zN/builds/eHaFyLNyyePIHCFE1/openapi.json
