# SAM.gov Contract Opportunities Scraper (`rejoiceful_xaphoon/samgov-opportunities`) Actor

- **URL**: https://apify.com/rejoiceful_xaphoon/samgov-opportunities.md
- **Developed by:** [Open Records Data](https://apify.com/rejoiceful_xaphoon) (community)
- **Categories:** Lead generation, Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$4.00 / 1,000 opportunity results

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 Scraper

Find U.S. federal contract opportunities on [SAM.gov](https://sam.gov) in seconds. Search by keyword, NAICS code, small-business set-aside, notice type, place-of-performance state and date, and get clean, structured results ready for your CRM, spreadsheet or bid-alert pipeline.

No SAM.gov API key, no rate-limit headaches, no login.

### Why use it

- **Fast and reliable**: 500 fully detailed notices in under 10 seconds.
- **Full details**: NAICS, PSC, set-aside, response deadline, agency hierarchy, place of performance, contracting officer contacts and the full description.
- **Daily alerts**: set `postedWithinDays: 1` and schedule it every morning to catch new solicitations before your competitors.
- **Small-business friendly**: filter by 8(a), HUBZone, SDVOSB, WOSB and other set-asides.

### Who it's for

Government contractors and BD teams, GovCon consultants, proposal writers, small businesses chasing set-asides, and bid-alert or market-intelligence products.

### Input example

```json
{
  "keywords": "cybersecurity",
  "naicsCodes": ["541512", "541519"],
  "setAsides": ["SBA", "SDVOSBC"],
  "noticeTypes": ["solicitation", "combined", "sources_sought"],
  "states": ["VA", "MD"],
  "postedWithinDays": 7,
  "maxItems": 200
}
```

### Output example

```json
{
  "noticeId": "48915c2e65c64202974a98c89c920c5b",
  "title": "DLA Disposition Services - Drain & Purge of Equipment",
  "solicitationNumber": "SP4510-26-Q-1046",
  "noticeType": "Combined Synopsis/Solicitation",
  "department": "DEPT OF DEFENSE",
  "agency": "DEFENSE LOGISTICS AGENCY",
  "office": "DLA DISPOSITION SERVICES - EBS",
  "postedDate": "2026-10-09T17:03:00Z",
  "responseDeadline": "2026-10-16T17:00:00Z",
  "naicsCodes": ["562119"],
  "pscCode": "S205",
  "setAside": "SBA",
  "placeOfPerformanceState": null,
  "contacts": [{"name": "...", "email": "...@dla.mil", "phone": "...", "type": "primary"}],
  "description": "Full notice text...",
  "url": "https://sam.gov/opp/48915c2e65c64202974a98c89c920c5b/view"
}
```

### Notes

- Data comes from SAM.gov's public search. SAM.gov caps any single search at 10,000 notices; narrow filters for larger pulls.
- Contacts are the government contracting officers published on each public notice.
- Turn off `includeDetails` for the fastest, cheapest title-level scan.

### Pricing

Pay per result: you are charged only for notices returned.

# Actor input Schema

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

Free-text search, e.g. 'cybersecurity' or 'janitorial services'. Leave empty for all.

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

How keywords are matched.

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

Filter by NAICS code(s), e.g. 541512.

## `setAsides` (type: `array`):

Only notices with these set-aside types.

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

Only these notice types.

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

Two-letter state codes, e.g. VA, TX.

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

Only notices posted or modified in the last N days. Great for daily alerts.

## `includeInactive` (type: `boolean`):

Also return closed notices.

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

Fetch NAICS, set-aside, place of performance, contacts and full description for each notice.

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

Maximum notices to return (SAM.gov caps a search at 10,000).

## Actor input object example

```json
{
  "keywords": "cybersecurity",
  "keywordMode": "ALL",
  "includeInactive": false,
  "includeDetails": true,
  "maxItems": 100
}
```

# Actor output Schema

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

All scraped records 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 = {
    "keywords": "cybersecurity"
};

// Run the Actor and wait for it to finish
const run = await client.actor("rejoiceful_xaphoon/samgov-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": "cybersecurity" }

# Run the Actor and wait for it to finish
run = client.actor("rejoiceful_xaphoon/samgov-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": "cybersecurity"
}' |
apify call rejoiceful_xaphoon/samgov-opportunities --silent --output-dataset

```

## MCP server setup

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