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

Search US federal contract opportunities on SAM.gov by keyword, notice type, set-aside, NAICS code, state and dates. Pay per opportunity.

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

## Pricing

from $2.00 / 1,000 sam.gov opportunity scrapeds

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 Scraper

Search the US federal contract opportunities published on SAM.gov and get one clean row per notice. Use it to find bids, track an agency or an industry code, watch award notices, or build a lead list of government buyers.

All data is public information published by US government agencies.

### What you get

For every notice the run returns:

- Notice id, link to the SAM.gov page, title, solicitation number
- Notice type (solicitation, presolicitation, sources sought, special notice, award and more) and its code
- Department, sub-tier agency and contracting office, with office address and the full agency chain
- Posting date, last change date, response deadline and time zone, active and canceled flags
- Parent notice id and number of changes
- The first part of the notice text
- For award notices: awardee name and unique entity id, award date, amount and contract number

Turn on **Include notice details** to also get, for each notice:

- NAICS codes and the product or service code
- Set-aside code and description
- Archive date
- Place of performance
- The published contact persons (name, title, email, phone) as listed on the notice
- The full notice text and the CAGE code and address of an awardee

### Pricing

Pay per result. You are charged for these events only:

| Event name | When it is charged | Price |
|---|---|---|
| `actor-start` | Once per run, together with the first delivered rows | $0.001 |
| `opportunity-result` | For each opportunity row delivered to the dataset | $0.002 ($2.00 per 1,000) |

A run with no matches delivers no rows and is not charged. If you set a maximum cost per run, the run stops cleanly when the limit is reached and reports how many rows it delivered.

### Input

| Field | Meaning |
|---|---|
| `queries` | Search words. Each entry is its own search. Leave empty to list the newest notices that match your filters. |
| `maxResults` | Total number of opportunities for the run (default 100, up to 10,000). It is shared evenly between the search words. A number written as text such as "50" works too. |
| `isActive` | On by default: only active notices. Turn off to search archived and inactive notices. |
| `noticeTypes` | Letters p, r, o, k, s, i, a, g, u or words such as solicitation, award, sources sought. |
| `setAside` | Set-aside codes such as SBA or 8A. |
| `naics` | NAICS codes, 2 to 6 digits. |
| `placeOfPerformanceState` | Two letter state codes. |
| `postedFrom`, `postedTo` | Posting date range, format YYYY-MM-DD (US Eastern days). |
| `modifiedFrom`, `modifiedTo` | Last change date range. |
| `responseFrom`, `responseTo` | Response deadline range. |
| `sort` | `-modifiedDate` (most recently changed first, default) or `-relevance`. |
| `includeDetails` | Adds the detail fields listed above. One extra request per notice. |

An empty input runs a small demo with the 5 most recently changed active notices.

#### Example: software and security bids

```json
{
  "queries": ["software", "cybersecurity"],
  "maxResults": 60
}
```

#### Example: open small business solicitations in IT services in Virginia

```json
{
  "noticeTypes": ["solicitation", "combined"],
  "setAside": ["SBA"],
  "naics": ["541511"],
  "placeOfPerformanceState": ["VA"],
  "maxResults": 50,
  "includeDetails": true
}
```

#### Example: notices posted in the last week of October

```json
{
  "queries": ["road maintenance"],
  "postedFrom": "2026-10-25",
  "postedTo": "2026-10-31"
}
```

### Output sample

```json
{
  "noticeId": "a9e32acc441742bca1877cfd1c541cc9",
  "url": "https://sam.gov/opp/a9e32acc441742bca1877cfd1c541cc9/view",
  "title": "7H20 - Sole Source Remote Automated Laboratory System Software and Support",
  "solicitationNumber": "36C26127P0045",
  "noticeType": "Award Notice",
  "noticeTypeCode": "a",
  "isActive": true,
  "postedDate": "2026-11-05T19:10:14+00:00",
  "modifiedDate": "2026-11-05T19:10:14+00:00",
  "responseDeadline": null,
  "department": "VETERANS AFFAIRS, DEPARTMENT OF",
  "subTier": "VETERANS AFFAIRS, DEPARTMENT OF",
  "office": "261-NETWORK CONTRACT OFFICE 21 (36C261)",
  "officeLocation": "10535 HOSPITAL WAY, MATHER, CA, 95655",
  "awardeeName": "ABBOTT RAPID DIAGNOSTICS INFORMATICS, INC",
  "awardeeUei": "H6ZLTSJFD465",
  "description": "The Department of Veterans Affairs awarded a firm-fixed-price contract to ...",
  "descriptionTruncated": true,
  "detailsIncluded": false,
  "searchQuery": "software"
}
```

