# SAM.gov Federal Contract & Award Notice Scraper (`crawlyth-forge/sam-gov-federal-contract-and-award-notice-scraper`) Actor

Search US federal contract notices on SAM.gov by keyword, NAICS code, set-aside type and posting date, or fetch a specific notice by ID, covering solicitations, sources sought, awards and set-aside designations.

- **URL**: https://apify.com/crawlyth-forge/sam-gov-federal-contract-and-award-notice-scraper.md
- **Developed by:** [crawlyth forge](https://apify.com/crawlyth-forge) (community)
- **Categories:** Automation, Lead generation, Other
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.49 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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 Federal Contract & Award Notice Scraper

SAM.gov is the US government's official portal for federal contracting. This actor turns its public Contract Opportunities search into a clean dataset of solicitations, presolicitations, sources-sought notices, special notices, surplus-property sales, justifications and award notices — with no API key, account, cookie or proxy setup — cookieless from the first request.

### What you get

- **Filtered notice search.** Match keywords across titles and descriptions, then narrow by notice type, NAICS, PSC, set-aside, state, country, federal organization, award number, award amount and publication or response-deadline dates.
- **Award notices alongside solicitations.** Award records include the contract award number, delivery/task order number, award date, amount, awardee name, UEI, CAGE code and awardee address when SAM.gov publishes them.
- **Full notice enrichment.** Each record can include the department/agency/office hierarchy, contracting-office address, contracting officer contacts, place of performance, NAICS and PSC classification, response deadline, plain-text description and a list of attachments with public download links.
- **Direct lookup.** Paste one or more SAM.gov notice IDs, solicitation numbers or `sam.gov/opp/<id>/view` links to fetch those notices directly.
- **Stable links.** Every record has a `sourceUrl` that opens the official notice on SAM.gov.

### Data source

The actor reads the same public JSON endpoints that power the SAM.gov Contract Opportunities search and notice pages. No developer key is involved, so results are available to every user immediately. Attachments are listed with their public `sam.gov` download links; file bytes are not copied into the dataset.

### Modes

| Mode | Use it for |
|---|---|
| Search contract and award notices | Keyword and filter discovery with pagination |
| Fetch specific notices by ID or URL | A known notice, solicitation number or SAM.gov link |

Search results are de-duplicated by notice ID and paginated until `maxItems` is reached or SAM.gov runs out of matches. SAM.gov caps any single query at 10,000 records; the actor reports that ceiling in the run status when a query reaches it.

### Input

| Field | Type | Default | Notes |
|---|---|---|---|
| `operation` | select | `search` | Search or direct notice lookup |
| `searchQuery` | text | – | Words matched in titles and descriptions (prefilled with `software`) |
| `matchMode` | select | `ALL` | All words, any words or exact phrase |
| `noticeType` | select | all | Award, solicitation, presolicitation, sources sought and more |
| `naicsCode` | text | – | Comma-separated codes or ranges |
| `pscCode` | text | – | Product Service Code list |
| `setAside` | select | all | Small-business and socioeconomic set-asides |
| `organizationId` | text | – | Federal organization ID(s) |
| `placeOfPerformanceState` | select | any | US state or territory |
| `placeOfPerformanceCountry` | text | – | Three-letter country code |
| `postedFrom` / `postedTo` | text | – | Publication date range (`YYYY-MM-DD`) |
| `responseFrom` / `responseTo` | text | – | Response-deadline range (`YYYY-MM-DD`) |
| `activeOnly` | boolean | `true` | Include archived/inactive notices when off |
| `sort` | select | `-modifiedDate` | Recently updated; also oldest, best match, title A-Z/Z-A |
| `awardNumber` | text | – | Award or delivery-order number |
| `awardeeState` | select | any | Awardee state or territory |
| `awardAmountFrom` / `awardAmountTo` | text | – | Award amount range in USD |
| `includeDetails` | boolean | `true` | Enrich from the detail page |
| `includeAttachments` | boolean | `true` | Add attachment metadata and links |
| `noticeIds` | array | – | Notice IDs, solicitation numbers or SAM.gov URLs (lookup mode) |
| `maxItems` | integer | `25` | 1–10,000 |

#### Example: software awards above $1M

```json
{
  "operation": "search",
  "searchQuery": "software",
  "noticeType": "a",
  "awardAmountFrom": "1000000",
  "postedFrom": "2026-01-01",
  "activeOnly": true,
  "maxItems": 100
}
```

#### Example: solicitations for one NAICS in one state

```json
{
  "operation": "search",
  "noticeType": "k",
  "naicsCode": "561730",
  "placeOfPerformanceState": "PA",
  "postedFrom": "2026-10-01",
  "postedTo": "2026-11-30",
  "maxItems": 50
}
```

#### Example: fetch notices from links

```json
{
  "operation": "getNoticeDetails",
  "noticeIds": [
    "d24e3bf678c04995a191257b45bfb7e0",
    "https://sam.gov/opp/211fae31d1dc44e4acca55c00a57c224/view"
  ]
}
```

### Output fields

Core identity and dates: `noticeId`, `title`, `solicitationNumber`, `type`, `typeCode`, `baseType`, `postedDate`, `modifiedDate`, `responseDeadline`, `responseDeadlineTimezone`, `archiveDate`, `archiveType`, `status`, `active`, `isCanceled`, `sourceUrl`, `recordType`, `scrapedAt`.

Organization and place: `department`, `agency`, `office`, `officeAddress`, `placeOfPerformance`.

Classification and set-aside: `classificationCode` (PSC), `naicsCode`, `naicsCodes`, `setAside`, `setAsideCode`.

Award outcome: `awardDate`, `awardAmount`, `awardNumber`, `deliveryOrderNumber`, `awardeeName`, `awardeeUei`, `awardeeCageCode`, `awardeeAddress`.

People and content: `pointOfContact`, `description`, `attachments`, `attachmentCount`.

Fields SAM.gov does not publish for a particular notice are omitted rather than written as `null` or an empty string.

### Backward compatibility

Saved tasks that use the earlier `mode` field with `searchOpportunities` / `getOpportunityDetail` values, `opportunityType`, `postedFrom` / `postedTo`, `setAside`, `noticeIds` or `maxItems` keep working. The old `apiKey` value is accepted and ignored — no key is needed now. Existing output fields keep their names; new fields are additive.

### Limits and notes

- **10,000 records per query.** This is SAM.gov's own search ceiling. Narrow by date, NAICS/PSC, state, notice type or set-aside to reach older notices.
- **Attachments are metadata plus links.** SAM.gov serves the files themselves from its own download endpoint; the actor does not rehost multi-hundred-MB drawings.
- **Descriptions are plain text.** Formatting and tables from the source HTML are flattened for dataset compatibility.
- **Award fields are conditional.** Solicitations that have not been awarded yet have no award amount or awardee.
- **Not affiliated with SAM.gov or GSA.** Public federal data is provided as-is by the source.

### FAQ

**Do I need a SAM.gov API key?** No. The actor uses the public search, notice and attachment endpoints that SAM.gov serves to every visitor.

**Why did I get fewer rows than `maxItems`?** The filters matched fewer notices, SAM.gov's 10,000-record ceiling was reached, or records were de-duplicated across pages.

**Can I filter by agency name?** Use `organizationId` with SAM.gov's numeric organization ID. A keyword or NAICS filter is often easier for departments with many offices.

**Does it monitor for new notices?** No. Schedule the actor and use `postedFrom` or `activeOnly` to focus each run; de-duplicate across runs by `noticeId`.

# Actor input Schema

## `operation` (type: `string`):

Search notices with filters, or fetch specific notices by ID or sam.gov URL.

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

Legacy mode value accepted for backward compatibility. Use `operation` instead.

## `searchQuery` (type: `string`):

Words to match in notice titles and descriptions. Leave empty to browse by filters only.

## `matchMode` (type: `string`):

How multiple keywords must match. Best match sorting uses relevance when keywords are set.

## `noticeType` (type: `string`):

Restrict results to one notice type, such as solicitations or award notices.

## `naicsCode` (type: `string`):

One or more NAICS codes, comma-separated. Ranges are accepted, e.g. 541511,541512 or 561730-561740.

## `pscCode` (type: `string`):

One or more PSC codes, comma-separated, e.g. D302 or 7A21.

## `setAside` (type: `string`):

Small-business and socioeconomic set-aside designation.

## `organizationId` (type: `string`):

Optional SAM.gov federal organization ID, or a comma-separated list, to restrict results to specific departments, agencies or offices.

## `placeOfPerformanceState` (type: `string`):

US state or territory where the work will be performed.

## `placeOfPerformanceCountry` (type: `string`):

Three-letter country code, e.g. USA. Leave empty for all countries.

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

Only notices published on or after this date (YYYY-MM-DD).

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

Only notices published on or before this date (YYYY-MM-DD).

## `responseFrom` (type: `string`):

Only notices whose response deadline is on or after this date (YYYY-MM-DD).

## `responseTo` (type: `string`):

Only notices whose response deadline is on or before this date (YYYY-MM-DD).

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

Keep only currently active notices. Turn off to include archived and inactive notices.

## `sort` (type: `string`):

Order of returned notices. Best match needs search keywords.

## `awardNumber` (type: `string`):

Filter award notices by contract award number or task/delivery order number.

## `awardeeState` (type: `string`):

US state or territory of the awardee. Applies to award notices.

## `awardAmountFrom` (type: `string`):

Minimum award amount in US dollars, e.g. 100000.

## `awardAmountTo` (type: `string`):

Maximum award amount in US dollars, e.g. 5000000.

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

Fetch each notice's detail page for NAICS/PSC, set-aside, award amount, contacts and description. Adds one request per notice.

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

List each notice's attachments with public download links. Adds one request per notice.

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

Used in fetch mode. Paste SAM.gov notice IDs, solicitation numbers, or sam.gov/opp/<id>/view URLs.

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

Maximum number of notices to return (1-10,000). SAM.gov caps any single query at 10,000 records.

## Actor input object example

```json
{
  "operation": "search",
  "searchQuery": "software",
  "matchMode": "ALL",
  "noticeType": "",
  "naicsCode": "",
  "pscCode": "",
  "setAside": "",
  "organizationId": "",
  "placeOfPerformanceState": "",
  "placeOfPerformanceCountry": "",
  "postedFrom": "",
  "postedTo": "",
  "responseFrom": "",
  "responseTo": "",
  "activeOnly": true,
  "sort": "-modifiedDate",
  "awardNumber": "",
  "awardeeState": "",
  "awardAmountFrom": "",
  "awardAmountTo": "",
  "includeDetails": true,
  "includeAttachments": true,
  "noticeIds": [],
  "maxItems": 2
}
```

# Actor output Schema

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

Dataset containing every scraped SAM.gov notice record.

# 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 = {
    "operation": "search",
    "searchQuery": "software",
    "matchMode": "ALL",
    "noticeType": "",
    "naicsCode": "",
    "pscCode": "",
    "setAside": "",
    "organizationId": "",
    "placeOfPerformanceState": "",
    "placeOfPerformanceCountry": "",
    "postedFrom": "",
    "postedTo": "",
    "responseFrom": "",
    "responseTo": "",
    "activeOnly": true,
    "sort": "-modifiedDate",
    "awardNumber": "",
    "awardeeState": "",
    "awardAmountFrom": "",
    "awardAmountTo": "",
    "includeDetails": true,
    "includeAttachments": true,
    "noticeIds": [],
    "maxItems": 2
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlyth-forge/sam-gov-federal-contract-and-award-notice-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 = {
    "operation": "search",
    "searchQuery": "software",
    "matchMode": "ALL",
    "noticeType": "",
    "naicsCode": "",
    "pscCode": "",
    "setAside": "",
    "organizationId": "",
    "placeOfPerformanceState": "",
    "placeOfPerformanceCountry": "",
    "postedFrom": "",
    "postedTo": "",
    "responseFrom": "",
    "responseTo": "",
    "activeOnly": True,
    "sort": "-modifiedDate",
    "awardNumber": "",
    "awardeeState": "",
    "awardAmountFrom": "",
    "awardAmountTo": "",
    "includeDetails": True,
    "includeAttachments": True,
    "noticeIds": [],
    "maxItems": 2,
}

# Run the Actor and wait for it to finish
run = client.actor("crawlyth-forge/sam-gov-federal-contract-and-award-notice-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 '{
  "operation": "search",
  "searchQuery": "software",
  "matchMode": "ALL",
  "noticeType": "",
  "naicsCode": "",
  "pscCode": "",
  "setAside": "",
  "organizationId": "",
  "placeOfPerformanceState": "",
  "placeOfPerformanceCountry": "",
  "postedFrom": "",
  "postedTo": "",
  "responseFrom": "",
  "responseTo": "",
  "activeOnly": true,
  "sort": "-modifiedDate",
  "awardNumber": "",
  "awardeeState": "",
  "awardAmountFrom": "",
  "awardAmountTo": "",
  "includeDetails": true,
  "includeAttachments": true,
  "noticeIds": [],
  "maxItems": 2
}' |
apify call crawlyth-forge/sam-gov-federal-contract-and-award-notice-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,crawlyth-forge/sam-gov-federal-contract-and-award-notice-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/sb1M0G4fhxNdl7fWj/builds/rrmdtbUsqvOpaJhvp/openapi.json
