# SAM.gov Contract Opportunities Scraper — Federal Tenders (`northbell/sam-gov-contract-opportunities`) Actor

SAM.gov scraper for US government contracts and federal tenders: solicitations, RFPs, sources sought and awards from SAM.gov's public data file. Filter by keyword, NAICS, PSC, set-aside, agency, state and deadline; flag new since your last run. No login, no API key.

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

## Pricing

from $1.60 / 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.
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 — Government Contracts & Federal Tenders

Search **SAM.gov Contract Opportunities**, the US government's listing of federal contract notices, by keyword, NAICS code, Product Service Code, set-aside, notice type, agency or state and get one clean row per notice: **title, notice type, posted date and response deadline, department, agency and office, set-aside, NAICS and PSC codes, place of performance, award number, date, amount and awardee, and the full description**, with a link to the notice on SAM.gov. **$2.00 per 1,000 notices**, no login, no API key.

It reads the public Contract Opportunities data file that SAM.gov publishes for download, not the SAM.gov website, so it does not break when the site changes and needs no SAM.gov API key of your own.

Run it again, or put it on a daily schedule, and every row also tells you **whether the notice is new since the last run** (`isNew`). Set *What to return* to *Only new* and you pay only for the notices you have not seen before. To set it up: save the search as a task and add a daily Schedule to that task in Apify Console. SAM.gov adds about 1,300 notices on a working day (21,975 in the 30 days to 21 Oct 2026), so the useful question is what appeared since yesterday; this keeps the list of what you have already seen.

**Try it now. The input is already filled in.** Press **Start**: notices that mention `software`, posted in the last 3 days — **50 notices in about 3 seconds, for $0.11** (measured on 28 Oct 2026). Three of the rows:

| `title` | `department` | `noticeType` | `responseDeadline` | `naicsCode` | `setAside` |
| --- | --- | --- | --- | --- | --- |
| Online management support software for SDS | INTERIOR, DEPARTMENT OF THE | Solicitation | 2026-11-06 | 513210 | Small Business Set Aside - Total |
| Veeam Data Platform Advanced subscription licenses renewal | STATE, DEPARTMENT OF | Solicitation | 2026-11-09 | 513210 | No Set aside used |
| Library of Congress - Zeutschel Scanner Technical Support | LIBRARY OF CONGRESS | Combined Synopsis/Solicitation | 2026-11-20 | 334118 | No Set aside used |

Each row also has the solicitation number, office, place of performance, PSC code, the full description and a link to the notice on SAM.gov.

### What you get

| Field | What it is |
|---|---|
| `noticeId`, `solicitationNumber`, `url` | SAM.gov's notice ID, the solicitation number the agency gave it, and the public link to the notice on SAM.gov |
| `isNew`, `previousRunAt` | `true` / `false` whether you had not seen this notice in your previous run of the same search, and when that run was (missing on the first run) |
| `title`, `description` | the title and the full description text, with email addresses and phone numbers removed (`description` is left out when you switch it off) |
| `noticeType`, `baseType` | `Solicitation`, `Combined Synopsis/Solicitation`, `Sources Sought`, `Presolicitation`, `Award Notice`, `Special Notice`, `Justification`…; `baseType` is the original type when the notice is an amendment |
| `postedOn`, `postedAt` | the day and time it was posted (as SAM.gov gives it, without a time zone) |
| `responseDeadline`, `archiveDate`, `active` | the deadline for offers or responses (with its time zone), when SAM.gov will archive the notice, and whether it is still active |
| `department`, `subTier`, `office`, `officeCode` | `DEPT OF DEFENSE`, `DEPT OF THE AIR FORCE`, the contracting office and its code |
| `officeCity`, `officeState`, `officeCountry` | where the contracting office is |
| `setAsideCode`, `setAside` | `SBA` / `Total Small Business Set-Aside (FAR 19.5)`, `SDVOSBC`, `WOSB`, `8A`, `HZC`…; `null` when there is none |
| `naicsCode`, `pscCode` | the industry code (NAICS) and the Product Service Code (PSC) |
| `placeCity`, `placeState`, `placeZip`, `placeCountry` | the place of performance, when the agency gives one |
| `awardNumber`, `awardDate`, `awardAmount`, `awardee` | on award notices: the contract number, the date, the amount in US dollars and the company that won (its name and address as SAM.gov lists them) |
| `additionalInfoUrl` | a link the agency added for more information, if any |
| `observedAt` | when the row was collected |

### Run it again and again

- **On a schedule**: save your input as a task and add a **Schedule**: the same search every morning. Send each run to Google Sheets, Slack or email with an integration on the task.
- **Watch for changes**: Set **What to return** to *Only notices that are new since the last run*.
- **In bulk**: Combine **Keywords**, **NAICS codes**, **Set-aside codes** and **Agencies** in one run.

