# SAM.gov Scraper: US Government Contract Opportunities (`zaiq/sam-gov-scraper`) Actor

U.S. federal contract opportunities from SAM.gov, without an account or API key: every notice for your keywords, NAICS codes, set-asides and states, with agency, deadline, NAICS, set-aside, place of performance, contracting officers' names, emails and phones, description, files and award amounts.

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

## Pricing

from $8.00 / 1,000 contract notices

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 with contacts, deadlines and awards (no API key)

Get **U.S. federal contract opportunities from SAM.gov without an account or API key**: every **solicitation, sources sought, presolicitation and award notice** for your **keywords, NAICS codes, set-asides and states**, with the **agency and contracting office**, the **response deadline**, **NAICS and product/service codes**, the **set-aside**, the **place of performance**, the **contracting officers' names, emails and phones**, the **full description**, the **attachments with direct download links** and, for awards, the **winner, UEI and amount**.

Built for **government contractors**, **capture and proposal teams**, **GovCon consultants** and **B2B sales teams** who want fresh federal bids in a sheet, CRM or Slack every morning. By default you get only notices **still open for responses**, which SAM.gov's own "active" filter does not give you.

### What you get

| Field | What it holds |
|---|---|
| Notice | `noticeId`, `title`, `noticeType`, `solicitationNumber`, `postedAt`, `updatedAt`, `responseDeadline`, `active`, `url` |
| Who is buying | `department`, `agency`, `office` (the contracting office), `placeOfPerformance` |
| What is bought | `naics`, `productServiceCode`, `setAside`, `description` (the full text) |
| Who to contact | `contacts`: name, email, phone, title and role (primary or secondary) |
| Awards | `award`: amount, date, contract number, awardee, UEI, city and state |
| Files | `files`: name, size, date posted and a direct download link (when asked) |

### What people use it for

- **Bid alerts:** a daily run for your NAICS codes and set-asides, sent to email, Slack or a sheet
- **Capture pipeline:** open solicitations and sources sought with their deadlines, for your bid/no-bid list
- **Contracting officer contacts:** the name, email and phone of the person running each buy
- **Competitor wins:** award notices with the winner, its UEI and the amount
- **Sales leads:** companies that just won federal contracts, for subcontracting, staffing, equipment or finance offers
- **Market research:** which agencies buy what, by NAICS code, set-aside and state

### How to use it

1. Enter **keywords** (or leave them empty) and pick filters: **NAICS codes**, **notice types**, **set-asides** and **states**.
2. Keep **Still open for responses** on for live bids; turn it off for awards and past notices.
3. Click **Start**. For alerts, schedule it daily with **Updated in the last N days** set to 1.

### Input

| Field | Example | Notes |
|---|---|---|
| Keywords | `cybersecurity` | Each keyword is its own search; empty = every notice that matches the filters |
| Keywords in the title only | off | Skip notices that only mention the word in standard clauses |
| NAICS codes | `541512` | One or more |
| Notice types | Solicitation, Sources sought, Award notice | Empty = all types |
| Set-asides | Total small business, 8(a), HUBZone, SDVOSB, WOSB | Empty = all |
| Place of performance | `VA` | Two-letter state codes |
| Updated in the last N days | `1` | For daily alerts; 0 = any time |
| Still open for responses | on | Deadline today or later; award notices skip this |
| Active notices only | on | Leave out archived and cancelled notices |
| Order | Relevance | Or last updated |
| Notices per keyword | `100` | Up to 10,000 |
| Attachment list | off | File names, sizes and download links, at no extra charge |

### Output

Each result is one row in the run's dataset (download it as JSON, CSV, Excel, XML or HTML, or read it through the API). An example row (values shortened):

```json
{
  "kind": "opportunity",
  "noticeId": "0a1b2c3d4e5f60718293a4b5c6d7e8f9",
  "title": "Cybersecurity Assessment and Authorization Support Services",
  "noticeType": "Combined Synopsis/Solicitation",
  "solicitationNumber": "EX-27-Q-0042",
  "department": "DEPT OF DEFENSE",
  "agency": "DEPT OF THE NAVY",
  "office": "NAVAL INFORMATION WARFARE CENTER",
  "postedAt": "2026-10-09T17:03:35+00:00",
  "responseDeadline": "2026-10-30T14:00:00-04:00",
  "active": true,
  "setAside": "SBA",
  "naics": [
    "541512"
  ],
  "productServiceCode": "DJ10",
  "placeOfPerformance": "San Diego, CA, 92152, UNITED STATES",
  "contacts": [
    {
      "name": "Alex Sample",
      "email": "alex.sample@example.mil",
      "phone": "555-010-0100",
      "title": "Contracting Officer",
      "role": "primary"
    }
  ],
  "award": null,
  "description": "The Government intends to award a firm-fixed-price contract for assessment and authorization support...",
  "files": [
    {
      "name": "Attachment 1 PWS.pdf",
      "size": 241291,
      "posted": "2026-10-09T16:37:48+00:00",
      "url": "https://sam.gov/api/prod/opps/v3/opportunities/resources/files/.../download"
    }
  ],
  "url": "https://sam.gov/opp/0a1b2c3d4e5f60718293a4b5c6d7e8f9/view"
}
```

A record named `SUMMARY` in the run's key-value store says what each input returned, with any notes (for example an account that does not exist), what was charged and how much traffic the run used.

### Pricing

- **$0.01 per notice**, read in full: agency, deadline, codes, set-aside, contacts, description, award
- The attachment list is included at no extra charge
- Notices left out by your filters (title-only, not open) are free

What typical jobs cost at the list price:

