# SAM.gov Contract Opportunities (`hamsmoothie/sam-gov-opportunities`) Actor

Search live US federal contract opportunities on SAM.gov by keyword, notice type, NAICS and date. Clean JSON/CSV: title, agency, solicitation number, dates, set-aside, link.

- **URL**: https://apify.com/hamsmoothie/sam-gov-opportunities.md
- **Developed by:** [Maybe Quark](https://apify.com/hamsmoothie) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.00 / 1,000 result rows

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 Contract Opportunities Search: Federal Solicitations by NAICS

**SAM.gov Contract Opportunities** searches the public SAM.gov opportunities index and returns US federal contract notices as clean rows: title, notice type, solicitation number, department and office, NAICS codes, set-aside, published date, response deadline, place of performance, award amount and awardee (on award notices), a short description and the direct SAM.gov link. Export JSON, CSV or Excel, or schedule it for a daily bid feed. No login or API key is needed.

### Input

All fields are optional. This example finds janitorial notices updated in the last 14 days, limited to solicitations and combined synopsis/solicitations under NAICS 561720:

```json
{
  "keywords": "janitorial",
  "noticeTypes": ["o", "k"],
  "naics": ["561720"],
  "activeOnly": true,
  "postedWithinDays": 14,
  "maxResults": 120
}
```

- `keywords`: words to search, such as `janitorial`, `HVAC`, `cybersecurity`.
- `noticeTypes`: `o` Solicitation, `p` Presolicitation, `k` Combined Synopsis/Solicitation, `r` Sources Sought, `a` Award Notice, `s` Special Notice, `g` Sale of Surplus, `i` Intent to Bundle, `u` Justification. Empty means all.
- `naics`: NAICS codes such as `561720`. Empty means all.
- `activeOnly`: only opportunities still open for response (default true).
- `postedWithinDays`: only notices posted or modified in the last N days; `0` means any time (default 30).
- `maxResults`: stop after this many opportunities (default 200, maximum 10000).

### Output

One row per notice, most recently modified first. Example row (an award notice):

```json
{
  "title": "Janitorial services",
  "noticeType": "Award Notice",
  "solicitationNumber": "FY26R3141022",
  "department": "INTERNATIONAL BOUNDARY AND WATER COMMISSION: U.S.-MEXICO",
  "office": "INTERNAT. BOUNDARY AND WATER COMM.",
  "naics": null,
  "setAside": null,
  "publishedAt": "2026-10-08T13:23:48+00:00",
  "responseDue": null,
  "modifiedAt": "2026-10-08T13:23:48+00:00",
  "isActive": true,
  "placeOfPerformance": null,
  "awardAmount": null,
  "awardee": "HARMONBK LLC",
  "description": "Award was made to HARMONBK LLC for $29,929.20 .",
  "url": "https://sam.gov/opp/4484819093a44892b75f9ecb7e15e9a2/view",
  "noticeId": "4484819093a44892b75f9ecb7e15e9a2"
}
```

Fields SAM.gov does not publish for a notice come back as `null`.

### Use cases

Search phrases this actor is built for:

- **"SAM.gov contract opportunities by NAICS"**: pass one or more NAICS codes in `naics`.
- **"Search federal contract opportunities by keyword"**: enter your trade in `keywords` and keep `activeOnly` on.
- **"Federal contract solicitations with set-aside notices"**: read the `setAside` and `noticeType` fields, or filter with `noticeTypes` such as `r` Sources Sought.

Small contractors, bid writers and consultants use it to get today's solicitations without paging through SAM.gov.

### Pricing

Pay per result: each opportunity row returned is one billable result, listed at $0.005 per row ($5 per 1,000). Set a maximum charge on the run for a hard ceiling.

### Limits

- Data comes from SAM.gov's public search, the same data shown on the website. Descriptions are trimmed to 2,000 characters.
- `postedWithinDays` filters on the notice's last-modified date.
- `maxResults` is capped at 10,000 per run.
- Attachments and full solicitation documents are not downloaded; use the `url` field.

### FAQ

**Does it need a SAM.gov account or API key?** No.

**Does keyword search work like SAM.gov's own?** Yes, it passes your keywords to SAM.gov's search and matches titles and descriptions the same way.

**Can I get award notices?** Yes. Set `noticeTypes` to `["a"]` and set `activeOnly` to `false` if you want older awards.

# Actor input Schema

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

Words to search for, e.g. janitorial, HVAC, cybersecurity.

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

Leave empty for all. Codes: o = Solicitation, p = Presolicitation, k = Combined Synopsis/Solicitation, r = Sources Sought, a = Award Notice, s = Special Notice, g = Sale of Surplus, i = Intent to Bundle, u = Justification.

## `naics` (type: `array`):

e.g. 561720. Leave empty for all.

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

Only opportunities still open for response.

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

Only notices published in the last N days. 0 = any time.

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

Stop after this many opportunities.

## Actor input object example

```json
{
  "keywords": "janitorial",
  "noticeTypes": [],
  "naics": [],
  "activeOnly": true,
  "postedWithinDays": 30,
  "maxResults": 200
}
```

# Actor output Schema

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

All opportunities found, one row each; download as JSON, CSV or Excel.

# 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"
};

// Run the Actor and wait for it to finish
const run = await client.actor("hamsmoothie/sam-gov-opportunities").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "keywords": "janitorial" }

# Run the Actor and wait for it to finish
run = client.actor("hamsmoothie/sam-gov-opportunities").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "keywords": "janitorial"
}' |
apify call hamsmoothie/sam-gov-opportunities --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,hamsmoothie/sam-gov-opportunities"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/39KE42gZwfja4wY5e/builds/fqHrMHYYai8oBYX16/openapi.json
