# SAM.gov Contract Opportunities & RFPs (Official API) (`immemorial_damask/sam-gov-contract-opportunities`) Actor

Search US federal contract opportunities, RFPs, sources sought and award notices from the official SAM.gov API. Filter by keyword, NAICS, PSC, set-aside, notice type, state, agency and dates. Incremental new-only mode. No contracting-officer contacts. Bring your own free SAM.gov key.

- **URL**: https://apify.com/immemorial_damask/sam-gov-contract-opportunities.md
- **Developed by:** [Linus Holmgren](https://apify.com/immemorial_damask) (community)
- **Categories:** Lead generation, Developer tools, AI
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 1,000 opportunities

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 & RFPs (Official API)

**Search US federal contract opportunities from SAM.gov**: solicitations, RFPs, RFQs, combined synopsis/solicitations, presolicitations, sources sought and award notices. You get clean JSON with NAICS, PSC, set-aside, agency, deadlines, place of performance, award details and attachment links. It uses the **official SAM.gov Get Opportunities Public API** with no HTML scraping, no browser and no proxies.

**No contracting-officer contact data.** Point-of-contact names, emails and phone numbers are deliberately left out, as are street addresses. You get the opportunity, not personal data.

**Price: $2.50 per 1,000 opportunities** (`$0.0025` per `opportunity`). Notices that are filtered out, duplicates, notices you already received in incremental mode and failed API calls are never charged.

> **You need your own free SAM.gov API key.** It takes about two minutes to get one, see [Get your SAM.gov API key](#get-your-samgov-api-key). The key belongs to your SAM.gov account, so your requests count against your own quota and fall under your own terms with SAM.gov.

### What does it do?

[SAM.gov](https://sam.gov) is the US government's official system for federal contract opportunities. This Actor turns its [Get Opportunities Public API](https://open.gsa.gov/api/get-opportunities-public-api/) into a dataset you can schedule, export to CSV or Excel, push to a CRM or call from **AI agents and MCP clients**.

- **Filters:** keywords in the title, **NAICS codes** (exact or prefix such as `5415`), **PSC codes**, **set-asides** (Small Business, 8(a), HUBZone, SDVOSB, WOSB, EDWOSB and more), **notice type**, **place-of-performance state**, **agency name or code**, solicitation number, **posted date range** or "last N days", and **response deadline range**.
- **Incremental mode:** returns only notices you haven't received before, which suits daily or hourly bid alerts.
- **Clean, flat records:** department, sub-tier and office split out; dates; deadline; NAICS and PSC; set-aside code and label; place of performance; award number, amount, date and awardee company with UEI; SAM.gov link; attachment links.
- **Quota-friendly:** pages of 1,000 notices per API call, a hard **Max API calls** cap, and clear errors when the daily quota runs out.
- Limited permissions, 256 MB memory, predictable pay-per-event pricing.

### Use cases

- **Bid alerts for GovCon companies:** new solicitations for your NAICS codes every morning.
- **Small-business set-aside hunting:** for example SDVOSB or 8(a) opportunities in your state.
- **Capture and pipeline tools:** feed a CRM, Airtable, Google Sheets or Slack (via Apify integrations).
- **Market research:** which agencies are buying what, and award notices with amounts and awardees.
- **AI agents:** structured, official federal procurement data with no PII.

### Get your SAM.gov API key

1. Go to [sam.gov](https://sam.gov) and **sign in** (or create a free account; SAM.gov uses Login.gov). You don't need to register an entity for public data.
2. Open **[Account Details](https://sam.gov/workspace/profile/account-details)**.
3. Next to **Public API Key**, click the **eye icon** and enter the one-time password SAM.gov emails you.
4. Copy the key straight away and paste it into **SAM.gov API key**. The field is a secret input: it is stored encrypted and never logged.

**Keys from api.data.gov do not work.** SAM.gov runs its own API gateway and answers unknown keys with an empty HTTP 404. The Actor detects this and tells you.

#### Daily quota

SAM.gov limits requests per key per day ([GSA rate-limit table](https://open.gsa.gov/api/entity-api/#api-key-rate-limits)):

| Your SAM.gov account | Default daily limit |
| --- | --- |
| Non-federal user **without** a role in SAM.gov (personal key) | **10 requests/day** |
| Non-federal user **with** a role in SAM.gov (personal key) | 1,000 requests/day |
| Non-federal system account | 1,000 requests/day |
| Federal user / federal system account | 1,000 / 10,000 requests/day |

Each request returns **up to 1,000 notices**, so even 10 requests a day cover up to 10,000 notices. The Actor uses **one request per 1,000 notices** and stops at **Max API calls** (default 3) so a single run can never use up your whole day. Tips:

- Use **incremental mode** with a daily schedule. One call per day is usually enough for a NAICS or agency watchlist.
- Use **one** NAICS code, PSC code, set-aside or state when you can. SAM.gov filters a single value on its side. With several values, the Actor fetches the wider set and filters it itself, which can need more pages.

### How much does it cost?

| Event | When it is charged | Price |
| --- | --- | --- |
| `opportunity` (primary) | Once per notice written to the dataset | **$0.0025** ($2.50 / 1,000) |
| `apify-actor-start` | Once when the run starts | $0.00005 |

**Never charged:** notices removed by your filters, duplicates, notices already seen in incremental mode, archived notices when *Active only* is on, and failed or quota-limited API calls. **Max notices** and your run's **maximum total charge** are both respected: when the budget runs out, the Actor stops cleanly and doesn't write unpaid rows (and doesn't mark them as seen).

Example: a daily watchlist that finds 40 new notices costs about $0.10 a day.

### Input example

```json
{
  "samGovApiKey": "<your SAM.gov Public API Key>",
  "keywords": "cybersecurity",
  "noticeTypes": ["o", "k", "p", "r"],
  "naicsCodes": ["541512"],
  "setAsideTypes": ["SDVOSBC"],
  "postedWithinDays": 7,
  "maxItems": 200,
  "maxApiCalls": 3,
  "incrementalStateStoreName": "sam-cyber-sdvosb"
}
```

Notice type codes: `o` Solicitation, `k` Combined Synopsis/Solicitation, `p` Presolicitation, `r` Sources Sought, `s` Special Notice, `a` Award Notice, `u` Justification (J\&A), `i` Intent to Bundle (DoD), `g` Sale of Surplus Property.

### Output example

```json
{
  "noticeId": "f6c1f22bd90845638e0aa3c1cac776a1",
  "title": "JANITORIAL SERVICES, LINCOLN, IL",
  "solicitationNumber": "1305M327Q0052",
  "noticeType": "Combined Synopsis/Solicitation",
  "active": true,
  "postedDate": "2026-11-23",
  "responseDeadline": "2026-12-07T11:00:00-06:00",
  "naicsCode": "561720",
  "pscCode": "S201",
  "setAsideCode": "SBA",
  "setAsideDescription": "Small Business Set Aside - Total",
  "department": "COMMERCE, DEPARTMENT OF",
  "subTier": "NATIONAL OCEANIC AND ATMOSPHERIC ADMINISTRATION",
  "office": "DEPT OF COMMERCE NOAA",
  "agencyPath": "COMMERCE, DEPARTMENT OF > NATIONAL OCEANIC AND ATMOSPHERIC ADMINISTRATION > DEPT OF COMMERCE NOAA",
  "officeLocation": { "city": "SEATTLE", "stateCode": "WA", "zip": "98115", "countryCode": "USA" },
  "placeOfPerformance": { "state": "Illinois", "stateCode": "IL", "country": "UNITED STATES", "countryCode": "USA" },
  "award": null,
  "uiLink": "https://sam.gov/workspace/contract/opp/f6c1f22bd90845638e0aa3c1cac776a1/view",
  "descriptionApiLink": "https://api.sam.gov/prod/opportunities/v1/noticedesc?noticeid=f6c1f22bd90845638e0aa3c1cac776a1",
  "resourceLinks": ["https://sam.gov/api/prod/opps/v3/opportunities/resources/files/0e281ead052745088148152632381bbe/download"],
  "resourceLinkCount": 3,
  "source": "SAM.gov Get Opportunities Public API (official, api.sam.gov/opportunities/v2)",
  "charged": true
}
```

Award notices include `award`: `{ "number", "amount", "date", "awardeeName", "awardeeUei", "awardeeCity", "awardeeState", "awardeeCountry" }`. Opening `descriptionApiLink` requires your own `api_key` parameter, and each call uses quota.

A `STATS` record in the run's key-value store shows API calls used, notices received, saved, charged and skipped.

### FAQ

**Is this scraping SAM.gov?** No. SAM.gov prohibits automated scraping of its website and points developers to its official APIs. This Actor only calls the official public **Get Opportunities API** with your own key. It never loads sam.gov web pages and never calls restricted (FOUO) APIs.

**Why are contact names and emails missing?** That's on purpose. Contracting-officer contact details are personal data. Use the `uiLink` to contact the agency through SAM.gov.

**Why do I get "SAM.gov rejected the API key"?** You probably used an api.data.gov key, or copied the SAM.gov key incompletely. Get the **Public API Key** from SAM.gov Account Details.

**I hit the daily quota.** Notices already saved are kept, and nothing more is charged. Wait for the reset, lower **Max API calls**, narrow your filters, or ask SAM.gov for a role or system account with 1,000 requests/day.

**How fresh is the data?** SAM.gov updates active notices daily. The API returns the latest active version of each notice.

### Data source and terms

Data comes from the U.S. General Services Administration's SAM.gov Get Opportunities Public API. US federal government works are generally in the public domain. Your use of the API key is subject to SAM.gov's terms for your account. This Actor isn't affiliated with or endorsed by GSA or SAM.gov.

# Changelog

This Actor's version history is a separate document: https://apify.com/immemorial_damask/sam-gov-contract-opportunities/changelog.md

# Actor input Schema

## `samGovApiKey` (type: `string`):

Required. Your free 'Public API Key' from SAM.gov: sign in at https://sam.gov, open Account Details (https://sam.gov/workspace/profile/account-details), click the eye icon next to Public API Key and enter the one-time code. Keys from api.data.gov do NOT work. The key is stored encrypted and never logged.

## `keywords` (type: `string`):

Words that must appear in the notice title, e.g. 'cybersecurity' or 'janitorial'.

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

Leave empty for all types. Default: open solicitations, combined synopsis/solicitations, presolicitations and sources sought.

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

One 6-digit code is filtered by SAM.gov. Several codes or 2-5 digit prefixes (e.g. 5415) are matched on our side, which may need more API calls.

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

Product Service Codes, e.g. D399 or R425. Several codes or prefixes (e.g. D3) are matched on our side.

## `setAsideTypes` (type: `array`):

Small-business set-asides. One value is filtered by SAM.gov; several are matched on our side.

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

Two-letter US state codes, e.g. VA, TX. One state is filtered by SAM.gov; several are matched on our side.

## `organizationName` (type: `string`):

Department or sub-tier name, e.g. 'DEPT OF THE NAVY' or 'VETERANS AFFAIRS'.

## `organizationCode` (type: `string`):

Federal Hierarchy organization code (as in agencyPathCodes).

## `solicitationNumber` (type: `string`):

Find notices for one solicitation number.

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

Used when 'Posted from' is empty. 1-365.

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

Optional exact start date. Max 1 year between from and to (SAM.gov rule).

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

Optional end date. Defaults to today (US Eastern).

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

Only notices whose response deadline is on or after this date.

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

Only notices whose response deadline is on or before this date.

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

Skip archived notices.

## `includeResourceLinks` (type: `boolean`):

Add direct SAM.gov download links for notice attachments.

## `maxItems` (type: `integer`):

Maximum number of notices to save (and charge).

## `maxApiCalls` (type: `integer`):

Protects your SAM.gov daily quota (personal keys without a role: 10 requests/day). Each call returns up to 1,000 notices.

## `incrementalStateStoreName` (type: `string`):

Set a name (e.g. 'sam-cyber-va') to only get notices you have not received before. Seen notice IDs are kept in a named key-value store in your account. Leave empty to get everything every run.

## Actor input object example

```json
{
  "noticeTypes": [
    "o",
    "k",
    "p",
    "r"
  ],
  "naicsCodes": [
    "541512"
  ],
  "postedWithinDays": 7,
  "activeOnly": true,
  "includeResourceLinks": true,
  "maxItems": 100,
  "maxApiCalls": 3
}
```

# Actor output Schema

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

Clean notice records (no contracting-officer contacts).

## `stats` (type: `string`):

API calls used, rows received, emitted, charged and skipped.

# 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 = {
    "noticeTypes": [
        "o",
        "k",
        "p",
        "r"
    ],
    "naicsCodes": [
        "541512"
    ],
    "postedWithinDays": 7,
    "maxItems": 100,
    "maxApiCalls": 3
};

// Run the Actor and wait for it to finish
const run = await client.actor("immemorial_damask/sam-gov-contract-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 = {
    "noticeTypes": [
        "o",
        "k",
        "p",
        "r",
    ],
    "naicsCodes": ["541512"],
    "postedWithinDays": 7,
    "maxItems": 100,
    "maxApiCalls": 3,
}

# Run the Actor and wait for it to finish
run = client.actor("immemorial_damask/sam-gov-contract-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 '{
  "noticeTypes": [
    "o",
    "k",
    "p",
    "r"
  ],
  "naicsCodes": [
    "541512"
  ],
  "postedWithinDays": 7,
  "maxItems": 100,
  "maxApiCalls": 3
}' |
apify call immemorial_damask/sam-gov-contract-opportunities --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,immemorial_damask/sam-gov-contract-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/YGHTowVLufCjI8rrg/builds/DGruVnuisekux4ZRg/openapi.json
