# SAM.gov Contract Opportunities Scraper (`cblu/sam-gov-contract-opportunities-scraper`) Actor

Extract federal contract opportunities (RFPs, solicitations, sources sought, awards) from SAM.gov's official public data — with contracting officer emails and phones. Filter by keyword, NAICS, set-aside, agency, state, and dates. Pay per opportunity.

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

## Pricing

from $4.00 / 1,000 contract opportunities

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## SAM.gov Contract Opportunities Scraper — Federal RFPs, Solicitations & Contracting Officer Contacts

Extract **federal contract opportunities from SAM.gov** — solicitations, presolicitations, sources sought, combined synopses, special notices, and award notices — including the **contracting officer's name, email, and phone**. Filter by **keyword, NAICS code, set-aside, agency, place of performance, posting date, and response deadline**, and download clean JSON, CSV, or Excel.

This Actor reads the **official public data extract that SAM.gov itself publishes daily** (the same feed behind data.gov). No SAM.gov account, no API key, no rate limits, no login walls — and none of the breakage that plagues scrapers fighting SAM.gov's heavily protected website.

### What data do you get?

One result per notice:

| Field | Example |
|---|---|
| `noticeId` / `link` | Stable ID + direct SAM.gov URL |
| `title` | `Installation of an HVAC System into Building 1678` |
| `solicitationNumber` | `W50S7626QA006` |
| `department` / `subTier` / `office` | `DEPT OF DEFENSE` / `DEPT OF THE NAVY` / ... |
| `postedDate` / `archiveDate` | ISO dates |
| `type` / `baseType` | `Solicitation`, `Sources Sought`, `Award Notice`... |
| `setAsideCode` / `setAside` | `SBA` / Total Small Business Set-Aside (FAR 19.5) |
| `responseDeadline` | `2026-07-16T14:00:00-05:00` |
| `naicsCode` / `classificationCode` | `238220` / PSC code |
| `placeOfPerformance` | Street, city, state, ZIP, country |
| `primaryContact` / `secondaryContact` | **Name, email, phone** of the contracting officials |
| `award` | Award number, date, amount, awardee (award notices) |
| `description` | Full notice text |

### Use cases

- **Bid pipeline for government contractors** — schedule a daily run with your NAICS codes and `responseDueAfter` set to today, and wake up to every opportunity you can still bid on, with the contracting officer's email ready for questions and capability statements. Replaces $100–500/mo GovCon SaaS alerts.
- **Small-business set-aside hunting** — filter `setAsides` for `SBA`, `8A`, `WOSB`, `SDVOSBC`, or HUBZone opportunities in your state.
- **BD & market intelligence** — pull award notices (`noticeTypes: ["Award"]`, `activeOnly: false`) to see who wins what, at what amounts, in your niche.
- **Sources-sought early warning** — respond to `Sources Sought` notices to shape requirements before the RFP drops, the single highest-leverage move in GovCon.
- **AI agents / MCP** — a clean, filterable feed of every open federal solicitation for agent-driven bid/no-bid triage.

### How to use it

Everything still biddable in construction trades, small-business set-aside, in Texas or Florida:

