# SAM.gov Contract Opportunities Scraper (US Federal Bids) (`tenderwire/us-sam-gov-opportunities`) Actor

Get US federal contract opportunities from SAM.gov: solicitations, presolicitations, sources sought and awards with agency, NAICS, PSC, set-aside and deadline. Works without a key (official daily extract) or with your free SAM.gov API key.

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

## Pricing

$3.00 / 1,000 notices

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 (US Federal Bids)

Get US federal contract opportunities from **SAM.gov**, the official place where every federal agency posts what it wants to buy: solicitations, presolicitations, sources sought, special notices and awards. Each row has the agency, notice type, NAICS and PSC codes, small business set-aside, response deadline and a link to the notice.

**Works with or without a key.** Without a key, the Actor reads SAM.gov's official public daily extract (updated once a day). Add your own free SAM.gov API key to use the live official API instead.

### What does SAM.gov Contract Opportunities Scraper do?

- Lists new federal opportunities posted in your date range, newest first.
- Filters by notice type, keyword, NAICS, PSC, agency, place of performance and small business set-asides.
- Uses only official SAM.gov sources (the public Opportunities API and the public data extract), never the website itself.
- **Alerts mode**: remembers what it already delivered and outputs only new notices next time.
- Uses the same output format as our other government tender scrapers (US, UK, EU, Canada, France, Australia).

### Who uses it?

- **Government contractors and small businesses** looking for new federal bids every morning.
- **Capture and proposal teams** tracking sources sought and presolicitations before the solicitation drops.
- **Bid-matching services and newsletters** that need a clean daily federal feed.
- **Analysts** studying what agencies buy.

### Key or no key?

| | No key (default) | Your SAM.gov API key |
|---|---|---|
| Source | Official public daily extract | Official Opportunities API, live |
| Freshness | Updated once a day | Real time |
| Description text | Included when published | Not included (the API serves it separately) |
| Attachments links | No | Yes, when published |
| Limits | None | Your key's daily request allowance (1 request per 1,000 notices) |

To get a key: sign in at sam.gov, open **Account Details**, then **Public API Key**. Keys are free and last 90 days. Paste it into **Your SAM.gov API key**: Apify stores it encrypted, and the Actor never writes it to logs or results.

### What data do you get?

| Field | Example |
|---|---|
| title | 16--PARTS KIT,MOTOR,ACT |
| buyerName | DEPT OF DEFENSE / DEFENSE LOGISTICS AGENCY / DLA MARITIME / ... |
| noticeType, stage | Combined Synopsis/Solicitation, tender (planning for presolicitations and sources sought, award for awards) |
| ocid | solicitation number, e.g. SPE7M427T2313 |
| publishedDate, deadlineDate | 2026-11-05, 2026-11-16 |
| categoryCodes | NAICS and PSC codes, e.g. 336413 and 16 |
| procurementCategory | goods, services or works (from the PSC code) |
| procurementMethod, suitableForSme | small business set-aside, e.g. Total Small Business Set-Aside |
| placeOfPerformance | city, state and country when stated |
| awardedSuppliers, awardValueAmount, awardDate | for award notices |
| noticeUrl | the notice on sam.gov |

### How to use it

1. Click **Try for free**.
2. Keep the default (open bids and early notices from the last 3 days) or add keywords, NAICS codes or agencies.
3. Optionally paste your SAM.gov API key for live data.
4. Click **Start**. Runs take seconds to a couple of minutes.
5. Export to Excel, CSV or JSON, or send results to Google Sheets, Slack, email, a CRM, Zapier or Make.

### Input example

```json
{
    "noticeKinds": ["solicitation", "sources_sought"],
    "keywords": ["cybersecurity", "cloud"],
    "naicsPrefixes": ["5415"],
    "setAsideOnly": true,
    "onlyOpen": true,
    "daysBack": 7,
    "maxItems": 500
}
```

### Output example

```json
{
    "source": "sam-gov",
    "noticeId": "ffb00b4f17a14b9d920d79dd75fd11bf",
    "ocid": "SPE7M427T2313",
    "noticeType": "Combined Synopsis/Solicitation",
    "stage": "tender",
    "status": "active",
    "title": "16--PARTS KIT,MOTOR,ACT",
    "description": null,
    "buyerName": "DEPT OF DEFENSE / DEFENSE LOGISTICS AGENCY / DLA MARITIME / DLA MARITIME COLUMBUS / DLA WEAPONS SUPPORT",
    "buyerId": null,
    "buyerCountry": "United States",
    "buyerCity": "COLUMBUS",
    "buyerContactEmail": null,
    "buyerContactPhone": null,
    "buyerWebsite": null,
    "cpvCodes": [],
    "categoryCodes": [
        "336413",
        "16"
    ],
    "categoryDescription": null,
    "procurementCategory": "goods",
    "procurementMethod": null,
    "valueAmount": null,
    "valueCurrency": null,
    "publishedDate": "2026-11-05",
    "deadlineDate": "2026-11-16",
    "contractStartDate": null,
    "contractEndDate": null,
    "placeOfPerformance": [],
    "suitableForSme": null,
    "awardedSuppliers": [],
    "awardValueAmount": null,
    "awardDate": null,
    "noticeUrl": "https://sam.gov/workspace/contract/opp/ffb00b4f17a14b9d920d79dd75fd11bf/view",
    "documentUrls": [],
    "language": "en",
    "scrapedAt": "2026-11-05T13:15:00.000Z"
}
```

