# SAM.gov Federal Contract Opportunities & RFPs (Free) (`busy_courtyard/sam-gov-opportunities`) Actor

Free SAM.gov federal contract opportunities and government contracts: RFPs, solicitations, sources sought, awards. Filter by NAICS, PSC, set-aside, agency, date. Official extract, no API key.

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

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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 Federal Contract Opportunities & RFPs (Free)

Get U.S. **federal contract opportunities** and **government contracts** from **SAM.gov** as clean JSON, CSV or Excel: RFPs, solicitations, presolicitations, sources sought, combined synopsis/solicitations and award notices. The data comes from the **official public Contract Opportunities extract that GSA publishes on SAM.gov's Data Services page**, so it needs no SAM.gov API key and no login. Filter by keyword, NAICS code, PSC code, set-aside (8(a), SDVOSB, WOSB, HUBZone, small business), notice type, agency, place of performance and dates, or ask for only the notices that are **new since your last run** for daily bid alerts.

**Free to use.** This actor has no per-result or rental fee. You pay only Apify's normal platform usage (compute), which a typical 7-day search keeps to a few seconds of runtime.

**Who it's for:** government contractors, GovCon business development and capture teams, bid/RFP consultants, small businesses looking for set-aside work, and researchers analysing federal procurement.

### Compliance first