```json
{
    "naicsCodes": ["236", "237", "238"],
    "setAsides": ["SBA"],
    "popStates": ["TX", "FL"],
    "postedAfter": "2026-06-01",
    "responseDueAfter": "2026-07-11",
    "maxResults": 1000
}
````

Keyword scan across all agencies:

```json
{
    "keyword": "cybersecurity",
    "postedAfter": "2026-06-15",
    "maxResults": 500
}
```

NAICS codes support prefixes (`54` = all professional services). Set `activeOnly` to `false` for historical/archived research. Setting `postedAfter` makes runs much faster — the newest-first scan stops once it passes your window. **You are only charged for records actually returned.**

### Pricing

Pay per result: one charge per contract opportunity extracted.

> Suggested store pricing (set in the Apify Console → Publication → Monetization):
>
> - `contract-opportunity` event: **$0.004 per record** ($4.00 per 1,000 opportunities)
>
> Rationale: comparable SAM.gov actors charge $0.001–$0.01 per record plus actor-start fees; the two highest-user incumbents (149 and 85 users) are rated 1.0★ or unrated. A daily NAICS-filtered pull of ~100 fresh opportunities costs about $0.40 — versus $1,200–6,000/yr for GovCon alert SaaS.

### Data source & freshness

Records come from SAM.gov's official **Contract Opportunities full data extract**, which the General Services Administration regenerates **every day** for public/data.gov consumption. It is the complete government-wide point of entry (GPE) dataset: every notice of proposed contract action over $25,000. Because the Actor streams the official file instead of scraping sam.gov pages, it cannot be blocked, captcha'd, or rate-limited, and it never misses notices.

### FAQ

**How fresh is the data?** The extract is regenerated daily by SAM.gov; a notice posted today typically appears in the next morning's file. Schedule daily runs for a continuous feed.

**Do I need a SAM.gov account or API key?** No. The public extract requires neither.

**Does it include attachments?** It includes every notice field plus links to the notice page. Attachment files themselves live behind the SAM.gov notice link.

**Can I get closed/archived notices?** Yes — set `activeOnly` to `false` and use the date filters. The extract carries the full multi-year notice history, including award data.

**Grants too?** This Actor covers contract opportunities. If you need grants.gov data, open an issue — it uses a similar public extract and can be added on request.

# Actor input Schema

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

Optional. Case-insensitive match against the notice title, solicitation number, and full description, e.g. <code>janitorial</code>, <code>cybersecurity</code>, <code>drone</code>.

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

Optional. NAICS industry codes; prefixes work, e.g. <code>541511</code> (custom programming) or just <code>54</code> (all professional services). Leave empty for all industries.

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

Optional. Match against the notice type, e.g. <code>Solicitation</code>, <code>Presolicitation</code>, <code>Sources Sought</code>, <code>Combined Synopsis</code>, <code>Award Notice</code>, <code>Special Notice</code>. Case-insensitive substring match. Leave empty for all types.

## `setAsides` (type: `array`):

Optional. Small-business set-aside codes or label text, e.g. <code>SBA</code> (total small business), <code>8A</code>, <code>WOSB</code>, <code>SDVOSBC</code>, <code>HZC</code> (HUBZone). Leave empty for all notices including unrestricted.

## `agencyContains` (type: `array`):

Optional. Case-insensitive substring match against the department, sub-tier, and office, e.g. <code>VETERANS AFFAIRS</code>, <code>FOREST SERVICE</code>, <code>DEFENSE</code>.

## `popStates` (type: `array`):

Optional. Two-letter US state codes where the work will be performed, e.g. <code>TX</code>, <code>FL</code>. Leave empty for all locations.

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

Only return notices SAM.gov currently marks as active (not archived). Turn off for historical research and awards analysis.

## `postedAfter` (type: `string`):

Optional. Only return notices posted on/after this date (format <code>YYYY-MM-DD</code>). Also makes runs much faster - the scan stops once it is past this date.

## `postedBefore` (type: `string`):

Optional. Only return notices posted on/before this date (format <code>YYYY-MM-DD</code>).

## `responseDueAfter` (type: `string`):

Optional. Only return notices whose response deadline is on/after this date - set it to today to get only opportunities you can still bid on.

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

Include the notice's full description text on every record. Turn off for a lighter dataset.

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

Maximum number of opportunities to return. You are only charged for records actually returned.

## Actor input object example

```json
{
  "keyword": "cybersecurity",
  "naicsCodes": [],
  "noticeTypes": [],
  "setAsides": [],
  "agencyContains": [],
  "popStates": [],
  "activeOnly": true,
  "includeDescription": true,
  "maxResults": 500
}
```

# 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": "cybersecurity",
    "maxResults": 500
};

// Run the Actor and wait for it to finish
const run = await client.actor("cblu/sam-gov-contract-opportunities-scraper").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": "cybersecurity",
    "maxResults": 500,
}

# Run the Actor and wait for it to finish
run = client.actor("cblu/sam-gov-contract-opportunities-scraper").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": "cybersecurity",
  "maxResults": 500
}' |
apify call cblu/sam-gov-contract-opportunities-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "SAM.gov Contract Opportunities Scraper",
        "description": "Extract federal contract opportunities (RFPs, solicitations, sources sought, awards) from SAM.gov's official public data — with contracting officer emails and phones. Filter by keyword, NAICS, set-aside, agency, state, and dates. Pay per opportunity.",
        "version": "0.1",
        "x-build-id": "alpk4ZHqXiNUYNHkP"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/cblu~sam-gov-contract-opportunities-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-cblu-sam-gov-contract-opportunities-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/cblu~sam-gov-contract-opportunities-scraper/runs": {
            "post": {
                "operationId": "runs-sync-cblu-sam-gov-contract-opportunities-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/cblu~sam-gov-contract-opportunities-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-cblu-sam-gov-contract-opportunities-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "keyword": {
                        "title": "Keyword",
                        "type": "string",
                        "description": "Optional. Case-insensitive match against the notice title, solicitation number, and full description, e.g. <code>janitorial</code>, <code>cybersecurity</code>, <code>drone</code>."
                    },
                    "naicsCodes": {
                        "title": "NAICS codes",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Optional. NAICS industry codes; prefixes work, e.g. <code>541511</code> (custom programming) or just <code>54</code> (all professional services). Leave empty for all industries.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "noticeTypes": {
                        "title": "Notice types",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Optional. Match against the notice type, e.g. <code>Solicitation</code>, <code>Presolicitation</code>, <code>Sources Sought</code>, <code>Combined Synopsis</code>, <code>Award Notice</code>, <code>Special Notice</code>. Case-insensitive substring match. Leave empty for all types.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "setAsides": {
                        "title": "Set-asides",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Optional. Small-business set-aside codes or label text, e.g. <code>SBA</code> (total small business), <code>8A</code>, <code>WOSB</code>, <code>SDVOSBC</code>, <code>HZC</code> (HUBZone). Leave empty for all notices including unrestricted.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "agencyContains": {
                        "title": "Agency contains",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Optional. Case-insensitive substring match against the department, sub-tier, and office, e.g. <code>VETERANS AFFAIRS</code>, <code>FOREST SERVICE</code>, <code>DEFENSE</code>.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "popStates": {
                        "title": "Place of performance states",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Optional. Two-letter US state codes where the work will be performed, e.g. <code>TX</code>, <code>FL</code>. Leave empty for all locations.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "activeOnly": {
                        "title": "Active notices only",
                        "type": "boolean",
                        "description": "Only return notices SAM.gov currently marks as active (not archived). Turn off for historical research and awards analysis.",
                        "default": true
                    },
                    "postedAfter": {
                        "title": "Posted after",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                        "type": "string",
                        "description": "Optional. Only return notices posted on/after this date (format <code>YYYY-MM-DD</code>). Also makes runs much faster - the scan stops once it is past this date."
                    },
                    "postedBefore": {
                        "title": "Posted before",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                        "type": "string",
                        "description": "Optional. Only return notices posted on/before this date (format <code>YYYY-MM-DD</code>)."
                    },
                    "responseDueAfter": {
                        "title": "Response deadline after",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                        "type": "string",
                        "description": "Optional. Only return notices whose response deadline is on/after this date - set it to today to get only opportunities you can still bid on."
                    },
                    "includeDescription": {
                        "title": "Include full description",
                        "type": "boolean",
                        "description": "Include the notice's full description text on every record. Turn off for a lighter dataset.",
                        "default": true
                    },
                    "maxResults": {
                        "title": "Max results",
                        "minimum": 1,
                        "maximum": 500000,
                        "type": "integer",
                        "description": "Maximum number of opportunities to return. You are only charged for records actually returned.",
                        "default": 500
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