Fields that a notice does not have are returned as `null`.

### Limits

- SAM.gov returns at most 10,000 records per search. Split larger jobs by date range or NAICS code.
- Notice text in the list answer is the first part only. Turn on `includeDetails` for the full text.
- Rows are unique by notice id within a run, also across several search words.

### FAQ

**Is this data public?**
Yes. SAM.gov publishes contract opportunities for anyone to read. Contact persons are the government officers named on the notice.

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

**Why are NAICS, set-aside and contacts empty?**
Those fields come from the notice detail. Turn on `includeDetails` to get them.

**How fresh is the data?**
Each run reads the live search, so rows match what SAM.gov shows at that moment.

**What happens if the run is restarted by the platform?**
The run keeps its progress and continues without repeating rows or charging them twice.

**What if SAM.gov changes its format?**
The run checks the shape of every answer. If it no longer matches, the run stops with a clear message instead of returning an empty result.

**Can I filter by agency?**
Use search words such as the agency name. A dedicated agency filter is not offered.

# Actor input Schema

## `queries` (type: `array`):

Words or phrases to search for in notice titles and descriptions (for example 'software' or 'road maintenance'). Each entry is a separate search. Leave empty to list the newest notices that match the filters below. An empty input runs a tiny demo of 5 notices.

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

Maximum opportunities for the whole run, shared evenly between the search words. Default 100, maximum 10,000.

## `isActive` (type: `boolean`):

On: only notices that are still open or current. Off: only archived and inactive notices.

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

Filter by notice type. Use the letters p (presolicitation), r (sources sought), o (solicitation), k (combined synopsis and solicitation), s (special notice), i (intent to bundle), a (award notice), g (sale of surplus property), u (justification), or the words solicitation, presolicitation, combined, sources sought, special notice, award.

## `setAside` (type: `array`):

Filter by set-aside code as used by SAM.gov, for example SBA (small business), 8A, HZC, SDVOSBC, WOSB.

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

Filter by NAICS industry code (2 to 6 digits), for example 541511.

## `placeOfPerformanceState` (type: `array`):

Filter by the two letter state code of the place of performance, for example VA or CA.

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

First posting date, format YYYY-MM-DD (US Eastern calendar day).

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

Last posting date, format YYYY-MM-DD (US Eastern calendar day).

## `modifiedFrom` (type: `string`):

Only notices changed on or after this date, format YYYY-MM-DD.

## `modifiedTo` (type: `string`):

Only notices changed on or before this date, format YYYY-MM-DD.

## `responseFrom` (type: `string`):

Only notices with a response deadline on or after this date, format YYYY-MM-DD.

## `responseTo` (type: `string`):

Only notices with a response deadline on or before this date, format YYYY-MM-DD.

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

Newest change first, or best match first.

## `includeDetails` (type: `boolean`):

Opens each notice to add NAICS codes, product or service code, set-aside, archive date, place of performance, full description and the published contact persons. Uses one extra request per notice, so runs take longer. The price per result stays the same.

## `proxyConfiguration` (type: `object`):

Keep the default. The run connects through Apify's standard pool.

## Actor input object example

```json
{
  "queries": [
    "software",
    "cybersecurity"
  ],
  "maxResults": 100,
  "isActive": true,
  "sort": "-modifiedDate",
  "includeDetails": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `defaultDataset` (type: `string`):

US federal contract opportunity notices from SAM.gov

# 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 = {
    "queries": [
        "software",
        "cybersecurity"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("nanodata/sam-gov-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 = {
    "queries": [
        "software",
        "cybersecurity",
    ],
    "proxyConfiguration": { "useApifyProxy": True },
}

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nanodata/sam-gov-opportunities-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/1VA3s2aBsK5Z2hxns/builds/U5dosHtUA7kMYCEnw/openapi.json
