# SAM.gov Contract Opportunities API - Federal Procurement Search (`bridged/sam-gov-opportunities-api`) Actor

Search and pull US federal contract opportunities (solicitations, RFPs, sources sought) from the official SAM.gov Get Opportunities Public API.

- **URL**: https://apify.com/bridged/sam-gov-opportunities-api.md
- **Developed by:** [Zihan Poh](https://apify.com/bridged) (community)
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 opportunities

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 API

Search US federal contract opportunities (solicitations, presolicitations, sources sought, award
notices) from the official **SAM.gov Get Opportunities Public API** — no scraping, no login bypass.

### Why this exists

Existing SAM.gov actors on the store have almost no reviews and low traction, but the niche is
completely unowned — nobody has combined keyword + NAICS + set-aside + place-of-performance
filtering with clean normalized output at a fair price. Federal contract data is public domain, so
this is low-risk, low-cost to run, and useful to any small business doing government contracting
lead generation.

### You need your own free API key

SAM.gov has no shared/public key. Register at [sam.gov](https://sam.gov), go to your Account
Details page, and request a public API key (instant, free). Pass it as `apiKey` in the input.

### Input

```json
{
  "apiKey": "your-sam-gov-api-key",
  "postedFrom": "09/01/2026",
  "postedTo": "09/16/2026",
  "keyword": "software",
  "naicsCode": ["541511"],
  "active": true,
  "maxResults": 500
}
```

`postedFrom`/`postedTo` are required and the date window can't exceed one year (a SAM.gov API
limit, not this actor's).

### Output (one row per opportunity)

```json
{
  "noticeId": "abc123",
  "title": "IT Support Services",
  "solicitationNumber": "...",
  "department": "DEPT OF DEFENSE.DEPT OF THE ARMY...",
  "type": "Solicitation",
  "active": "Yes",
  "postedDate": "2026-09-10",
  "responseDeadLine": "2026-10-01T17:00:00-04:00",
  "naicsCode": "541511",
  "setAside": "SBA",
  "placeOfPerformance": { "city": "Washington", "state": "DC", "zip": "20001", "country": "USA" },
  "pointOfContact": [{ "type": "primary", "fullName": "...", "email": "..." }],
  "uiLink": "https://sam.gov/opp/abc123/view",
  "licence": "US federal government public data (public domain, no copyright)."
}
```

### Pricing

Pay-per-result: one `opportunity` event per row. $1.00 per 1,000, no start fee.

### Data source and legality

The SAM.gov Get Opportunities API (`api.sam.gov/opportunities/v2/search`) is an official US
government API. Federal procurement notices are public-domain government records — no
robots.txt, no ToS restriction on reuse. Point-of-contact names/emails on a notice are the
contracting officer's official government contact info (business data, not private-individual
personal data), published specifically so vendors can respond.

**Rate limits:** SAM.gov's public documentation states request limits are role-based but doesn't
publish an exact number. This actor throttles itself to roughly 1 request/second and never
rotates keys/IPs to exceed whatever limit applies to the caller's key.

### Getting started

```bash
apify run
```

### Deploy to Apify

```bash
apify login
apify push
```

# Actor input Schema

## `apiKey` (type: `string`):

Required. Get a free public API key at sam.gov (register, then Account Details -> Request Public API Key). SAM.gov has no shared/public key option.

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

Required. MM/dd/yyyy. Start of the posting-date window (max 1 year range).

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

Required. MM/dd/yyyy. End of the posting-date window (max 1 year range).

## `keyword` (type: `string`):

Free-text search across opportunity title.

## `naicsCode` (type: `array`):

e.g. \["541511"] for computer systems design.

## `state` (type: `string`):

Two-letter US state code, e.g. CA.

## `zip` (type: `string`):

5-digit US ZIP code to filter place of performance.

## `ptype` (type: `array`):

One or more of: o (Solicitation), p (Presolicitation), k (Combined Synopsis/Solicitation), r (Sources Sought), g (Sale of Surplus Property), s (Special Notice), a (Award Notice), i (Intent to Bundle).

## `setAsideType` (type: `string`):

e.g. SBA (Small Business), 8A, WOSB, SDVOSB.

## `active` (type: `boolean`):

Only currently open opportunities.

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

Stop after this many opportunities.

## Actor input object example

```json
{
  "active": true,
  "maxResults": 1000
}
```

# Actor output Schema

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

No description

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("bridged/sam-gov-opportunities-api").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("bridged/sam-gov-opportunities-api").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 '{}' |
apify call bridged/sam-gov-opportunities-api --silent --output-dataset

```

## MCP server setup

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

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/HTGqWVDdv5Zfgxetw/builds/cZSJYwmIYj4uQGbCf/openapi.json
