# SAM.gov Scraper - Search US Federal Contract Opportunities (`kadi_bence/sam-gov-scraper`) Actor

Search US federal contract opportunities, RFPs and awards on SAM.gov (no API key). Input: keywords, notice types, NAICS/PSC codes, set-asides, agencies, states, posted dates. Returns per notice: title, agency, NAICS, set-aside, response deadline, place of performance, URL. Default: 20 notices.

- **URL**: https://apify.com/kadi_bence/sam-gov-scraper.md
- **Developed by:** [Bence Kadi](https://apify.com/kadi_bence) (community)
- **Categories:** Lead generation, Automation, Marketing
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.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 Scraper: US federal contract opportunities and awards

Export **US federal contract opportunities** from **SAM.gov** to JSON, CSV or Excel: solicitations (RFP, RFQ, IFB), sources sought, presolicitations and **award notices with awardee and amount**. One clean row per notice, with NAICS, PSC, set-aside, agency, deadline and full description. **No SAM.gov account and no API key needed.**

### What is the SAM.gov Scraper?

SAM.gov is the US government's official system for federal contracting, run by the General Services Administration (GSA). This Actor reads SAM.gov's official public daily data extract (all ~75,000 active notices), applies your filters and returns a flat, ready-to-use table. It never scrapes the SAM.gov website or its internal search API.

**Who uses it and why:**

- **GovCon BD and capture teams** get a daily list of new solicitations in their NAICS/PSC codes and set-asides, in Sheets, Slack or their CRM.
- **Small businesses (8(a), SDVOSB, WOSB, HUBZone)** find set-aside bids they can still answer.
- **Competitive intelligence analysts** see who wins which contracts, from which agency and for how much.
- **Subcontractors** find primes that just won work in their niche.
- **Market researchers and consultants** measure federal demand by agency, NAICS, PSC and set-aside.
- **Bid-matching platforms and AI agents** get a clean, fresh feed of federal opportunities.

#### Data fields

Examples are from a real run on 2026-10-05; award examples are from a real award notice.

| Field | Description | Example |
|---|---|---|
| `noticeId` | SAM.gov notice ID (unique) | `bdbcdd102ebf46f390232d94b7e58e6a` |
| `title` | Notice title | `GAOA Trujillo Meadows Old Toilet Building Replacement RGNF` |
| `solicitationNumber` | Solicitation number used by the agency | `1240LP26Q0199` |
| `noticeType` | Notice type as shown on SAM.gov | `Combined Synopsis/Solicitation` |
| `noticeTypeCode` | Short SAM.gov type code | `k` |
| `baseType` | Type of the original notice | `Combined Synopsis/Solicitation` |
| `active` | Whether the notice is still active | `true` |
| `postedDate` | Date the notice was posted | `2026-10-02` |
| `responseDeadline` | Deadline for offers or responses, with time zone | `2026-10-07T17:00:00-07:00` |
| `archiveDate` | Date SAM.gov archives the notice | `2026-10-22` |
| `department` | Department or independent agency | `AGRICULTURE, DEPARTMENT OF` |
| `subTier` | Agency below the department | `FOREST SERVICE` |
| `office` | Buying office | `Rio Grande National Forest` |
| `agencyCode` | CGAC agency code | `012` |
| `officeCode` | Office code (AAC) | `1282AK` |
| `naicsCode` | NAICS industry code | `332311` |
| `pscCode` | Product / service code (PSC) | `5410` |
| `setAsideCode` | Set-aside code (empty = no set-aside) | `SBA` |
| `setAside` | Set-aside in plain English | `Total Small Business Set-Aside (FAR 19.5)` |
| `placeOfPerformance` | Place of performance as one line | `Del Norte, CO 81132, USA` |
| `placeOfPerformanceCity` | City where the work is done | `Del Norte` |
| `placeOfPerformanceState` | State where the work is done | `CO` |
| `placeOfPerformanceZip` | ZIP code where the work is done | `81132` |
| `placeOfPerformanceCountry` | Country where the work is done | `USA` |
| `officeCity` | City of the buying office | `MONTE VISTA` |
| `officeState` | State of the buying office | `CO` |
| `officeZip` | ZIP code of the buying office | `81144` |
| `officeCountry` | Country of the buying office | `USA` |
| `awardNumber` | Contract award number (award notices) | `36C26127P0051` |
| `awardDate` | Award date (award notices) | `2026-10-02` |
| `awardAmount` | Awarded amount in USD (award notices) | `39596.7` |
| `awardee` | Winning company (award notices) | `DME SERVICES LLC` |
| `awardeeOmitted` | `true` if the awardee was left out (see FAQ) | `false` |
| `description` | Full description, e-mails and phones removed | `This is a combined synopsis/solicitation ...` |
| `url` | Notice page on sam.gov | `https://sam.gov/opp/bdbcdd102ebf46f390232d94b7e58e6a/view` |
| `additionalInfoLink` | Extra link given by the agency, if any | `null` |
| `attachments` | Attachment links (API mode only) | `[]` |
| `source` | Where the item came from | `sam.gov daily extract` |
| `isNew` | Only in monitoring mode: `true` for notices not seen before | `true` |
| `scrapedAt` | When the Actor saved the item (UTC) | `2026-10-05T02:08:53Z` |

**Use cases:** Generate leads (build B2B prospect lists) · Research markets & competitors (find deals & buy opportunities, build market datasets, track competitors) · Developer tools (extract government & public data, monitor & alert on website changes).

### How to use the SAM.gov scraper

1. Open the Actor and click **Try for free** (you need a free Apify account).
2. Pick **Notice types**: solicitations are open bids, award notices show who won.
3. Optionally add **NAICS codes**, **PSC codes**, **Set-aside types**, **Agencies** or **Keywords**.
4. Set a date window, for example **Posted within the last N days** = 7.
5. Set **Max results** (prefill: 20, a few seconds) and click **Start**.
6. Download the results from the **Output** tab as CSV, Excel or JSON, or send them to Google Sheets.
7. For alerts, turn on **Only new opportunities** and add a daily **Schedule** (see below).

#### Input guide

**Keywords.** Searched in the title, solicitation number and full description. One line = all its words must appear (`cloud migration`); a line in quotes = exact phrase (`"janitorial services"`); several lines = any of them. Words match from the start, so `cyber` also finds "cybersecurity".

- Good: `cybersecurity`, `"janitorial services"`, `HVAC`, a solicitation number.
- Bad: a sentence like `we sell IT services to the Army`. Every word must appear, so it rarely matches. Use short terms plus NAICS or PSC codes.

**Notice types.** Leave empty for all. For bids you can answer now, pick `solicitation` and `combined_synopsis_solicitation`; add `sources_sought` and `presolicitation` to hear about work before it is posted; `award_notice` for winners.

**NAICS codes.** Industry code. Prefixes work: `5415` returns every 5415xx code, `23` all construction.

- Good: `541511` (custom programming), `5415`, `236220` (commercial building construction).
- Bad: `5` or `5415110`. A NAICS code must have 2 to 6 digits; anything else stops the run with a clear error.
- Tip: run a keyword search first and look at `naicsCode` and `pscCode` in the results to find your codes.

**PSC codes.** Product or service code, 1 to 4 characters. Prefixes work: `D3` returns all D3xx codes (IT services), `R4` all R4xx codes (professional support).

**Set-aside types.** `SBA` (total small business), `SBP` (partial), `8A`, `HZC` (HUBZone), `SDVOSBC`, `WOSB`, `EDWOSB`, `VSA` and more, plus `NONE` for full and open competition. Codes ending in S or SS are sole source. About a third of notices carry a set-aside.

**Agencies / offices.** Words from the department, agency or office name, or an abbreviation: `Veterans Affairs`, `VA`, `Navy`, `USACE`, `NIH` and `DHS` all work. Several lines = any of them. A single word also matches the agency or office code, such as `036`.

**Place of performance (US states).** 2-letter codes such as `VA`, `MD`, `DC`. Warning: only about 1 in 3 notices lists a place-of-performance state. Turn on **Use the contracting office's state** to fall back to the buying office's state.

**Date window.** **Posted within the last N days** for rolling searches (`7` = the last week, `1` = yesterday and today), or **Posted from / to** for a fixed period. If you set both, the later start date applies. Short windows are faster: the extract is sorted newest first, so the Actor stops reading early.

**Response deadline on or after.** Only bids you can still answer. Accepts a date, `today` or `+7 days`. Notices without a deadline, such as most award notices, are left out.

**Min award amount (USD).** Only award notices with at least this amount.

**Max results.** Stop after N opportunities. `0` = no limit. This is also your cost cap: 1,000 opportunities cost $1.50.

**Only new opportunities (monitoring mode).** The Actor remembers which notices it returned and outputs only new ones on the next run with the same filters. You pay only for new notices. Notices cut off by **Max results** come in the next run. Use a different **Monitor name** for each saved search; changing any filter also starts a new list.

**Advanced: API key, data source, attachments.** Your own free SAM.gov key unlocks archived notices (`activeOnly: false`) and attachment links (`includeAttachments: true`) through the official API; with **Data source** = `auto`, the API is used only for those. In API mode, each description costs one request of your key's quota. No proxy is needed.

#### Input example: small-business IT bids you can still answer

```json
{
  "noticeTypes": ["solicitation", "combined_synopsis_solicitation", "sources_sought"],
  "naicsCodes": ["5415", "518210"],
  "setAsideTypes": ["SBA", "8A", "SDVOSBC", "WOSB"],
  "postedWithinDays": 7,
  "responseDeadlineAfter": "today",
  "maxResults": 500,
  "onlyNewOpportunities": true
}
```

### Output

Each notice is one item in the run's dataset. This is a real combined synopsis/solicitation from a run on 2026-10-05 (the description is shortened here; the dataset holds the full text):

```json
{
  "noticeId": "bdbcdd102ebf46f390232d94b7e58e6a",
  "title": "GAOA Trujillo Meadows Old Toilet Building Replacement RGNF",
  "solicitationNumber": "1240LP26Q0199",
  "noticeType": "Combined Synopsis/Solicitation",
  "noticeTypeCode": "k",
  "baseType": "Combined Synopsis/Solicitation",
  "active": true,
  "postedDate": "2026-10-02",
  "responseDeadline": "2026-10-07T17:00:00-07:00",
  "archiveDate": "2026-10-22",
  "department": "AGRICULTURE, DEPARTMENT OF",
  "subTier": "FOREST SERVICE",
  "office": "Rio Grande National Forest",
  "agencyCode": "012",
  "officeCode": "1282AK",
  "naicsCode": "332311",
  "pscCode": "5410",
  "setAsideCode": "SBA",
  "setAside": "Total Small Business Set-Aside (FAR 19.5)",
  "placeOfPerformance": "Del Norte, CO 81132, USA",
  "placeOfPerformanceCity": "Del Norte",
  "placeOfPerformanceState": "CO",
  "placeOfPerformanceZip": "81132",
  "placeOfPerformanceCountry": "USA",
  "officeCity": "MONTE VISTA",
  "officeState": "CO",
  "officeZip": "81144",
  "officeCountry": "USA",
  "awardNumber": null,
  "awardDate": null,
  "awardAmount": null,
  "awardee": null,
  "awardeeOmitted": false,
  "description": "This RFQ is herein cancelled and is being reissued. ... Solicitation number 1240LP26Q0199 is issued as a Request for Quotation (RFQ) for vaulted toilets placed in a remote outdoor setting ... This acquisition is a Total Small Business Set-Aside. ...",
  "url": "https://sam.gov/opp/bdbcdd102ebf46f390232d94b7e58e6a/view",
  "additionalInfoLink": null,
  "attachments": [],
  "source": "sam.gov daily extract",
  "scrapedAt": "2026-10-05T02:08:53Z"
}
```

Award notices also fill `awardee`, `awardAmount`, `awardDate` and `awardNumber` (see the field table). Items from API mode have `source: "api.sam.gov"` and can include `attachments` links.

**Fill rates** in a live sample of 2,000 recent notices: title and agency 100%, NAICS 95%, PSC 96%, office state 99%; deadline and description 100% for open bids; award amount 99% and awardee 98% for awards; place of performance only 46%.

**Dataset views.** The **Output** tab shows three tables:

- **Opportunities**: date, title, type, agency, NAICS, PSC, set-aside, deadline, place, link. Best for daily review.
- **Awards**: award date, title, agency, awardee, amount, award number, NAICS, link. Best for competitor analysis.
- **Full details**: IDs, title, description, office, archive date, links, attachments.

Every run also saves a **Run summary** (`RUN_SUMMARY` in the key-value store): source used, rows scanned, matches, opportunities saved, notices skipped in monitoring mode, MB downloaded, the extract's timestamp and any error.

**Export.** Download any view as JSON, CSV, Excel, XML, HTML or RSS from the Output tab or the API. You can also send results straight to Google Sheets with the Google Sheets integration.

### Pricing

This Actor uses **pay per event**: **$1.50 per 1,000 opportunities** saved ($0.0015 per opportunity). Apify also charges a start fee of **$0.00005 per run**. Platform compute is included in the price.

| Typical run | Opportunities | Cost |
|---|---|---|
| First test with the prefilled input | 20 | about $0.03 |
| Weekly export for one NAICS area | 500 | about $0.75 |
| Daily alert, about 40 new notices a day, for 30 days | 1,200 | about $1.80 per month |
| Every active notice on SAM.gov, no filters | about 75,000 | about $112 |

**What is free:**

- In monitoring mode, notices that were already returned in earlier runs are skipped and not charged.
- A search with no matches costs only the $0.00005 start fee, even when it scans the whole extract.
- Apify's free plan gives you monthly platform credit (see apify.com/pricing), enough for a few thousand opportunities each month.

You can cap spending with **Max results** or with **Max charge per run** in the run options. When the cap is reached, the Actor stops cleanly and keeps what it already saved.

### Use it via API

Replace `MY_APIFY_TOKEN` with your token from Apify Console > Settings > API & Integrations.

**JavaScript / Node.js** (`npm install apify-client`):

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'MY_APIFY_TOKEN' });
const run = await client.actor('kadi_bence/sam-gov-scraper').call({
    noticeTypes: ['solicitation', 'combined_synopsis_solicitation'],
    naicsCodes: ['5415'],
    setAsideTypes: ['SBA', 'SDVOSBC'],
    postedWithinDays: 7,
    responseDeadlineAfter: 'today',
    maxResults: 500,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.length, items[0]?.title);
```

**Python** (`pip install apify-client`):

```python
from apify_client import ApifyClient

client = ApifyClient("MY_APIFY_TOKEN")
run = client.actor("kadi_bence/sam-gov-scraper").call(run_input={
    "noticeTypes": ["award_notice"],
    "agencies": ["Veterans Affairs"],
    "postedWithinDays": 30,
    "maxResults": 1000,
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["awardee"], item["awardAmount"], item["subTier"], item["title"])
```

**cURL** (runs the Actor and returns the items in one call):

```bash
curl -X POST "https://api.apify.com/v2/acts/kadi_bence~sam-gov-scraper/run-sync-get-dataset-items?token=MY_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"pscCodes": ["D3"], "noticeTypes": ["solicitation", "sources_sought"], "postedWithinDays": 1, "maxResults": 100}'
```

**Apify CLI:**

```bash
apify call kadi_bence/sam-gov-scraper --input '{"keywords": ["\"janitorial services\""], "placeOfPerformanceStates": ["VA", "MD", "DC"], "stateFallbackToOffice": true, "postedWithinDays": 14, "maxResults": 50}' --output-dataset
```

**MCP (AI agents such as Claude, Cursor or VS Code).** Add this to your MCP client config. The client will ask you to sign in to Apify (or send your token as an `Authorization: Bearer` header):

```json
{"mcpServers":{"apify":{"url":"https://mcp.apify.com/?actors=kadi_bence/sam-gov-scraper"}}}
```

Then ask your agent things like "Find open SDVOSB set-aside solicitations for IT services posted this week".

### Integrations and scheduling

- **Schedules.** In Apify Console go to **Schedules > Create new**, pick this Actor (or a saved task) and set a time after 03:30 UTC, when SAM.gov rebuilds the extract.
- **Webhooks.** Call your own URL when a run succeeds or fails, and fetch the new items from the dataset.
- **Zapier, Make and n8n.** Use the Apify app or node: "Run Actor" as an action, or "Actor run finished" as a trigger, then send rows to your CRM, Slack, Teams or e-mail.
- **Google Sheets.** Use the Google Sheets integration on the Actor's **Integrations** tab to append each run's results to a sheet.

**Recipe: new set-aside bids in my codes every morning**

1. Set NAICS or PSC codes, **Set-aside types** (for example `SDVOSBC`), **Notice types** = Solicitation + Combined synopsis/solicitation, **Posted within the last N days** = 2, **Response deadline on or after** = `+7 days`.
2. Turn on **Only new opportunities** with a monitor name such as `it-sdvosb`.
3. **Save as a new task** and schedule it every day at 07:00.
4. Connect it to Google Sheets, or to Slack through Make, Zapier or n8n. Each morning you get only unseen notices.

**Recipe: weekly competitor wins.** Notice types = Award notice, your NAICS codes and agencies, **Min award amount** = `100000`, **Posted within the last N days** = 7, weekly schedule, export the **Awards** view to a sheet.

### Related actors by the same developer

- [EU Public Tenders Scraper (TED)](https://apify.com/kadi_bence/ted-tenders-scraper): EU and European public tenders and contract awards from TED, with CPV, NUTS and value filters.
- [UK & Australia Tenders Scraper](https://apify.com/kadi_bence/gov-tenders-scraper): UK Find a Tender, UK Contracts Finder and AusTender notices and awards.

### FAQ

**How does it work, and where does the data come from?**
By default the Actor streams SAM.gov's **Contract Opportunities public data extract** (SAM.gov Data Services), filters each row and stops early once your date window is passed. Optionally it uses the **official Get Opportunities API** with your own key. SAM.gov's Terms of Use name these APIs and extracts as the way to access data automatically and prohibit scraping the website, so this Actor never touches the website or its internal search API. Notices are US federal government information and generally public domain; the extract comes as is. When you publish the data, we suggest citing "Source: SAM.gov, U.S. General Services Administration". This Actor is not affiliated with or endorsed by GSA or SAM.gov.

**Do I need a SAM.gov API key?**
No, not for active notices. A key is only needed for archived notices and attachment links. Get one on SAM.gov under Account Details > Public API Key. A personal key allows **10 requests per day** (1,000 notices each), or 1,000 with a SAM.gov role, and expires every 90 days. It is stored encrypted and never written to logs, the dataset or `RUN_SUMMARY`.

**Are there limits?**
There is no 10,000-result cap: every active notice (about 75,000) is in the extract. In API mode, your key's daily quota is the limit; the Actor stops cleanly when it is used up and tells you so. API searches without dates cover the last 365 days.

**How fast is it?**
In our tests the prefilled run (20 results) took about 3 seconds, and 2,000 notices took 6 to 10 seconds. A search with no date filter reads the whole 210 MB file: about 1.5 minutes from Europe, faster on Apify's US servers.

**How fresh is the data?**
SAM.gov rebuilds the extract every night (around 03:30 UTC). Notices posted today appear in tomorrow's extract, so a daily schedule catches everything. `RUN_SUMMARY.extractLastModified` shows the extract's timestamp.

**Why are my results different from the SAM.gov website?**
Common reasons: NAICS and PSC codes match as prefixes here; the extract holds only active notices; today's notices reach the extract the next night; and the state filter uses the place of performance, which agencies often leave empty (turn on `stateFallbackToOffice`). The Actor never invents values. Check `RUN_SUMMARY` for rows scanned and matches.

**Is it legal? What about personal data?**
Yes, the data is official public information, read through official channels. Contracting officers' names, e-mails and phone numbers are never output; e-mails and phone numbers inside descriptions become `[email removed]` and `[phone removed]`. Awardees that look like private persons are left out (`awardeeOmitted: true`, about 2% of awards), as are awardees on awards dated before April 4, 2022, which may contain Dun & Bradstreet data that SAM.gov's terms do not allow to share in bulk. Descriptions can still name people, so handle the data in line with the privacy laws that apply to you (for example GDPR).

**Can I use it from Python or another program?**
Yes. See **Use it via API** above for JavaScript, Python, cURL, the Apify CLI and MCP for AI agents.

**Can I connect it to Google Sheets, Slack or my CRM?**
Yes, through the Google Sheets integration, webhooks, or the Apify apps for Zapier, Make and n8n. See **Integrations and scheduling**.

**How does "Only new opportunities" work?**
The Actor stores delivered notice IDs in a named key-value store (`sam-gov-monitor`) in your account. The next run with the same filters and monitor name outputs only notices not in that list, marked `isNew: true`, and you pay only for those.

**What if a run fails or something looks wrong?**
Invalid input (for example a 7-digit NAICS code) fails the run at once with a clear message. If SAM.gov is down, the Actor retries several times; it then keeps what it saved and says why it stopped (or fails if nothing was saved). `RUN_SUMMARY` holds the details. Please open an issue on the **Issues** tab with the run link. Fixes usually land within 24 to 48 hours.

**What changed recently?**
See the changelog below.

### Need a custom version?

I build custom scrapers, scheduled data feeds and integrations (CSV, Excel, Google Sheets, API, MCP for AI agents). Tell me the sites and fields you need:

- Email: bence.kadi@gmail.com
- Apify profile: https://apify.com/kadi_bence

### Related Actors

More low-cost Actors by the same developer, built on official APIs and public data:

- [TED Tenders Scraper](https://apify.com/kadi_bence/ted-tenders-scraper) — EU public tenders and contract award winners
- [UK & Australia Tenders Scraper](https://apify.com/kadi_bence/gov-tenders-scraper) — government contracts from the UK and Australia
- [New Business Filings USA](https://apify.com/kadi_bence/us-new-business-filings) — newly registered LLCs and companies
- [SEC Form D Scraper](https://apify.com/kadi_bence/sec-form-d-funding) — new startup funding rounds from SEC EDGAR
- [Document to Markdown](https://apify.com/kadi_bence/document-to-markdown) — PDF, Word, PowerPoint and Excel to clean Markdown, with OCR
- [Website Tech Stack Detector](https://apify.com/kadi_bence/tech-stack-detector) — CMS, ecommerce, analytics and frameworks of any website
- [Bulk WHOIS & RDAP Domain Lookup](https://apify.com/kadi_bence/domain-whois-lookup) — registrar, dates and DNS for many domains

All my Actors: [apify.com/kadi_bence](https://apify.com/kadi_bence)

### Changelog

- **1.0 (2026-10-05):** First release.
  - Keyless official SAM.gov daily extract, with an optional official API for archived notices and attachment links.
  - NAICS and PSC prefixes, agency aliases, set-aside, state and deadline filters.
  - Award fields and monitoring mode.
  - No contact personal data.

# Actor input Schema

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

Searched in the title, solicitation number and full description. One line = all its words must appear (e.g. 'cloud migration'); put a line in quotes for an exact phrase ("janitorial services"). Several lines = any of them. Leave empty to get every notice that matches the other filters.

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

Leave empty for all types. 'Solicitation' and 'Combined synopsis/solicitation' are open bids; 'Award notice' shows who won and for how much.

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

Industry codes, e.g. 541511 (custom programming) or 236220 (commercial construction). Prefixes work: 5415 returns every 5415xx code, 23 all construction.

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

e.g. D302 (IT systems development), R425 (engineering support), 7030 (software). Prefixes work: D3 returns all D3xx codes.

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

Small-business set-asides. Leave empty for all. 'No set-aside' = full and open competition.

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

Words from the department, agency or office name, e.g. 'Veterans Affairs', 'Navy', 'Army Corps of Engineers', or an abbreviation (DOD, VA, GSA, DHS, NASA, HHS, NIH, USDA...). Several lines = any of them.

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

2-letter state codes. Note: only about 1 in 3 notices lists a place-of-performance state; tick the option below to fall back to the contracting office's state.

## `stateFallbackToOffice` (type: `boolean`):

Broadens the state filter: notices without a place-of-performance state are matched on the state of the buying office.

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

e.g. 7 for the last week, 1 for yesterday and today. Leave empty to use the date range below (or no date limit). Short windows are also faster.

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

First posted date (YYYY-MM-DD).

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

Last posted date (YYYY-MM-DD).

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

Only bids you can still answer: notices whose response deadline is on or after this date (notices without a deadline are left out). Accepts YYYY-MM-DD, 'today' or '+7 days'.

## `minAwardAmount` (type: `integer`):

Only award notices with at least this awarded amount. Leave empty for all notices.

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

Archived (inactive) notices are only available with your own SAM.gov API key (see Advanced).

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

Stop after this many opportunities. 0 = no limit (there is no 10,000 cap). The default without input (API, MCP and AI-agent calls) is 20.

## `onlyNewOpportunities` (type: `boolean`):

Remember returned notices and output only NEW ones on the next runs with the same search. Ideal for a daily schedule: you only pay for new opportunities.

## `monitorName` (type: `string`):

Keeps separate 'already seen' lists for different schedules.

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

Not needed for active notices. Your own free public API key from SAM.gov (Account Details > Public API Key) unlocks archived notices and attachment links through the official Get Opportunities API. Personal keys allow 10 requests per day (1,000 records each). Stored encrypted, never logged.

## `dataSource` (type: `string`):

Auto: the keyless official daily extract of all active notices; the official API (needs your key) only when you ask for archived notices or attachment links.

## `includeAttachments` (type: `boolean`):

Adds direct download links to the notice's documents (RFP, SOW, amendments). Uses the official API, so it needs your key.

## `fetchDescriptions` (type: `boolean`):

The official API returns descriptions as separate links: each one costs one request of your key's daily quota. The keyless extract always includes descriptions.

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

Not needed: SAM.gov publishes this data as official open data.

## Actor input object example

```json
{
  "noticeTypes": [
    "solicitation",
    "combined_synopsis_solicitation"
  ],
  "stateFallbackToOffice": false,
  "postedWithinDays": 7,
  "activeOnly": true,
  "maxResults": 20,
  "onlyNewOpportunities": false,
  "monitorName": "default",
  "dataSource": "auto",
  "includeAttachments": false,
  "fetchDescriptions": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `opportunities` (type: `string`):

All scraped opportunities (table view).

## `awards` (type: `string`):

Award notices with awardee and amount.

## `opportunitiesFull` (type: `string`):

All scraped opportunities with every field.

## `summary` (type: `string`):

Source used, rows scanned, matches, opportunities saved and any problems.

# 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": [
        "solicitation",
        "combined_synopsis_solicitation"
    ],
    "postedWithinDays": 7,
    "maxResults": 20,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("kadi_bence/sam-gov-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 = {
    "noticeTypes": [
        "solicitation",
        "combined_synopsis_solicitation",
    ],
    "postedWithinDays": 7,
    "maxResults": 20,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("kadi_bence/sam-gov-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 '{
  "noticeTypes": [
    "solicitation",
    "combined_synopsis_solicitation"
  ],
  "postedWithinDays": 7,
  "maxResults": 20,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call kadi_bence/sam-gov-scraper --silent --output-dataset

```

## MCP server setup

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