### Use it for

- **Bid alerts**: a daily schedule with your NAICS codes, your set-aside (for example `SBA` or `SDVOSBC`) and *Only new*, sent to Sheets, Slack or your CRM
- **Capture planning**: *sources sought* and *presolicitation* notices show what an agency plans to buy before the solicitation opens
- **Competitor and market research**: award notices name the winner and the amount, by agency and code
- **Lead lists for consultants and proposal writers**: which offices buy what you sell and when responses are due

### Input

```json
{
  "keywords": ["cloud", "cybersecurity"],
  "naicsCodes": ["5415"],
  "setAsides": ["SBA", "SDVOSBC"],
  "noticeTypes": ["solicitation", "combined", "sources-sought"],
  "postedWithinDays": 3,
  "maxResults": 200,
  "output": "new"
}
```

- All filters are combined with AND; the entries inside one list are combined with OR. Words on a single keyword line must all appear. Keywords are looked for in the title, the solicitation number and the description.
- **naicsCodes**, **pscCodes** — matched by prefix: `5415` covers `541511` to `541519`, `DA` covers `DA01` and `DA10`.
- **setAsides**: SAM.gov's codes: `SBA`, `SBP`, `8A`, `8AN`, `HZC`, `HZS`, `SDVOSBC`, `SDVOSBS`, `WOSB`, `WOSBSS`, `EDWOSB`, `EDWOSBSS`, `VSA`, `VSS`, `IEE`, `ISBEE`, `BICIV`, and `NONE` for notices marked as not set aside.
- **noticeTypes**: `solicitation`, `combined`, `presolicitation`, `sources-sought`, `special-notice`, `award`, `justification`, `intent-to-bundle`, `surplus-sale`. An amendment counts as the type it amends.
- **agencies**: any text found in the department, agency, office or office code: `veterans affairs`, `army`, `FA8571`.
- **states**: two-letter codes for the place of performance. About a quarter of notices give one, so this filter leaves the rest out.
- **postedWithinDays** (default 7, up to 365) — counted back from the newest day in SAM.gov's file. **respondsWithinDays** — only notices whose response deadline falls in the next N days.
- **activeOnly** (on by default) skips notices SAM.gov marks inactive. **includeDescription** (on by default) can be switched off for smaller rows; the price is the same.
- Results come newest day first, and **maxResults** (default 100, up to 5,000) cuts the list. With *Only new* it is the number of new notices to return: the Actor reads past the notices you have already seen until it has found that many. Notices below the cut-off from the last few days are read and marked as seen, so they do not come back as new in your next run.

"Is it new" is remembered per search — the same keywords, codes, set-asides, notice types, agencies, states and active switch — in a named key-value store in your Apify account, so the second run of the same search already shows `isNew`. Changing *Posted within*, *Maximum notices* or the description switch keeps the same history. A notice counts as new when your previous run did not see it and it was posted no more than 3 days before the newest day in the file that run read: SAM.gov makes the file late in the evening (US Eastern), and notices posted after that with the same date arrive in the next day's file. Notices that your previous run left out because of *Maximum notices* are remembered as seen and do not come back as new.

### Pricing