| Job | Cost |
|---|---|
| 100 open notices for a keyword | $1.00 |
| Daily alert for 5 NAICS codes, about 30 new notices a day | about $9 a month |
| 1,000 award notices with winners and amounts | $10 |
| 10,000 notices (the most one search returns) | $100 |

On Apify's Scale and Business plans the per-event prices are lower (Store discounts). Set **Maximum cost per run** and the Actor stops cleanly when it is reached: you never pay more than that.

### Tips

- For daily alerts, schedule a run with **Updated in the last N days** set to 1 and send the dataset to email, Slack or Google Sheets with an integration.
- NAICS codes are more precise than broad keywords: SAM.gov matches a keyword anywhere in a notice, standard clauses included. Or turn on **Keywords in the title only**.
- For awards, pick the notice type **Award notice**: the open-for-responses filter is skipped for them.
- Need more than 10,000 notices? Split the job by NAICS code, state or date.

### Use it through the API

**Python**

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("zaiq/sam-gov-scraper").call(run_input={"keywords": ["cybersecurity"], "setAsides": ["SBA"], "maxResults": 50})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(row)
```

**JavaScript**

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('zaiq/sam-gov-scraper').call({"keywords": ["cybersecurity"], "setAsides": ["SBA"], "maxResults": 50});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

**HTTP (one call, results back)**

```bash
curl -X POST 'https://api.apify.com/v2/acts/zaiq~sam-gov-scraper/run-sync-get-dataset-items?token=<YOUR_APIFY_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{"keywords": ["cybersecurity"], "setAsides": ["SBA"], "maxResults": 50}'
```

### Integrations and schedules

- **Schedules:** run it every hour, day or week from the Apify Console (Schedules) and keep a history of results.
- **Make, Zapier, n8n, Google Sheets, Slack, Airtable:** connect it through Apify's integrations, or send each finished run to a **webhook**.
- **Datasets:** results stay in the run's dataset; export them or read them by API whenever you need them.

### Use it with AI agents (MCP)

Add Apify's MCP server (`https://mcp.apify.com`) to Claude, ChatGPT, Cursor, VS Code or any MCP client. The agent can find this Actor and run it for you: ask it for "open federal cybersecurity contracts set aside for small businesses, with the contracting officer's email". AI agents can also pay for runs directly through Apify's agentic payments.

### Limits

- Federal notices only (SAM.gov); state and local bids are not included.
- SAM.gov returns up to 10,000 notices per search; split by NAICS code, state or date for more.
- Files are listed with download links; they are not downloaded for you.
- SAM.gov sorts by relevance or last update only, not by deadline.
- Some notices list no contacts or place of performance; those fields are empty.

### FAQ

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

No. Everything comes from the public search on sam.gov that anyone can use without signing in.

**How is this different from the official SAM.gov API?**

The official Opportunities API needs an API key and caps how many requests a key can make each day. This Actor needs neither, and adds the contacts, files and award details in one row.

**Can I get only new notices every day?**

Yes: schedule a daily run with **Updated in the last N days** set to 1.

**Why do some results not mention my keyword in the title?**

SAM.gov matches the whole notice text, including standard clauses. Turn on **Keywords in the title only** or search by NAICS code.

**Are award amounts included?**

Yes, for award notices: amount, date, contract number, the winner's name, UEI, city and state.

**Are the contacts real people?**

They are the contracting officers and specialists each agency publishes on the notice for vendor questions.

### Related Actors from Zaiq

- [contact-details-extractor](https://apify.com/zaiq/contact-details-extractor): emails and phones from the websites of the companies that win
- [google-news-scraper](https://apify.com/zaiq/google-news-scraper): news about the agencies and programmes you bid on

### Support

Questions, a site that changed, or a field you need? Open an issue on this Actor's **Issues** tab: we answer there, usually within a day.

***

Also found as: sam.gov scraper, sam.gov api, federal contract opportunities, government contracts scraper, govcon leads, federal bids, rfp scraper, sam.gov award notices, contracting officer contacts, usa government tenders.

# Actor input Schema

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

What to search for, one per line (each is its own search). Empty = every notice matching the filters.

## `titleOnly` (type: `boolean`):

SAM.gov matches a keyword anywhere in a notice, standard clauses included. Turn on to keep only notices whose title has every word of the keyword (the others are not charged).

## `naics` (type: `array`):

Only these NAICS codes, e.g. 541512 (computer systems design).

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

Only these notice types (empty = all).

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

Only these small-business set-asides (empty = all).

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

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

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

0 = any time.

## `openOnly` (type: `boolean`):

Only notices whose response deadline is today or later (notices without a deadline are left out). Turn off for past and award notices.

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

Leave out archived and cancelled notices.

## `sort` (type: `string`):

Relevance needs keywords; without keywords, notices come newest first.

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

SAM.gov returns up to 10,000 notices a search.

## `includeFiles` (type: `boolean`):

Add each notice's files (names, sizes and download links), at no extra charge.

## Actor input object example

```json
{
  "keywords": [
    "cybersecurity"
  ],
  "titleOnly": false,
  "postedWithinDays": 0,
  "openOnly": true,
  "activeOnly": true,
  "sort": "relevance",
  "maxResults": 100,
  "includeFiles": false
}
```

# Actor output Schema

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

Dataset: the results.

## `summary` (type: `string`):

What each input returned, and notes.

# 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("zaiq/sam-gov-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 = { "keywords": ["cybersecurity"] }

# Run the Actor and wait for it to finish
run = client.actor("zaiq/sam-gov-scraper").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 zaiq/sam-gov-scraper --silent --output-dataset

```

## MCP server setup

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

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/PL9C4qttzlyTpAnnT/builds/Zg7r1DPFdtKmgughX/openapi.json
