# SAM.gov Federal Contract Monitor (`wongway_ventures/us-federal-contract-monitor`) Actor

Monitor US federal contract opportunities from SAM.gov. Normalized records with agency, NAICS codes, and deadlines. Monitoring mode delivers only new opportunities per scheduled run. Bring your free SAM.gov API key.

- **URL**: https://apify.com/wongway\_ventures/us-federal-contract-monitor.md
- **Developed by:** [Anthony Wong](https://apify.com/wongway_ventures) (community)
- **Categories:** Lead generation, Developer tools
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 tender records

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## US Federal Contract Monitor — SAM.gov

Monitor US federal contract opportunities from **SAM.gov** — the official government system for
federal contracting. This SAM.gov scraper searches the official Get Opportunities API and returns
clean, normalized opportunity records: title, agency, posted date, deadline, NAICS code, and a
link to the notice. No login, no proxies, no personal data.

### What data does this SAM.gov monitor return?

| Field | Description |
|---|---|
| sourceId | Stable unique SAM.gov notice ID |
| title | Opportunity title |
| buyer | Contracting agency / office |
| publishedAt | Posted date |
| deadline | Response deadline where published |
| naicsCodes | NAICS industry classification codes |
| noticeType | Solicitation, Award Notice, Special Notice, etc. |
| url | Link to the official SAM.gov notice |

### Only pay for NEW opportunities (monitoring mode)

Turn on **New opportunities only**, give your saved search a Monitor ID, and schedule the Actor.
Each run delivers — and bills — only opportunities it has never seen before for that monitor.
Perfect for federal contractors and BD teams tracking a niche.

### How much does it cost?

Pay per result. You only pay for delivered opportunities; a spending cap you set is enforced
automatically, and the run stops cleanly when it is reached.

### How do I use it?

1. Enter keywords (e.g. `software`, `cybersecurity`, `construction`).
2. Optionally filter by NAICS code and days back.
3. Paste your free SAM.gov API key (sam.gov → Account Details → API Key).
4. Run — or schedule with **New opportunities only** for a monitoring feed.

### Where does the data come from?

Exclusively from the official **SAM.gov Get Opportunities API** — US federal opportunity data,
which is public domain. Every run writes a `SOURCE_TRACEABILITY` record listing each API request.
Point-of-contact personal details are deliberately stripped; the official notice link is included.

### Can AI agents use this Actor?

Yes — it runs with limited permissions and pay-per-event pricing, so it is consumable by AI
agents, including x402 agentic payments.

### FAQ

#### Do I need a SAM.gov API key, and what are the limits?

Yes — a free key from sam.gov (Account Details → API Key). A basic personal key has a low daily
request quota; a key tied to a registered entity gets a higher quota. **SAM.gov rotates keys
every 90 days** (with a 15-day overlap and email warnings) — update the key in the input when it
changes.

#### Is it legal to collect SAM.gov opportunities?

This Actor consumes the official public API published for exactly this purpose. US federal
opportunity data is public domain.

#### Looking for EU tenders?

See our companion **EU Tender Monitor — TED** for European public procurement (no API key needed).

#### What happens when my budget runs out mid-run?

The run stops cleanly at your spending cap. Everything already delivered stays in the dataset;
you are never billed past the cap.

# Actor input Schema

## `keywords` (type: `array`):

Full-text keywords to match in SAM.gov opportunity titles (OR-combined). Example: software, cybersecurity, cloud.

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

NAICS industry codes to filter by, e.g. 541511 (custom programming). Optional. SAM.gov applies one NAICS code per query.

## `daysBack` (type: `integer`):

Only opportunities posted within the last N days.

## `newOnly` (type: `boolean`):

Only return opportunities not seen in previous runs with the same Monitor ID — ideal for scheduled runs. You are only charged for NEW opportunities.

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

Names the memory used by monitoring mode. Use one ID per saved search (e.g. 'cyber-weekly'). Defaults to a fingerprint of your filters.

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

Stop after this many opportunities. Each delivered opportunity is one billed result — keep small for trial runs.

## `samApiKey` (type: `string`):

Your free SAM.gov API key (sam.gov -> Account Details -> API Key). Required. Note: SAM.gov rotates keys every 90 days — update it here when it changes.

## Actor input object example

```json
{
  "keywords": [
    "software"
  ],
  "naicsCodes": [],
  "daysBack": 7,
  "newOnly": false,
  "maxResults": 25
}
```

# Actor output Schema

## `opportunities` (type: `string`):

One normalized federal opportunity per row: title, agency, posted date, deadline, NAICS code, and a link to the SAM.gov notice.

# 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": [
        "software"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("wongway_ventures/us-federal-contract-monitor").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": ["software"] }

# Run the Actor and wait for it to finish
run = client.actor("wongway_ventures/us-federal-contract-monitor").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": [
    "software"
  ]
}' |
apify call wongway_ventures/us-federal-contract-monitor --silent --output-dataset

```

## MCP server setup

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

```

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/EJMdxalAKO2SDsFrU/builds/LsAYfIxwbtnSs1knu/openapi.json
