# SAM.gov Scraper - Federal Contracts, RFPs, Contacts & Awards (`topapi/sam-gov-scraper`) Actor

Scrape SAM.gov federal contract opportunities: solicitations, RFPs, sources sought and award notices with contracting officer e-mail and phone, NAICS/PSC titles, set-aside, deadline, attachments and history. Filters, monitor mode, market counts. No API key. $0.045 per 1,000 notices.

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

## Pricing

from $0.05 / 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

### What does SAM.gov Scraper do?

**SAM.gov Scraper** turns [SAM.gov Contract Opportunities](https://sam.gov/search/?index=opp), where every US federal agency posts the contracts it plans to award, into a dataset: one row per notice with the title, solicitation number, notice type, agency path, posted date and response deadline, plus the full notice record: description, NAICS and PSC codes with their titles, set-aside, the contracting officer's name, e-mail and phone, place of performance, and on award notices the award number, date, amount and the awardee's UEI, CAGE code and location. Add the attachment list (SOW, PWS, pricing sheets, amendments) with download addresses, the version history, or the files themselves.

- **Every notice type:** solicitations, combined synopsis/solicitations (RFQs), presolicitations, sources sought (RFIs), special notices, award notices, justifications, surplus sales and intent-to-bundle notices; active (about 45,000) or archived (5.6 million).
- **Every way in:** keywords (all words, any word or exact phrase), SAM.gov search addresses with your filters, notice ids or addresses, solicitation numbers, a file of ids.
- **Every SAM.gov filter:** notice type, NAICS and PSC codes or prefixes, set-aside, agency (by name or organization id), place of performance state, ZIP code and country, active or archived, posted, updated and response-due date ranges. SAM.gov applies them itself, so only matching notices are read and charged.
- **Our own filters, before any charge:** still open for responses, keywords in the title only, excluded words, award amount range, contact e-mail present, one notice per solicitation.
- **Past the 10,000 limit:** SAM.gov pages one search to 10,000 notices; larger searches are read in date ranges.
- **Summary mode:** counts of matching notices by notice type, set-aside, state, NAICS sector, department or month, without reading them.
- **Monitor mode:** only new notices and amendments on each scheduled run, with alerts to a webhook, Slack or Discord.
- **No SAM.gov account, no API key, no login.** Export as JSON, CSV or Excel, or read it through the Apify API and MCP.

### What data can you get from SAM.gov?

| | | |
|---|---|---|
| 📄 Title, solicitation number, notice id | 🏷️ Notice type, status, active, cancelled, archived | 📅 Posted, updated, response deadline + time zone, days left, archive date |
| 🏛️ Department, agency, office, office code | 📍 Contracting office address | 🔢 NAICS codes + titles, PSC code + title |
| 🎯 Set-aside code + name | 🗺️ Place of performance: address, city, state, ZIP, country | 👤 Contracting officer name, title, e-mail, phone, fax |
| 👥 Every point of contact | 🏆 Award number, date, amount | 🏢 Awardee name, UEI, CAGE code, city, state, ZIP |
| 📝 Full description (text or HTML) | 📎 Attachments and links with download addresses | 🕓 Version history: original, amendments, cancellations |
| 💾 Downloaded files (key-value store) | 🔗 Parent and related notice ids | 🔁 Change type in monitor mode |

### How to scrape SAM.gov with SAM.gov Scraper

1. [Create a free Apify account](https://console.apify.com/sign-up) (you get $5 of free credit every month).
2. Open **SAM.gov Scraper** and type keywords, e.g. `janitorial`, or NAICS codes, or paste a SAM.gov search address.
3. Pick filters (notice types, set-asides, states, dates) and set **Max results**.
4. Leave **Notice record** and **Attachment list** on; turn on **Version history** or **Download attachment files** if you need them.
5. Press **Start**, then download the results from the **Output** tab as JSON, CSV or Excel.

### ⬇️ Input

| Field | What it does |
|---|---|
| `keywords` | Words to search for, e.g. `janitorial`, `cybersecurity`. |
| `keywordMode` | `ALL` words (default), `ANY` word, or the `EXACT` phrase. |
| `searchKeywordsSeparately` | One search per keyword instead of one for all. |
| `keywordScope` | `anywhere` (default) or `title`. |
| `excludeKeywords` | Drop notices whose title or description holds one of these words. |
| `startUrls` | SAM.gov search addresses (`sam.gov/search/?index=opp&...`, your filters are kept) or notice pages (`sam.gov/opp/<id>/view`). |
| `noticeIds` | Notice ids (32 characters) or notice addresses; current or archived. |
| `solicitationNumbers` | Every notice filed under these solicitation numbers. |
| `urlsFromFile` | A text or CSV file of notice ids or addresses. |
| `noticeTypes` | `o` Solicitation, `k` Combined Synopsis/Solicitation, `p` Presolicitation, `r` Sources Sought, `s` Special Notice, `a` Award Notice, `u` Justification, `g` Sale of Surplus Property, `i` Intent to Bundle. Names work too. |
| `naicsCodes` | NAICS codes or prefixes: `541511`, `5415`, `54`. |
| `pscCodes` | PSC codes or prefixes: `R425`, `R4`. |
| `setAsideCodes` | `SBA`, `SBP`, `8A`, `8AN`, `HZC`, `HZS`, `SDVOSBC`, `SDVOSBS`, `WOSB`, `WOSBSS`, `EDWOSB`, `EDWOSBSS`, `LAS`, `IEE`, `ISBEE`, `BICiv`, `VSA`, `VSS`, `NONE`. |
| `agencies` | Department, agency or office names (`Veterans Affairs`, `Defense Logistics Agency`) or organization ids. |
| `states`, `placeOfPerformanceZip`, `countries` | Place of performance: state codes or names, a ZIP code, three-letter country codes. |
| `status` | `active` (default), `inactive` or `all`. |
| `postedFrom` / `postedTo` / `postedWithinDays` | Posted date range, or the last N days. |
| `modifiedFrom` / `modifiedTo` | Updated date range. |
| `responseDeadlineFrom` / `responseDeadlineTo` | Response deadline range (notices without a deadline are left out). |
| `openForResponsesOnly` | Drop notices whose deadline has passed (notices without one stay). |
| `awardedOnly`, `minAwardAmount`, `maxAwardAmount` | Award notices only; award amount range in US dollars. |
| `onlyWithContactEmail` | Only notices that name a contact e-mail. |
| `dedupeBySolicitation` | Only the newest notice of each solicitation number. |
| `maxResults` | Most notices for the run (default 100; 0 = every match). |
| `maxResultsPerSearch` | Most notices per keyword or address. |
| `sortBy` | `newest` (recently updated first, default), `oldest`, `relevance`, `title`, `title_desc`. |
| `includeDetails` | The notice record (description, codes, contacts, award). On by default, in the notice price. |
| `includeDescription`, `descriptionFormat`, `descriptionMaxChars` | Description on/off, `text`, `html` or `both`, and a length limit. |
| `includeAttachments` | The attachment and link list. On by default; charged per notice that has one. |
| `includeHistory` | Every version of the notice. Charged per notice. |
| `downloadAttachments`, `maxAttachmentSizeMb`, `maxAttachmentDownloads` | Save the public files to the key-value store, up to a size and a count. Charged per file. |
| `mode`, `groupBy` | `aggregate` = Summary mode, counted by `noticeType`, `setAside`, `state`, `naicsSector`, `department` or `month`. |
| `monitorMode`, `monitorStoreName`, `skipFirstRun`, `includeUpdates`, `emitUnchanged`, `resetMonitor` | Monitor mode (below). |
| `webhookUrl`, `webhookHeaders`, `slackWebhookUrl`, `discordWebhookUrl`, `notificationLimit` | Alerts after a run that found notices. |
| `proxyConfiguration`, `maxConcurrency`, `maxRequestRetries` | Advanced. |

Field names from other SAM.gov actors are accepted too (`maxItems`, `noticeType`, `setAsides`, `onlyNew`, `fetchDetails`, `openOnly`...), so an input you already have works as it is.

#### Input JSON

```json
{
  "keywords": ["janitorial"],
  "noticeTypes": ["o", "k"],
  "setAsideCodes": ["SBA", "SDVOSBC"],
  "states": ["VA", "MD", "DC"],
  "openForResponsesOnly": true,
  "maxResults": 200
}
```

#### Paste the search you already built on SAM.gov

Set up a search on [sam.gov/search](https://sam.gov/search/?index=opp) with keywords and filters, copy the address from the browser and paste it into `startUrls`. Its keywords, keyword match, status, notice types, NAICS, PSC, set-asides, agencies, states and dates are read from the address.

#### Count a market without reading it (Summary mode)

```json
{ "mode": "aggregate", "groupBy": "state", "naicsCodes": ["5415"], "noticeTypes": ["o", "k"] }
```

returns one row per state with the number of matching notices, its share and the search behind it. Group by `noticeType`, `setAside`, `state`, `naicsSector`, `department` or `month` (posted month, last 12 months or your posted range).

### ⬆️ Output

One row per notice. A real row from the prefill run on 2026-11-13 (run OmWyzKZTAE9ieVz8h; shortened: the description is cut and some empty columns are left out here, every column is in every row):

```json
{
  "recordType": "opportunity",
  "noticeId": "c355d58bb7ab4a2192559a967c98f38c",
  "title": "Cleaning of MSGR guard and Embassy support staff assigned areas",
  "solicitationNumber": "19SP5027Q0003",
  "noticeType": "Solicitation",
  "noticeTypeCode": "o",
  "status": "active",
  "active": true,
  "publishDate": "2026-11-13T08:41:31.000Z",
  "modifiedDate": "2026-11-13T08:41:31.000Z",
  "responseDate": "2026-12-14T17:30:00+01:00",
  "responseTimeZone": "Europe/Madrid",
  "daysUntilDeadline": 31,
  "archiveDate": "2026-12-29",
  "department": "STATE, DEPARTMENT OF",
  "agency": "STATE, DEPARTMENT OF",
  "office": "U.S. EMBASSY MADRID",
  "officeCode": "19SP50",
  "organizationPath": "STATE, DEPARTMENT OF > STATE, DEPARTMENT OF > U.S. EMBASSY MADRID",
  "officeCity": "WASHINGTON",
  "officeState": "DC",
  "naicsCode": "561720",
  "naicsTitle": "Janitorial Services",
  "pscCode": "S201",
  "pscTitle": "HOUSEKEEPING- CUSTODIAL JANITORIAL",
  "setAsideCode": "NONE",
  "setAside": "No Set aside used",
  "placeOfPerformance": {
    "streetAddress": null,
    "streetAddress2": null,
    "city": "Madrid",
    "state": "ES-MD",
    "stateName": "Madrid",
    "zip": "28006",
    "country": "ESP",
    "countryName": "SPAIN"
  },
  "primaryContactName": "Jerad S. Tietz",
  "primaryContactTitle": null,
  "primaryContactEmail": "tietzjs@state.gov",
  "primaryContactPhone": "34915872161",
  "descriptionText": "The U.S. Embassy in Madrid requires cleaning services at the US Government-owned property located at Calle Tambre, 35, Madrid.\n\nThe work covers the cleaning of the guard booth, guard dressing room and guard bathroom, and the Embassy support staff room and bathroom. The total area is approximately 27...",
  "attachments": [
    {
      "name": "Signed Invitation Letter.pdf",
      "type": "file",
      "url": "https://sam.gov/api/prod/opps/v3/opportunities/resources/files/3bcdb9d996f84aa0b60223d857e5cd98/download",
      "size": 252827,
      "mimeType": ".pdf",
      "postedDate": "2026-11-13T08:41:31.327Z"
    },
    {
      "name": "RFQ 19SP5027Q0003.pdf",
      "type": "file",
      "url": "https://sam.gov/api/prod/opps/v3/opportunities/resources/files/65cc6f80fe944b8780eff0fe64359726/download",
      "size": 442962,
      "mimeType": ".pdf",
      "postedDate": "2026-11-13T08:41:31.327Z"
    }
  ],
  "attachmentCount": 2,
  "samUrl": "https://sam.gov/opp/c355d58bb7ab4a2192559a967c98f38c/view",
  "detailsFetched": true,
  "attachmentsFetched": true,
  "source": "sam.gov",
  "scrapedAt": "2026-11-13T09:09:36.878Z"
}
```

#### Fields

How often each field is filled, counted on 319 notices (the 40 newest active notices of every type, plus 20 archived ones) read on 2026-11-13:

| Field | Filled | Notes |
|---|---|---|
| `noticeId`, `title`, `noticeType`, `publishDate`, `modifiedDate`, `archiveDate`, `samUrl`, `contacts` | 100% | |
| `primaryContactEmail` | 100% | |
| `solicitationNumber` | 97% | |
| `department`, `agency`, `office`, `organizationPath` | 97% (100% at run time) | the rest are named from SAM.gov's federal hierarchy during the run |
| `officeCity` / `officeAddress` | 95% | |
| `descriptionText` | 94% | |
| `pscCode` + `pscTitle` | 94% | |
| `naicsCode` + `naicsTitle` | 93% | |
| `attachments` | 82% | the other notices have none |
| `responseDate` | 70% | 84 of 84 solicitations; sources sought and special notices often have none |
| `placeOfPerformance` | 62% | |
| `primaryContactPhone` | 43% | agencies often give only an e-mail |
| `setAsideCode` | 37% | full-and-open buys have none |
| `awardNumber`, `awardDate`, `awardAmount`, `awardeeName` | 40 of 40 award notices | award notices only |
| `awardeeUei`, `awardeeCageCode` | 39 of 40 award notices | |
| `awardeeCity`, `awardeeState`, `awardeeZip` | 9 of 40 award notices | SAM.gov fills the awardee's location on few |
| `justificationAuthority` | 40 of 40 justifications | |
| `history` | 100% | Version history on |

Every column is in every row (empty ones are `null` or `[]`), so a CSV export keeps one shape. The dataset has four views: Opportunities, Contracting officers, Awards and Summary rows.

### How can I use SAM.gov data?

- **Bid pipelines:** a daily list of solicitations in your NAICS codes and set-asides, with deadlines and the contracting officer's e-mail, straight into a CRM or a spreadsheet.
- **Capture planning:** award notices with the awardee, UEI, amount and date show who wins which work at which office.
- **Subcontracting and teaming:** award notices name the prime contractor; presolicitations and sources sought show work before it is solicited.
- **Market sizing:** Summary mode counts notices by state, set-aside, NAICS sector, department or month in seconds.
- **Document pipelines:** the attachment list (or the files themselves) feeds proposal tools and AI assistants.

### How much does it cost to scrape SAM.gov?

Pay per result, no monthly fee, no start fee:

| Event | Price |
|---|---|
| Notice (with its record), or one summary row | **$0.045 per 1,000** ($0.000045 each) |
| Attachment list (only notices that have one) | $0.063 per 1,000 ($0.000063 each) |
| Version history (when on) | $0.0009 per notice |
| Attachment file saved (when on) | $0.0009 per file |

100 notices with their records and attachment lists cost about **$0.01**; 10,000 cost about $1. Platform usage is included. Set **Maximum cost per run** in the run options and the run stops cleanly at it: notices are fitted to the limit before they are charged, and nothing is charged twice.

### Integrations, API, scheduling & MCP

Run SAM.gov Scraper from the [Apify API](https://docs.apify.com/api/v2), the Apify JavaScript or Python client, Zapier, Make, n8n, Google Sheets, or an AI agent through the [Apify MCP server](https://mcp.apify.com). Results are in the run's dataset as JSON, CSV, Excel, XML or HTML.

#### Run it on a schedule

1. Turn on **Monitor mode** and give it a **Monitor name** (e.g. `janitorial-va`).
2. Save the input as a task and add a daily [schedule](https://docs.apify.com/platform/schedules).
3. Each run returns only notices that are new since the last run (`changeType: NEW`) and amendments of solicitations seen before (`UPDATED`, with `previousNoticeId`); a day with nothing new returns nothing and charges nothing.
4. Add a `webhookUrl`, `slackWebhookUrl` or `discordWebhookUrl` to be told when something new comes in.

With the API:

```bash
curl -X POST "https://api.apify.com/v2/acts/TopApi~sam-gov-scraper/runs?token=<YOUR_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"keywords":["cybersecurity"],"noticeTypes":["o","k","r"],"monitorMode":true,"monitorStoreName":"cyber"}'
```

Turning an add-on on later (say Version history) brings each notice delivered earlier without it back once with it (`changeType: DETAILS`).

### Limits & empty runs

- SAM.gov pages one search to 10,000 notices. With `newest` or `oldest` sort, larger searches are read in date ranges; with `relevance` or `title` sort a search stops at 10,000.
- The search index holds the latest version of each notice; earlier versions are read by notice id or through Version history.
- Speed: about 1,000 notices with their records in 6-10 seconds at the default 256 MB; for pulls of thousands, pick 1 GB memory in the run options (3,000 notices in 25 seconds, same price per notice).
- SAM.gov refuses a connection that has sent tens of thousands of requests in a few minutes; the actor then moves to an Apify datacenter proxy (and a US residential one if needed) by itself and carries on.
- Only public attachments are listed and downloaded; files SAM.gov marks for registered users only are left out.
- An empty result says why in the run's status: no match, everything filtered out, nothing new since the last monitor run, or the spending limit.

### FAQ

#### How much does SAM.gov Scraper cost?

$0.045 per 1,000 notices with their full records, plus $0.063 per 1,000 for the attachment list on notices that have one. No start fee and no monthly fee.

#### Do I need a SAM.gov account or an API key?

No. The actor reads the same public pages anyone can open on SAM.gov, without logging in and without an api.sam.gov key.

#### Does it give the contracting officer's e-mail and phone?

Yes: every point of contact SAM.gov shows (name, title, e-mail, phone, fax), with the primary and secondary contact also in their own columns. Agencies give an e-mail on almost every notice and a phone on about four in ten.

#### Can it get award notices and the winning contractor?

Yes. Award notices carry the award number, date, amount and the awardee's name, UEI, CAGE code and location. Use `awardedOnly` and `minAwardAmount` to list only awards above a size.

#### Can I get the solicitation documents?

The attachment list gives every public file and link with a download address that needs no account. Turn on **Download attachment files** to save the files themselves to the run's key-value store.

#### Can I search archived notices?

Yes: set `status` to `inactive` or `all`. SAM.gov keeps about 5.6 million archived notices.

#### How do I monitor new SAM.gov opportunities every day?

Turn on Monitor mode and schedule the actor daily; see [Run it on a schedule](#run-it-on-a-schedule).

#### Can I use SAM.gov Scraper with the Apify API or an MCP server?

Yes, see [Integrations](#integrations-api-scheduling--mcp).

#### Why did my run return no results?

The status message says which: no notice matched (widen the keywords, or set `status` to `all`), everything matched was filtered out, nothing was new since the last monitor run, or the spending limit was below the price of one notice.

#### Your feedback

Something missing or not working? Open an issue on the actor's **Issues** tab and it will be looked at.

# Actor input Schema

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

Words to search for, as you would type them in SAM.gov's search box. They are searched together (see Keyword match). Leave empty to list notices by the filters below only.

## `keywordMode` (type: `string`):

How SAM.gov matches the keywords: every word, any word, or the exact phrase.

## `searchKeywordsSeparately` (type: `boolean`):

Run one search per keyword (each with its own Max results per search) instead of one search for all of them.

## `keywordScope` (type: `string`):

"The title" keeps only notices whose title holds the keywords.

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

Drop notices whose title or description holds any of these words (never charged).

## `startUrls` (type: `array`):

Paste a SAM.gov contract-opportunity search (sam.gov/search/?index=opp...) with your filters set, or notice pages (sam.gov/opp/<id>/view).

## `noticeIds` (type: `array`):

SAM.gov notice ids (the 32 characters in sam.gov/opp/<id>/view). Each returns that notice, current or archived.

## `solicitationNumbers` (type: `array`):

Every notice filed under these solicitation numbers (presolicitation, solicitation, award...), current or archived.

## `urlsFromFile` (type: `string`):

Address of a plain-text or CSV file listing notice ids or SAM.gov addresses (one per line). A file in your own Apify storage (a key-value store record or a dataset export, api.apify.com/v2/...) is read with your run's token.

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

One or more notice types. Empty = every type.

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

NAICS codes, e.g. 541511, or prefixes: 5415 matches every code under it, 54 the whole sector.

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

Product and service codes, e.g. R425, or prefixes: R4 matches every code under it.

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

One or more set-asides. Empty = any.

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

Departments, agencies or offices by name (e.g. "Veterans Affairs", "Defense Logistics Agency") or SAM.gov organization id. A name is looked up in SAM.gov's federal hierarchy; the run log says which organization it read.

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

Two-letter state or territory codes (VA, TX, DC, PR...) or names.

## `placeOfPerformanceZip` (type: `string`):

A five-digit ZIP code.

## `countries` (type: `array`):

Three-letter country codes: USA, DEU, JPN, KOR...

## `status` (type: `string`):

SAM.gov keeps about 45,000 active notices and 5.6 million archived ones.

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

Only notices posted on or after this day.

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

Only notices posted on or before this day.

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

Only notices posted in the last N days (0 or empty = no limit).

## `modifiedFrom` (type: `string`):

Only notices updated on or after this day.

## `modifiedTo` (type: `string`):

Only notices updated on or before this day.

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

Only notices whose response deadline is on or after this day (notices without a deadline are left out).

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

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

## `openForResponsesOnly` (type: `boolean`):

Drop notices whose response deadline has passed (notices without a deadline stay). Checked by this actor on the search results, before anything is charged.

## `awardedOnly` (type: `boolean`):

Only award notices (the ones naming the contractor, award number, date and amount).

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

Only notices whose award amount is at least this (award notices). Checked by this actor on the notice record, before anything is charged.

## `maxAwardAmount` (type: `integer`):

Only notices whose award amount is at most this.

## `onlyWithContactEmail` (type: `boolean`):

Drop notices that name no contracting officer e-mail (never charged).

## `dedupeBySolicitation` (type: `boolean`):

Keep only the newest notice of each solicitation number (a presolicitation, its solicitation and its award share one).

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

Most notices (or summary rows) for the whole run. 0 = every match: searches over 10,000 matches are read in date ranges.

## `maxResultsPerSearch` (type: `integer`):

Most notices from each search (keyword, address). 0 = no per-search limit.

## `sortBy` (type: `string`):

Order SAM.gov returns the notices in.

## `includeDetails` (type: `boolean`):

Open each notice for its full description, NAICS and PSC codes with titles, set-aside, contracting officer contacts (name, title, e-mail, phone), place of performance, archive date and the full award (number, date, amount, awardee UEI, CAGE and location). Included in the notice price. Off = the search fields only (faster).

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

The notice's description text.

## `descriptionFormat` (type: `string`):

Plain text (descriptionText), SAM.gov's HTML (descriptionHtml), or both.

## `descriptionMaxChars` (type: `integer`):

Cut descriptions to this many characters (0 = full text).

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

Every public file and link of the notice (SOW, PWS, pricing sheets, amendments): name, size, type, date and a download address that needs no SAM.gov account. Charged per notice that has at least one.

## `includeHistory` (type: `boolean`):

Every version of the notice (the original and each amendment, cancellation or archive) with its notice id, date and type, plus the linked notice. Charged per notice.

## `downloadAttachments` (type: `boolean`):

Save each public attachment file to the run's key-value store (downloadedFiles gives its key and address). Charged per file saved.

## `maxAttachmentSizeMb` (type: `integer`):

Files above this size are listed but not downloaded.

## `maxAttachmentDownloads` (type: `integer`):

Most files saved in one run (0 = no limit).

## `mode` (type: `string`):

Summary counts the notices matching your keywords and filters by one dimension (Group by) without reading them: the size of a market in seconds.

## `groupBy` (type: `string`):

The dimension Summary mode counts by. Month posted covers Posted from/to, or the last 12 months.

## `monitorMode` (type: `boolean`):

Return only notices that are new since the last run, or updated (an amendment of a solicitation seen before, or a changed notice). Pairs with a schedule. The first run returns everything (or saves a baseline, below).

## `monitorStoreName` (type: `string`):

Name of the memory this monitor keeps (letters, digits, dashes). Give each saved search its own name; empty = one memory per input.

## `skipFirstRun` (type: `boolean`):

The first monitor run records what exists and returns nothing (nothing charged); later runs return what is new.

## `includeUpdates` (type: `boolean`):

Also return amendments of solicitations seen before and notices changed since the last run (changeType UPDATED).

## `emitUnchanged` (type: `boolean`):

Return every match, each marked NEW, UPDATED or UNCHANGED (all charged).

## `resetMonitor` (type: `boolean`):

Forget what earlier runs saw and start over.

## `webhookUrl` (type: `string`):

POST the notices of this run (JSON) here when it finds any.

## `webhookHeaders` (type: `object`):

Extra HTTP headers for the webhook, e.g. {"Authorization": "Bearer ..."}.

## `slackWebhookUrl` (type: `string`):

A Slack incoming-webhook address for a short message per run.

## `discordWebhookUrl` (type: `string`):

A Discord webhook address for a short message per run.

## `notificationLimit` (type: `integer`):

Most notices listed in one alert.

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

Default: the run's own connection, then an Apify datacenter proxy, then a US residential one only if SAM.gov refuses the others. Pick a group or your own proxies to use only those.

## `maxConcurrency` (type: `integer`):

Notice records read at once.

## `maxRequestRetries` (type: `integer`):

Attempts per request before it counts as failed.

## Actor input object example

```json
{
  "keywords": [
    "janitorial"
  ],
  "keywordMode": "ALL",
  "searchKeywordsSeparately": false,
  "keywordScope": "anywhere",
  "status": "active",
  "openForResponsesOnly": false,
  "awardedOnly": false,
  "onlyWithContactEmail": false,
  "dedupeBySolicitation": false,
  "maxResults": 20,
  "maxResultsPerSearch": 0,
  "sortBy": "newest",
  "includeDetails": true,
  "includeDescription": true,
  "descriptionFormat": "text",
  "descriptionMaxChars": 0,
  "includeAttachments": true,
  "includeHistory": false,
  "downloadAttachments": false,
  "maxAttachmentSizeMb": 25,
  "maxAttachmentDownloads": 200,
  "mode": "search",
  "groupBy": "noticeType",
  "monitorMode": false,
  "skipFirstRun": false,
  "includeUpdates": true,
  "emitUnchanged": false,
  "resetMonitor": false,
  "notificationLimit": 10,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "maxConcurrency": 20,
  "maxRequestRetries": 3
}
```

# Actor output Schema

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

One item per notice (with its record, attachment list and history when asked), or per group in Summary mode.

## `files` (type: `string`):

The key-value store holding the attachment files saved with Download attachment files.

# 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": [
        "janitorial"
    ],
    "maxResults": 20
};

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

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

```

## MCP server setup

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