### How much does it cost?

**Pay per result: $3 per 1,000 notices** delivered, plus a tiny Apify start fee per run. No proxy or browser costs, and your SAM.gov key is free.

- SAM.gov posts about 1,000 to 1,500 notices per working day; a focused daily alert usually returns 10 to 100.
- Apify's free plan includes monthly credit, enough to try the Actor many times.
- Set **Max notices** to cap the cost of any run.

### Alerts mode and integrations

Turn on **Only new since last run** and schedule the Actor every morning. It remembers delivered notices in your own Apify account and outputs only new ones. Use a different **Alerts state name** for each saved search. Send results to Slack, email, Google Sheets, Airtable, HubSpot, Zapier, Make or a webhook.

### Other Actors with the same output format

- **US Federal Contract Awards (USAspending.gov)** and **US Grants (Grants.gov)**.
- **UK Public Tenders**, **EU TED Tenders**, **France Public Tenders (BOAMP)**, **CanadaBuys Tenders** and **Australia Government Contracts (AusTender)**.

### FAQ

**Is this legal?**
Yes. SAM.gov data is US federal government information in the public domain. SAM.gov's terms allow data access through its published APIs and extracts, which is exactly what this Actor uses. It does not scrape the SAM.gov website.

**Why did my run fail with "rejected the API key"?**
The key is wrong or expired (keys last 90 days). Create a new one on sam.gov, or clear the field to use the public extract.

**Why did my run stop with "daily request allowance"?**
SAM.gov limits how many API requests a key can make per day. Each request returns up to 1,000 notices. Run again the next day, narrow the date range, or remove the key to use the extract.

**Does it include contact names?**
No. Contact names are never included, and only organisation mailboxes (not personal ones) are kept.

**Something looks wrong?**
Open an issue on the Issues tab. An automatic self-check runs every day on both the extract and the API, and problems are usually fixed within a day.

# Actor input Schema

## `apiKey` (type: `string`):

Optional. Without a key the Actor reads SAM.gov's official public daily extract (updated once a day). With your free SAM.gov Public API Key it uses the live official API instead. Get the key on sam.gov: sign in, open Account Details, Public API Key. The key is stored encrypted and is never shown in logs or results.

## `noticeKinds` (type: `array`):

solicitation = open bids (includes combined synopsis/solicitations). presolicitation and sources sought = early notices to get ahead of a bid. special notice = industry days and other announcements. award = contract awards.

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

Keep notices whose title, description or agency contains at least one of these words.

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

Drop notices that contain any of these words.

## `naicsPrefixes` (type: `array`):

e.g. 5415 (computer systems design), 541330 (engineering services), 236 (building construction).

## `pscPrefixes` (type: `array`):

Federal Product and Service Codes, e.g. D3 (IT services), R4 (professional support), 70 (IT equipment).

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

Two-letter US state codes, e.g. VA, TX. Many notices do not state a place of performance and are dropped when this is set.

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

e.g. Defense Logistics Agency, Veterans Affairs, Army, NASA.

## `setAsideOnly` (type: `boolean`):

Keep only notices reserved for small businesses (SBA, 8(a), WOSB, SDVOSB, HUBZone and similar).

## `onlyOpen` (type: `boolean`):

Keep only notices whose response deadline is today or later.

## `daysBack` (type: `integer`):

Notices posted in this many days, counting back from today. SAM.gov posts about 1,000 to 1,500 notices per working day. Ignored when 'Date from' is set.

## `dateFrom` (type: `string`):

Optional start posting date (YYYY-MM-DD). Overrides 'Days back'.

## `dateTo` (type: `string`):

Optional end posting date (YYYY-MM-DD). Defaults to today.

## `onlyNewSinceLastRun` (type: `boolean`):

Remember delivered notices and output only new ones on the next run. Ideal for a daily schedule.

## `stateKey` (type: `string`):

Use a different name for each saved search that runs in alerts mode.

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

Stop after this many notices (newest first). You only pay for notices delivered.

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

Not needed. Only used in API mode.

## `selfCheck` (type: `boolean`):

For the maintainer. Checks the source formats have not changed and writes a SELF_CHECK report. Outputs no notices.

## Actor input object example

```json
{
  "noticeKinds": [
    "solicitation",
    "presolicitation",
    "sources_sought"
  ],
  "setAsideOnly": false,
  "onlyOpen": false,
  "daysBack": 3,
  "onlyNewSinceLastRun": false,
  "stateKey": "default",
  "maxItems": 50,
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "selfCheck": false
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `allFields` (type: `string`):

No description

## `selfCheck` (type: `string`):

No description

# 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 = {
    "maxItems": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("tenderwire/us-sam-gov-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 = { "maxItems": 50 }

# Run the Actor and wait for it to finish
run = client.actor("tenderwire/us-sam-gov-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 '{
  "maxItems": 50
}' |
apify call tenderwire/us-sam-gov-opportunities --silent --output-dataset

```

## MCP server setup

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