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

Federal contract opportunities from SAM.gov's official public data: solicitations, sources sought, presolicitations, awards. Filter by NAICS, PSC, set-aside, state, agency, keywords; daily new-only alerts. No API key required.

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

## Pricing

from $2.00 / 1,000 contract opportunity notices

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 Opportunities & Bid Alerts

Get **federal contract opportunities from SAM.gov** as clean JSON, CSV or Excel: solicitations, combined synopsis/solicitations, sources sought, presolicitations, special notices and award notices. Filter by **NAICS code, PSC code, set-aside (SBA, 8(a), SDVOSB, WOSB, HUBZone), place-of-performance state, agency and keywords**. Turn on **"Only new since last run"** and schedule it daily to get a **government bid alert feed**.

**No SAM.gov API key and no login needed.** By default the Actor reads the **official SAM.gov Contract Opportunities public data extract** that GSA publishes daily (all active notices). It does not scrape the SAM.gov website. If you have your own free SAM.gov public API key, you can add it to query the live Get Opportunities API v2 instead.

### What you can do with it

- **GovCon lead generation:** daily list of new solicitations in your NAICS codes, with contracting officer name, email and phone.
- **Bid/no-bid pipeline:** only notices still open for response, sorted into your CRM, Google Sheets or Slack via Apify integrations.
- **Small business set-aside tracking:** SBA, 8(a), SDVOSB, WOSB, EDWOSB and HUBZone opportunities.
- **Competitive intel:** award notices with awardee, award number and award amount.
- **Market research:** which agencies buy what, where (place of performance), and how often.

### Input examples

New open IT solicitations from the last 3 days:

```json
{"postedWithinDays": 3, "naicsCodes": ["5415"], "noticeTypes": ["Solicitation", "Combined Synopsis/Solicitation"], "openForResponseOnly": true}
```

Daily alert for Service-Disabled Veteran-Owned set-asides in Virginia (schedule it daily):

```json
{"postedWithinDays": 7, "setAsideCodes": ["SDVOSBC"], "placeOfPerformanceStates": ["VA"], "onlyNewSinceLastRun": true, "alertStateName": "sdvosb-va"}
```

Keyword search (whole words or phrases, title and description):

```json
{"postedWithinDays": 14, "keywords": ["cybersecurity", "zero trust"], "agencyContains": "HOMELAND SECURITY"}
```

### Output (one item per notice)

`noticeId, title, solicitationNumber, agency, subTier, office, officeCode, postedDate, noticeType, baseType, setAsideCode, setAside, responseDeadline, naicsCode, pscCode, placeOfPerformance{street, city, state, zip, country}, officeAddress, active, archiveDate, award{number, date, amount, awardee}, contacts[{type, title, fullName, email, phone, fax}], description (trimmed, configurable), additionalInfoLink, url, source, retrievedAt`

See `samples/` for real output from a local run.

### Freshness and limits

- Default source: GSA's daily public extract (`ContractOpportunitiesFullCSV.csv` on the official `falextracts` bucket linked from SAM.gov Data Services). It is refreshed once a day, so notices posted today usually appear the next day. A run takes seconds.
- With your own `samApiKey`, the Actor uses `api.sam.gov/opportunities/v2/search` (postedFrom/postedTo, at most a 1-year range). Daily request limits depend on your SAM.gov account role. Full descriptions are API links that need your key, so they are not downloaded per notice.
- Set-aside codes come from SAM.gov as-is (e.g. `SBA`, `8A`, `SDVOSBC`, `WOSB`, `HZC`, `EDWOSB`).

### Pricing

Pay per result: you pay only for notices delivered to your dataset. Use **Max results** to cap spending.

### Legal

Data is US federal government public information published by GSA. This Actor is not affiliated with or endorsed by GSA or SAM.gov. Always confirm details on the official notice (`url`) before bidding.

# Actor input Schema

## `postedWithinDays` (type: `integer`):

Used when 'Posted from' is empty.

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

Optional explicit start date.

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

Optional end date.

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

Match any keyword in the title (and description if enabled), case-insensitive.

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

Also match keywords against the notice description.

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

E.g. 541511 or 5415 (prefix match).

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

E.g. DA01 or D (prefix match).

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

E.g. SBA, 8A, SDVOSBC, WOSB, HZC, EDWOSB, VSA.

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

Leave empty for all.

## `placeOfPerformanceStates` (type: `array`):

Two-letter codes, e.g. VA, TX.

## `agencyContains` (type: `string`):

E.g. VETERANS AFFAIRS or ARMY.

## `openForResponseOnly` (type: `boolean`):

Requires a response deadline on or after today.

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

Exclude archived notices.

## `onlyNewSinceLastRun` (type: `boolean`):

Remembers notice IDs already delivered (per alert name) so scheduled runs return only new notices.

## `alertStateName` (type: `string`):

Separate memory for each saved search when using 'Only new since last run'.

## `descriptionMaxChars` (type: `integer`):

0 drops descriptions.

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

You are charged per notice delivered.

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

Optional. With your own free SAM.gov public API key the Actor queries the live API instead of the daily extract (subject to your key's daily limit).

## Actor input object example

```json
{
  "postedWithinDays": 3,
  "keywords": [
    "software"
  ],
  "searchDescription": true,
  "openForResponseOnly": false,
  "activeOnly": true,
  "onlyNewSinceLastRun": false,
  "alertStateName": "default",
  "descriptionMaxChars": 2000,
  "maxResults": 500
}
```

# Actor output Schema

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

SAM.gov contract opportunity notices matching the filters, one item per notice. Opens the Overview view by default; the dataset contains all fields.

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

JSON record with counts for this run (RUN_SUMMARY in the default key-value store).

# 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": [
        "software"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("clever_firebox/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 = { "keywords": ["software"] }

# Run the Actor and wait for it to finish
run = client.actor("clever_firebox/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 '{
  "keywords": [
    "software"
  ]
}' |
apify call clever_firebox/sam-gov-opportunities --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,clever_firebox/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/FYUwt3NqNtkpElZS8/builds/xcf7ew4Sv4IyVezPP/openapi.json