**$2.00 per 1,000 notices**, plus $0.01 per run. Error rows (SAM.gov's file not answering) are free. With *Only new*, notices you have already seen are skipped and not charged. The $0.01 run-start fee is the one charge every run pays, even one that returns nothing.

### Notes

- Source: the public **Contract Opportunities** data file that SAM.gov publishes under [Data Services](https://sam.gov/data-services) (folder *Contract Opportunities → datagov*, marked public). SAM.gov's [terms of use](https://sam.gov/about/terms-of-use) do not allow scraping the website, and say that some SAM.gov data may be downloaded; this Actor downloads only that file and never opens the SAM.gov website or its search. Not affiliated with or endorsed by the U.S. General Services Administration.
- **One day behind.** SAM.gov rebuilds the file once a day (around 03:30 UTC) with the notices posted up to the day before, so a notice posted today shows up in tomorrow's runs. For notices posted in the last hour, look on SAM.gov itself.
- The file lists the newest days first, and the Actor stops reading at the first day outside your *Posted within* window. On 23 Oct 2026 one week was about 20 MB and 5,400 notices; 30 days were 68 MB and 21,975 notices and took 5.6 seconds to read on a home connection.
- No contact persons are returned: the file's ten contact fields (titles, names, emails, phones, faxes) are never read into a row, the place-of-performance street line is left out because it often holds an office address with a person's name, and email addresses and phone numbers inside descriptions are removed. Free text can still mention a person, so check descriptions before you republish them.
- In the 20,000 newest notices on 23 Oct 2026, 88% had a description, 34% had a set-aside other than none, and 26% gave a place-of-performance state. Award amounts appear only on award notices.
- The file mixes two text encodings (Windows-1252 and UTF-8); each field is decoded on its own, so quotes and dashes come out as typed.
- If the file cannot be downloaded, the Actor waits and retries twice. If it still gets nothing it adds a free error row and the run is marked failed.

For awards already made with full spending detail, see [USAspending Scraper](https://apify.com/northbell/usaspending-awards-scraper). For federal grants rather than contracts, see [Grants.gov Scraper](https://apify.com/northbell/grants-gov-opportunities-scraper). For public tenders in the EU, see [EU Tenders Scraper (TED)](https://apify.com/northbell/eu-tenders-ted-search).

### For AI agents

`{"keywords": ["software"], "postedWithinDays": 3, "maxResults": 5}` returns up to 5 rows, newest day first, each with agency, notice type, set-aside, NAICS code and response deadline. Rows have `type`: `opportunity` or `error`. Fields that do not apply to a notice are `null`, never missing. Schedule the same input daily with `"output": "new"` to get only what was posted since the previous run.

# Actor input Schema

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

Words to find in the notice title, solicitation number or description. One per line; a notice that matches any line is returned. Words on one line must all appear. Case does not matter. Leave empty to skip.

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

Only notices under these industry codes, one per line, 2 to 6 digits. A shorter code includes everything under it: 5415 covers 541511, 541512, 541513 and 541519 (computer services). Leave empty for all.

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

Only notices under these Product Service Codes (PSC, the 'classification code'), one per line, matched by prefix: DA covers DA01 and DA10 (IT and telecom services), 70 covers IT equipment, R4 professional services. Leave empty for all.

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

Only notices reserved for these kinds of businesses, one code per line: SBA total small business, SBP partial small business, 8A and 8AN 8(a), HZC and HZS HUBZone, SDVOSBC and SDVOSBS service-disabled veteran-owned, WOSB and WOSBSS women-owned, EDWOSB and EDWOSBSS economically disadvantaged women-owned, VSA and VSS veteran-owned, IEE and ISBEE Indian economic enterprise, BICIV Buy Indian, NONE notices marked as not set aside. Leave empty for all, including notices with no set-aside.

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

Only these kinds of notices, one per line: solicitation, combined (combined synopsis/solicitation), presolicitation, sources-sought, special-notice, award, justification, intent-to-bundle, surplus-sale. An amendment counts as the type it amends. Leave empty for all.

## `agencies` (type: `array`):

Only notices whose department, sub-tier agency, office or office code contains this text, one per line, case does not matter: "veterans affairs", "army", "NASA", "FA8571". Leave empty for all agencies.

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

Only notices whose place of performance is in these US states, one two-letter code per line (VA, TX, DC…). Notices that give no place of performance are left out when you set this. Leave empty for all.

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

Only notices posted in the last N days, counted back from the newest day in SAM.gov's data file (the file is rebuilt once a day with the notices up to the day before). Each week back is about 20 MB of the file and a few seconds. Run it daily with 2 or 3 and "Only new" below for a cheap feed of fresh notices.

## `respondsWithinDays` (type: `integer`):

Only notices whose response deadline falls between now and N days from now. Notices with no deadline (most award notices) are left out when you set this. Leave empty to skip.

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

On: skip notices SAM.gov marks as inactive (archived or cancelled). Off: return them too.

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

On: each row carries the notice's full description text (email addresses and phone numbers removed). Off: smaller rows without it. The price is the same.

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

How many notices to return, newest day first. You pay per notice returned. With "Only new" the Actor reads past the notices you have already seen until it has found this many new ones.

## `output` (type: `string`):

With "Only new", notices you already got in an earlier run of the same search are skipped and not charged. The first run returns everything, because there is nothing to compare with yet.

## Actor input object example

```json
{
  "keywords": [
    "software"
  ],
  "postedWithinDays": 3,
  "activeOnly": true,
  "includeDescription": true,
  "maxResults": 50,
  "output": "all"
}
```

# Actor output Schema

## `notices` (type: `string`):

Agency, dates, codes, set-aside and award details for each notice.

# 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": [
        "software"
    ],
    "postedWithinDays": 3,
    "maxResults": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("northbell/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 = {
    "keywords": ["software"],
    "postedWithinDays": 3,
    "maxResults": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("northbell/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 '{
  "keywords": [
    "software"
  ],
  "postedWithinDays": 3,
  "maxResults": 50
}' |
apify call northbell/sam-gov-contract-opportunities --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,northbell/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/nsm8REfqlkjeHUruP/builds/EjVSrPR143rZQFikJ/openapi.json
