# US Federal Contract Opportunities (SAM.gov Official Data) (`merrily_beryl/us-federal-contracts-samgov`) Actor

Export US federal contract opportunities from SAM.gov's official daily data extract: solicitations, awards, NAICS, PSC, set-asides, deadlines. No login, no personal data.

- **URL**: https://apify.com/merrily_beryl/us-federal-contracts-samgov.md
- **Developed by:** [João Pedro Faria](https://apify.com/merrily_beryl) (community)
- **Categories:** Business, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 result (contract notice)s

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

## US Federal Contract Opportunities (SAM.gov Official Data)

Export **US federal contract opportunities from SAM.gov** (solicitations, combined synopses, presolicitations, sources sought, special notices and award notices) using **SAM.gov's official public data extract**, the daily "Contract Opportunities" file that SAM.gov publishes to data.gov. No login, no API key, no proxies, no website scraping, and **no personal data**: contracting officer names, emails and phone numbers are removed.

### Why this Actor

- **Official source, stable by design.** It reads the file SAM.gov publishes for data reuse. It does not call SAM.gov's internal website APIs, which the SAM.gov Terms of Use prohibit for automated harvesting.
- **Fast and predictable.** A typical run downloads the daily extract (~70,000 active notices) and filters it in under a minute.
- **Built for monitoring.** Turn on *Only new notices* and schedule it daily to get just the notices you have not seen yet.
- **Privacy-safe.** Organisation-level data only, ready for CRMs, dashboards and AI agents without handling personal data.

### What you get

For every notice: notice ID, title, solicitation number, notice type, posted date, response deadline and days left, department / sub-tier / office, NAICS code, PSC (classification) code, set-aside, place of performance, office location, award number, date, amount and awardee (award notices), the official SAM.gov link, an additional-info link and, optionally, the description text.

### Use cases

- **Bid monitoring** for government contractors: new solicitations in your NAICS codes, states and set-asides every morning.
- **Market research**: which agencies buy IT services, construction or janitorial services, and where.
- **Award intelligence**: recent award notices above a given amount, by agency.
- **Data pipelines and AI agents**: a clean JSON/CSV feed of federal opportunities via the Apify API or MCP.

### Input

| Field | Description |
|---|---|
| `keywords` | Words to find in title or description, one per line. `keywordMode`: ANY, ALL or EXACT. |
| `naicsCodes` / `pscCodes` | Codes or prefixes (`5415` matches 541511, 541512, …). |
| `setAsideTypes` | e.g. SBA, 8A, HZC, SDVOSBC, WOSB. |
| `opportunityTypes` | o = Solicitation, k = Combined Synopsis/Solicitation, p = Presolicitation, r = Sources Sought, s = Special Notice, a = Award Notice. |
| `agencies`, `states` | Agency name fragments; two-letter state codes. |
| `postedWithinDays`, `postedFrom`, `postedTo` | Posting date window (`YYYY-MM-DD`, `today` or `7 days`). |
| `responseDeadlineFrom` / `To` | Deadline window (`today`, `30 days` = 30 days from now). |
| `solicitationNumbers`, `noticeIds` | Look up specific notices. |
| `minAwardAmount` | Award notices at or above this amount. |
| `maxResults` | Maximum notices returned, newest first. You pay per result. |
| `onlyNew` + `monitorId` | Daily alerts: return only notices not returned before. |

Example:

```json
{"naicsCodes": ["5415"], "setAsideTypes": ["SBA"], "postedWithinDays": 7, "maxResults": 200}
```

### Output example

```json
{
  "noticeId": "b2d09b1646074a249343e684b06ebd9a",
  "title": "Reverse Industry Day and Listening Session – Emerging Acquisition Strategies for Future Projects",
  "noticeType": "Special Notice",
  "postedDate": "2026-11-02 07:19:45",
  "responseDeadline": "2026-11-12T16:00:00-05:00",
  "daysLeft": 9,
  "department": "DEPT OF DEFENSE",
  "naicsCode": null,
  "setAside": null,
  "placeOfPerformance": {"city": null, "state": null, "zip": null, "country": null},
  "url": "https://sam.gov/workspace/contract/opp/b2d09b1646074a249343e684b06ebd9a/view",
  "source": "SAM.gov Contract Opportunities data extract (public domain)"
}
```

Download results as JSON, CSV or Excel, or use the Apify API, webhooks, Make, Zapier, n8n or the Apify MCP server.

### Pricing

Pay per event: **$2.00 per 1,000 notices** ($0.002 per notice returned, event `result-item`), no start fee. Use `maxResults` to cap your spend.

### Benchmark

Measured 2026-11-03 with the same input on both Actors (`{"naicsCodes": ["5415"], "postedWithinDays": 7}`, max 95 results), 3 runs each.

| Metric | This Actor | fortuitous_pirate/sam-gov-scraper |
|---|---|---|
| Successful runs | 3/3 | 3/3 |
| Results per run | 95, 95, 95 | 49, 49, 49 |
| Run time (s) | 9, 8, 8 | 5, 5, 6 |
| Price per 1,000 results (customer) | 2.00 $ (no start fee) | 3.10 $ (incl. 0.005 $ start fee per GB) |
| Filled: notice id | 100 % | 100 % |
| Filled: title | 100 % | 100 % |
| Filled: solicitation number | 98 % | 96 % |
| Filled: notice type | 100 % | 100 % |
| Filled: posted date | 100 % | 100 % |
| Filled: response deadline | 80 % | 80 % |
| Filled: agency | 100 % | 94 % |
| Filled: NAICS | 100 % | 100 % |
| Filled: PSC | 86 % | 94 % |
| Filled: set-aside | 38 % | 16 % |
| Filled: place of performance | 63 % | 61 % |
| Filled: description | 80 % | 86 % |
| Filled: official link | 100 % | 100 % |

Notice IDs in the last run: this Actor 95 (it reached the 95-result cap), the other Actor 49 (all its matches), 43 in both. With `postedWithinDays: 7` this Actor counts from the posting date in SAM.gov's extract (notices from 2026-10-27 onwards); the other Actor started at 2026-10-29. The 6 notices only the other Actor returned have a response deadline that has already passed, which this Actor drops by default (`excludeExpired`).

The other Actor also returns contracting-officer contacts and attachment links and reads SAM.gov in near real time; this Actor uses the official daily extract and returns no personal data.

Method: identical input, runs on Apify with each Actor's default settings, run time = Apify start-to-finish, "filled" = share of returned items where the field is not empty. Where the other Actor is stronger: shorter run time, near real-time data, contracting-officer contacts and attachment links.

### FAQ

**How fresh is the data?** SAM.gov regenerates the extract once a day (around 04:30 UTC). Notices published after that appear in the next day's file. If you need minute-level freshness, this Actor is not the right tool.

**Does it include contracting officer contacts or attachments?** No. Contact persons are personal data and are removed. Attachments are not in the extract; each item links to the official notice page where they are listed.

**Archived notices?** The daily extract contains active notices only.

**Is it legal?** Works of the US federal government are in the public domain, and SAM.gov publishes this extract for public reuse. The Actor only downloads that file.

### Limitations

- Up to ~24 h delay versus the SAM.gov website.
- Active notices only; no attachments; no point-of-contact fields.
- Keyword matching is a plain text match on title and description.

Data source: SAM.gov Data Services, Contract Opportunities extract (U.S. General Services Administration), public domain.

# Actor input Schema

## `keywords` (type: `string`):

Words to look for in the notice title and description, one per line (e.g. 'cybersecurity', 'janitorial'). Leave empty for all notices.

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

ANY = any keyword, ALL = every keyword, EXACT = whole-word match of any keyword.

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

Industry codes or prefixes (5415 matches 541511, 541512...).

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

Product Service Codes or prefixes, e.g. DA10, R425, S2.

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

e.g. SBA (Total Small Business), 8A, HZC, SDVOSBC, WOSB.

## `opportunityTypes` (type: `array`):

Names or codes: o = Solicitation, k = Combined Synopsis/Solicitation, p = Presolicitation, r = Sources Sought, s = Special Notice, a = Award Notice.

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

Department, sub-tier or office name fragments (e.g. 'DEPT OF DEFENSE', 'VETERANS AFFAIRS').

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

Two-letter state codes of the place of performance or contracting office (e.g. VA, TX).

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

Only notices posted or updated in the last N days. Ignored when 'Posted from' is set.

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

YYYY-MM-DD, 'today' or relative like '7 days'.

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

YYYY-MM-DD, 'today' or relative like '2 days'.

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

YYYY-MM-DD, 'today' or relative like '3 days' (from now).

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

YYYY-MM-DD or relative like '30 days' (from now).

## `excludeExpired` (type: `boolean`):

Drop notices whose response deadline has already passed (they can stay 'active' in SAM.gov's extract until archived). Award notices and notices without a deadline are kept.

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

Look up specific solicitation numbers.

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

32-character notice IDs or sam.gov/opp/<id>/view URLs.

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

Only award notices with an amount at or above this value.

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

Maximum notices returned, newest first (you are charged per result).

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

Include the notice description text.

## `onlyNew` (type: `boolean`):

Return only notices not returned by a previous run with the same Monitor ID. Use with a schedule for daily alerts.

## `monitorId` (type: `string`):

Name of the watchlist that remembers already-returned notices.

## Actor input object example

```json
{
  "keywordMode": "ANY",
  "postedWithinDays": 7,
  "excludeExpired": true,
  "maxResults": 50,
  "includeDescription": true,
  "onlyNew": false,
  "monitorId": "default"
}
```

# Actor output Schema

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

All results (one item per record) in the default dataset.

# 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 = {
    "postedWithinDays": 7,
    "maxResults": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("merrily_beryl/us-federal-contracts-samgov").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 = {
    "postedWithinDays": 7,
    "maxResults": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("merrily_beryl/us-federal-contracts-samgov").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 '{
  "postedWithinDays": 7,
  "maxResults": 50
}' |
apify call merrily_beryl/us-federal-contracts-samgov --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,merrily_beryl/us-federal-contracts-samgov"
        }
    }
}
```

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/XmHlg3TKiIQvffYaF/builds/q0GNkSG9ikduAt6yz/openapi.json
