# SAM.gov Contract Bid Finder (`publicrecords-lab/sam-gov-bid-finder`) Actor

Find new U.S. federal contract opportunities from SAM.gov by keyword, NAICS, set-aside, agency, state and deadline. Official public daily data, no API key, no 10-requests/day limit. Monitor mode returns only bids you haven't seen.

- **URL**: https://apify.com/publicrecords-lab/sam-gov-bid-finder.md
- **Developed by:** [Alejandro G Pereda](https://apify.com/publicrecords-lab) (community)
- **Categories:** Lead generation, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 bid returneds

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 Bid Finder — federal opportunities by keyword, NAICS & set-aside

Find U.S. federal contract opportunities posted on **SAM.gov** and get them as clean, ready-to-use rows: title, agency, notice type, deadline, NAICS, PSC, set-aside, place of performance, contracting officer contacts and a direct SAM.gov link.

- ✅ **Official public data** — reads SAM.gov's own daily *Contract Opportunities* public data extract. No scraping of the website.
- ✅ **No SAM.gov account or API key** — and no 10-requests-per-day API quota to run into.
- ✅ **Monitor mode** — schedule it daily and get **only bids you haven't seen before**.
- ✅ **Cheap and fast** — searches of the last 1–30 days read only the newest part of the file and typically finish in well under a minute.
- ✅ **AI-agent friendly** — flat JSON with stable field names; works from the Apify API, MCP server, Make, Zapier, n8n and Google Sheets.

### Who is this for?

- **Small businesses and GovCon BD teams** who want a daily list of new bids in their NAICS codes and set-aside categories (8(a), HUBZone, SDVOSB, WOSB, small business).
- **Proposal consultants and capture managers** tracking several clients' saved searches.
- **Developers and AI agents** that need structured federal opportunity data without managing SAM.gov API keys.

### What you get (output)

Each result is one opportunity:

| Field | Example |
|---|---|
| `title` | S201--Janitorial Services for Richmond National Cemetery |
| `noticeType` | Combined Synopsis/Solicitation |
| `agency` / `subTier` / `office` | VETERANS AFFAIRS, DEPARTMENT OF / … / NATIONAL CEMETERY ADMIN |
| `postedDate` | 2026-11-02 |
| `responseDeadline` / `daysUntilDeadline` | 2026-11-23T16:00:00-05:00 / 12 |
| `naicsCode` / `pscCode` | 561720 / S201 |
| `setAsideCode` / `setAside` | SDVOSBC / Service-Disabled Veteran-Owned Small Business (SDVOSB) Set-Aside |
| `placeOfPerformanceCity/State/Zip` | Richmond / VA / 23231 |
| `primaryContactName/Email/Phone` | Contracting officer listed on the notice |
| `url` | https://sam.gov/opp/…/view |
| `matchedKeywords` | \["janitorial"] |
| `description` | Plain-text notice description (trimmed to 2,000 characters by default) |

Award notices (who won) are available too: `awardNumber`, `awardDate`, `awardAmount`, `awardee` — turn on **Include award notices**.

Download as JSON, CSV, Excel or HTML, or read the dataset via API.

### How to use it

1. Enter **Keywords** (e.g. `cybersecurity`, `janitorial`) and/or **NAICS codes** (prefixes like `5415` work).
2. Optionally pick **Set-aside types**, **Agencies**, **States**, **Notice types** and a **response deadline** window.
3. Choose **Posted within the last N days** (default 7).
4. Click **Start**. Results appear in the *Bids* table view; contacts have their own view.

#### Daily alerts of new bids only

Turn on **Only new since last run**, then add a **Schedule** (e.g. every morning). Each run outputs just the notices that this saved search hasn't returned before. The memory is kept in a named key-value store in *your* Apify account (`sam-gov-bid-finder-state` by default). Give each saved search its own **Monitor ID** if you run several. Connect the run to email, Slack, Google Sheets or a webhook through Apify integrations.

#### Example input

```json
{
  "keywords": ["cybersecurity", "zero trust"],
  "naicsCodes": ["5415"],
  "setAsideCodes": ["SBA", "SDVOSBC"],
  "postedWithinDays": 7,
  "onlyOpenForResponses": true,
  "onlyNew": true,
  "maxResults": 200
}
```

### Pricing

Pay per event — you pay only for what you get:

| Event | Price |
|---|---|
| Search run (once per run) | $0.005 |
| Bid returned (per result) | $0.003 |
| Full-file scan (only when *Posted within* is 0 or more than 30 days) | $0.02 |

Example: a daily 7-day search that returns 40 new bids costs $0.005 + 40 × $0.003 = **$0.125**. A monitor run with no new bids costs **$0.005**. Use **Max results** (and Apify's maximum cost per run) to cap spending.

### Data source, freshness and limits

- Source: SAM.gov Data Services public extract `ContractOpportunitiesFullCSV.csv` (U.S. General Services Administration). It contains currently active notices and is **regenerated once a day**, so a notice posted today usually appears the next day. `sourceExtractDate` on each row shows which file version was used.
- Attachments and amendment history are not included in the public extract; use the `url` to open the notice on SAM.gov.
- Keyword matching is a case-insensitive substring match on the title and (optionally) the description.
- Notices without a NAICS code, state or deadline are excluded when you filter on that field.

### FAQ

**Do I need a SAM.gov login or API key?** No.

**Is this legal / allowed?** Yes. It only reads the public data file that SAM.gov publishes for download without login. SAM.gov data is U.S. government information. Contact details are those published on the notices for vendor questions. Please follow SAM.gov guidance and don't use them for spam.

**How is this different from the SAM.gov API?** The API needs a personal key and allows non-federal users without a SAM role only 10 requests per day. This Actor has no such quota and adds filters SAM.gov's saved searches don't (multiple keywords with any/all, exclusions, deadline windows, "only new").

**Is this affiliated with SAM.gov or GSA?** No. It is an independent tool that uses public government data.

### Feedback

Found a bug or need a field or filter? Open an issue on the Actor's **Issues** tab. We usually respond within a couple of days.

# Actor input Schema

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

Words or phrases to look for in the title (and description, if enabled). Case-insensitive substring match. Leave empty to match everything that passes the other filters.

## `keywordMode` (type: `string`):

'any' = at least one keyword must match; 'all' = every keyword must match.

## `searchInDescription` (type: `boolean`):

If off, keywords are matched against the title only (fewer, more precise results).

## `excludeKeywords` (type: `array`):

Drop opportunities whose title/description contains any of these.

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

Full or partial NAICS codes. '5415' matches 541511, 541512, 541519 ... Notices without a NAICS code are excluded when this is set.

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

Product Service Codes, full or prefix (e.g. 'D3' for IT services, 'R4' for professional services).

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

Only return opportunities with one of these set-aside codes. Leave empty for any (including unrestricted).

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

Case-insensitive text matched against department, sub-tier and office, e.g. 'VETERANS AFFAIRS', 'AIR FORCE', 'NASA'.

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

Two-letter state codes, e.g. 'VA', 'TX'. Notices without a place-of-performance state are excluded when this is set.

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

Limit to these notice types. Leave empty for all (award notices are controlled separately below).

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

Only notices posted in this window. 1-30 days reads only the newest part of the file (cheapest). Set 0 or more than 30 to scan the whole active file (adds the full-file-scan charge).

## `responseDeadlineFrom` (type: `string`):

Earliest response deadline, YYYY-MM-DD or relative like '3 days' (from today). Notices without a deadline are excluded when any deadline filter is set.

## `responseDeadlineTo` (type: `string`):

Latest response deadline, YYYY-MM-DD or relative like '45 days'.

## `onlyOpenForResponses` (type: `boolean`):

Drop notices whose response deadline has passed or that have no deadline.

## `includeAwardNotices` (type: `boolean`):

Award notices tell you who won, not what you can bid on. Off by default.

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

Remember which notices this search already returned (in a named key-value store in your account) and output only new ones. Ideal with a daily schedule.

## `monitorId` (type: `string`):

Optional name for this saved search's memory. Defaults to an ID derived from your filters, so changing filters starts a fresh memory. Use the same ID across runs/tasks to share memory.

## `stateStoreName` (type: `string`):

Named key-value store used for monitor memory.

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

Stop after this many bids. Caps your cost per run.

## `includeDescription` (type: `boolean`):

Plain-text notice description from SAM.gov.

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

Trim long descriptions. 0 = full text.

## Actor input object example

```json
{
  "keywords": [
    "cybersecurity"
  ],
  "keywordMode": "any",
  "searchInDescription": true,
  "postedWithinDays": 7,
  "onlyOpenForResponses": false,
  "includeAwardNotices": false,
  "onlyNew": false,
  "stateStoreName": "sam-gov-bid-finder-state",
  "maxResults": 500,
  "includeDescription": true,
  "descriptionMaxChars": 2000
}
```

# Actor output Schema

## `bids` (type: `string`):

Matching contract opportunities. Fields are described in the dataset schema.

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

JSON with counts (output, scanned, matched, already-seen), MB read, and SAM.gov extract date.

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

// Run the Actor and wait for it to finish
const run = await client.actor("publicrecords-lab/sam-gov-bid-finder").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": ["cybersecurity"] }

# Run the Actor and wait for it to finish
run = client.actor("publicrecords-lab/sam-gov-bid-finder").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": [
    "cybersecurity"
  ]
}' |
apify call publicrecords-lab/sam-gov-bid-finder --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,publicrecords-lab/sam-gov-bid-finder"
        }
    }
}
```

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/0AeBygEiM9PlLPYnw/builds/fKVtZpiuv9pNujvxs/openapi.json