- **Official source only.** The actor downloads one file: `ContractOpportunitiesFullCSV.csv` from [SAM.gov Data Services](https://sam.gov/data-services) (hosted at `falextracts.s3.amazonaws.com`). It never touches the SAM.gov website search, its internal API, or any login.
- **What SAM.gov's [Terms of Use](https://sam.gov/about/terms-of-use) say** (quoted 2026-10-18):

  - "SAM.gov makes certain data available via APIs and extracts with URLs "https://open.gsa.gov/api/" and "https://sam.gov/data-services." Automated data gathering, web scraping tools are prohibited and, if detected, will result in the associated account(s) being denied access to SAM.gov via Login.gov."
  - "You may also download some SAM.gov data."
  - "Most material on our site is free of copyright and may be copied and distributed without permission. Works produced by federal government employees in the course of their employment are generally not protected by copyright and are in the public domain in the U.S."

  This actor uses the extract route the terms point to, and does no scraping.
- **Personal contact data removed.** The file has 10 point-of-contact columns: names, titles, emails, phone and fax numbers of contracting staff. **All 10 are dropped the moment each record is read**, so they never reach your dataset, the logs or storage. Email addresses and phone numbers that appear *inside* titles and descriptions are masked as `[email removed]` and `[phone removed]`, and `mailto:` links are dropped. Names written next to contact details ("Contracting Officer: Jane Doe", "Attn: Jane Doe", "Jane Doe, \[email]") are masked as `[name removed]`. A test in the code proves the contact values never reach the output.
- **D\&B-restricted awardee data withheld.** SAM.gov's terms say award notices with an award date before 4 April 2022 may contain Dun & Bradstreet data, which may not be redistributed in bulk. For those awards the awardee name is left out, and `awardeeWithheldReason` says why.

### Reliable by design

- **A government bulk file, not a scraped web page.** No browser, no proxies, no CAPTCHAs, and nothing breaks when the website's layout changes.
- **Fails loudly instead of returning an empty "success".** The run fails with a clear error code if:
  - the file is missing or tiny: `EXTRACT_UNAVAILABLE`, `EXTRACT_EMPTY`;
  - it is older than `maxFileAgeHours` (72 by default): `EXTRACT_STALE`;
  - its columns were added, removed, renamed or reordered: `COLUMNS_CHANGED`;
  - the download was cut off, or the file ends in the middle of a record: `EXTRACT_TRUNCATED`;
  - GSA replaced the file while it was being read: `EXTRACT_CHANGED`;
  - it has many damaged rows: `EXTRACT_MALFORMED`;
  - a full read finds far fewer notices than normal: `EXTRACT_EMPTY`.
- **Nothing is saved until the file passes those checks.** You never get half a result.
- **Resumes, never restarts.** If the connection drops, the download continues from the last byte, with the file's version tag (ETag) checked so two versions are never mixed.
- **Streams the file.** The ~200 MB file is processed in 256 KB pieces and never held in memory.

### How fresh is the data?

GSA regenerates the file once a day. On 2026-10-18 the copy in use was stamped `Last-Modified: Sun, 18 Oct 2026 03:30:36 GMT`, which is 11:30 PM ET on Saturday. Every row carries `extractLastModified`, so you always know which day's file it came from. For daily monitoring, schedule the actor for the morning, for example 7:00 AM ET. The file is a snapshot, so a notice posted on SAM.gov this afternoon appears in tomorrow's file.

### Use cases

- **Daily bid alerts.** Turn on `newSinceLastRun`, set your NAICS codes and set-asides, and schedule it every morning. You get only notices you haven't seen.
- **Pipeline research.** Use "Sources Sought" and "Presolicitation" notices in your NAICS codes to see what's coming.
- **Award intelligence.** Award notices include award number, date and amount.
- **Spreadsheets and CRMs.** Export to CSV or Excel, or feed the rows to Make, Zapier or n8n through Apify's integrations.

### Input

```json
{
  "keywords": ["cybersecurity", "software"],
  "naicsCodes": ["5415"],
  "setAsideCodes": ["SBA", "SDVOSBC"],
  "postedWithinDays": 7,
  "activeOnly": true,
  "maxResults": 1000
}
```

| Field | Default | Notes |
|---|---|---|
| `keywords` | none | Matches if the title (and description, unless `searchDescription` is false) contains **any** of them. Not case-sensitive. |
| `naicsCodes` / `pscCodes` | none | Prefix match: `5415` matches 541511, 541512… |
| `setAsideCodes` | none | For example SBA, 8A, SDVOSBC, WOSB, EDWOSB, HZC, NONE |
| `noticeTypes` | all | Solicitation, Combined Synopsis/Solicitation, Award Notice, Sources Sought, … |
| `agencies` | none | Text match on department, sub-tier and office (e.g. `NAVY`) |
| `placeOfPerformanceStates` | none | Two-letter codes. Many notices leave this blank, and those won't match. |
| `postedWithinDays` / `postedAfter` | none | **The cheapest filter.** The file is sorted newest first, so reading stops at the cutoff. |
| `responseDeadlineAfter` | none | Notices without a deadline are left out when set |
| `activeOnly` | `true` | Marked Active **and** the response deadline (if any) hasn't passed |
| `includeDescription` | `true` | Full notice text, up to about 32,000 characters, with contacts masked |
| `maxResults` | 1000 | Up to 50,000 |
| `newSinceLastRun` / `stateKey` | `false` / `default` | Remembers delivered notice IDs per `stateKey` in a named key-value store. If the file hasn't changed since the last run, the run ends without downloading anything. |
| `maxFileAgeHours` | 72 | Fail instead of returning stale data |
| `selfTest` | `false` | Health check: ignores other fields, fetches 5 recent notices, fails if key fields are empty |

Deadlines written without a time zone are read as U.S. Eastern time. `responseDeadlineUtc` gives every deadline in UTC.

### Output

A real row from the local run on 2026-10-18 (ET) of the 7-day `cybersecurity`/`software` search. The description is shortened here; the masking shown is the actor's own:

```json
{
  "noticeId": "045e7a7863ff4ef2845155e13504c4c6",
  "title": "INTENT TO SOLE SOURCE - FLASHPOINT INTELLIGENCE CAPABILITIES AND SERVICES",
  "solicitationNumber": "2099AC26N10000",
  "noticeType": "Special Notice",
  "baseType": "Special Notice",
  "postedDate": "2026-10-16T15:14:42",
  "responseDeadline": "2026-10-23T12:00:00-04:00",
  "responseDeadlineUtc": "2026-10-23T16:00:00Z",
  "archiveType": "auto15",
  "archiveDate": "2026-11-07",
  "active": true,
  "department": "TREASURY, DEPARTMENT OF THE",
  "subTier": "DEPARTMENTAL OFFICES",
  "office": "TREASURY OPERATIONS",
  "cgac": "020",
  "fpdsCode": "2001",
  "aacCode": "2032H3",
  "organizationType": "OFFICE",
  "officeLocation": {
    "city": "Washington",
    "state": "DC",
    "zip": "20224",
    "country": "USA"
  },
  "setAsideCode": "NONE",
  "setAside": "No Set aside used",
  "naicsCode": "519290",
  "pscCode": "DH10",
  "placeOfPerformance": {
    "streetAddress": null,
    "city": "Washington",
    "state": "DC",
    "zip": "20220",
    "country": "USA"
  },
  "award": null,
  "samUrl": "https://sam.gov/workspace/contract/opp/045e7a7863ff4ef2845155e13504c4c6/view",
  "additionalInfoUrl": null,
  "description": "Agency U.S. Department of the Treasury Departmental Offices & Enterprise Procurement Branch Treasury Common Services Center Acquisition Services Action Notice of Intent to Award a Sole Source Firm Fixed Price Contract Description The U.S. Department of the Treasury, Departmental Offices & Enterprise … her a competitive procurement should be conducted. Response Deadline Responses must be received no later than 12:00PM EDT on October 23, 2026. Submit responses electronically to: Contracting Officer: [name removed] Email: [email removed] Disclaimer This notice … [shortened in this sample file only]",
  "extractLastModified": "2026-10-18T03:30:36Z",
  "source": "SAM.gov Contract Opportunities public extract (ContractOpportunitiesFullCSV)"
}
```

There are no contact fields at all. Award notices have an `award` object (`number`, `date`, `amount`, `awardee`, `awardeeWithheldReason`). A `RUN_SUMMARY` record in the key-value store shows how many notices were checked and saved, the MB read, and whether reading stopped early.

**Measured locally on 2026-10-18 (ET):**

- `cybersecurity`/`software`, posted in the last 7 days, active only: **315 notices out of 5,950 checked**, 17 MB read (2 blocks), about 4 s.
- NAICS `5415`, active, no date limit (whole file): **372 notices out of 69,781 checked**, 201.8 MB (20 blocks), about 6 s.
- `newSinceLastRun` (last 3 days):
  - 1st run saved 1,819;
  - an immediate 2nd run stopped at once (it reported that there was no new extract since the last run and downloaded nothing);
  - with the file version forced to look new, it re-read and skipped all 1,819 as already delivered.

### Pricing

Free. The actor charges no fees of its own; only Apify's standard platform usage applies. Reading less of the file (for example with `postedWithinDays`) makes a run faster and cheaper in compute.

### Limits and honest caveats

- **Name masking in free text is best-effort.** Contact columns are removed outright, and emails and phone numbers are masked reliably. Names in descriptions are masked by pattern (a name next to a contact cue or a masked email or phone), so a name in ALL CAPS, or one with no cue nearby, can slip through. Set `includeDescription: false` if you need zero free text.
- **Snapshot only.** The data is what the daily file contains, not live SAM.gov. Attachments and documents aren't in the file; use `samUrl` to open the notice.
- **Strict about columns.** If GSA changes the file's columns, the actor stops with `COLUMNS_CHANGED` until it is updated. That is deliberate.
- **Amended notices.** In `newSinceLastRun` mode a notice ID is delivered once. If SAM.gov republishes an amendment under the same ID, it is not sent again.
- This actor is not affiliated with GSA or SAM.gov.

### FAQ

**Is this an official SAM.gov API?** No. It reads the official public daily extract file that GSA links from [SAM.gov Data Services](https://sam.gov/data-services), which SAM.gov's terms point to for bulk data. It is not affiliated with GSA or SAM.gov.

**Do I need a SAM.gov API key or account?** No. The extract is a public download.

**Does it include contracting officer names, emails or phone numbers?** No. All point-of-contact columns are dropped, and emails and phone numbers inside descriptions are masked. If you need a contact, open the notice on SAM.gov through `samUrl`.

**How do I get daily alerts for new federal contract opportunities?** Set your NAICS codes, set-asides or keywords, turn on `newSinceLastRun`, and create a daily schedule for the actor in your own Apify account. Each run returns only notices you haven't received yet.

**Does it include award notices and award amounts?** Yes. Award notices carry an `award` object with number, date and amount (and the awardee where it can be redistributed).

**Does it download attachments or bid documents?** No. Attachments aren't in the extract. Use `samUrl` to open the notice.

**How current is the data?** GSA regenerates the file once a day, so new notices appear the next day. Each row has `extractLastModified`.

**Can I export to Excel, Google Sheets or a CRM?** Yes. Export the dataset as CSV, Excel or JSON, or connect it to Make, Zapier, n8n or the Apify API.

**What does it cost?** The actor itself is free; you pay only Apify platform usage.

# Actor input Schema

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

A notice matches if its title (and description, see below) contains ANY of these words or phrases. Not case-sensitive. Leave empty for no keyword filter.

## `searchDescription` (type: `boolean`):

Off: keywords are matched against titles only (fewer, more precise matches).

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

Industry codes. A shorter code matches every code that starts with it, so 5415 matches 541511, 541512 and so on.

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

Product Service Codes, matched by prefix: D3 matches D302, D399 and so on.

## `setAsideCodes` (type: `array`):

For example SBA (small business), 8A, SDVOSBC (service-disabled veteran-owned), WOSB, EDWOSB, HZC (HUBZone), NONE. A notice matches if it has any of them.

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

Leave empty for all types.

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

Text matched (not case-sensitive) against the department, sub-tier and office, e.g. 'VETERANS AFFAIRS', 'NAVY' or 'FOREST SERVICE'.

## `placeOfPerformanceStates` (type: `array`):

Two-letter codes such as VA, TX or DC. Note: many notices leave the place of performance blank, and those won't match.

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

The quickest filter: the file is sorted newest first, so the actor stops reading once it passes this date and you pay for less data. 0 = no limit. Don't combine with 'Posted on or after'.

## `postedAfter` (type: `string`):

A date (YYYY-MM-DD). Same early-stop benefit as above.

## `responseDeadlineAfter` (type: `string`):

A date (YYYY-MM-DD). Notices without a deadline (for example award notices) are left out when this is set.

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

Keep notices marked Active whose response deadline (if they have one) has not passed yet.

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

The full notice text (up to about 32,000 characters). Email addresses and phone numbers inside it are masked.

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

Stop after this many matching notices. Each notice is billed.

## `newSinceLastRun` (type: `boolean`):

For daily monitoring: remembers which notice IDs were already delivered (in a named key-value store, per 'Monitor name') and skips them. If SAM.gov hasn't published a new file since the last run, the run ends without downloading or charging anything.

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

Keeps separate 'already delivered' lists for different searches. Letters, digits, '-' and '\_' only.

## `maxFileAgeHours` (type: `integer`):

GSA refreshes the file daily. If it is older than this, the run fails instead of returning stale data.

## `maxRetries` (type: `integer`):

How many times to resume the download after a network error.

## `requestTimeoutSecs` (type: `integer`):

How long to wait for the server before retrying.

## `selfTest` (type: `boolean`):

Ignore the other fields, fetch up to 5 of the newest notices, and fail the run if key fields are empty or contact details appear. Meant for a daily health-check schedule.

## Actor input object example

```json
{
  "keywords": [
    "cybersecurity",
    "software"
  ],
  "searchDescription": true,
  "postedWithinDays": 7,
  "activeOnly": true,
  "includeDescription": true,
  "maxResults": 1000,
  "newSinceLastRun": false,
  "stateKey": "default",
  "maxFileAgeHours": 72,
  "maxRetries": 3,
  "requestTimeoutSecs": 120,
  "selfTest": false
}
```

# Actor output Schema

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

One row per result in the default dataset.

## `runSummary` (type: `string`):

Counts of notices checked and saved, MB read, and the extract date.

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

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

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

```

## MCP server setup

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