# SAM.gov Contract Opportunity Alerts (`texxupport/sam-gov-contract-opportunity-alerts`) Actor

New US federal contract opportunities from SAM.gov as clean data: title, agency, deadline, NAICS code, set-aside and contact. Filter by keyword and run it on a schedule to get only new notices. Needs your own free SAM.gov API key.

- **URL**: https://apify.com/texxupport/sam-gov-contract-opportunity-alerts.md
- **Developed by:** [Kye Williams](https://apify.com/texxupport) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 contract notices

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 Opportunity Alerts

Get new U.S. federal contract opportunities from SAM.gov as clean data: the title, the agency, the notice type, the response deadline, the NAICS code, the set-aside, the contracting contact and a link to the notice. Search by keyword, filter by agency, NAICS code, set-aside, state and deadline, and run it on a schedule to receive only notices you have not seen.

**You need your own free SAM.gov API key.** The Actor calls SAM.gov's official Get Opportunities API with your key, so the requests count against your own SAM.gov allowance, not anyone else's. Getting a key takes a few minutes (see "Get your SAM.gov API key" below).

### Who it is for

- **Small businesses and government contractors** who want a daily list of bids that match their work.
- **Proposal and business-development teams** tracking sources-sought and presolicitation notices early.
- **Analysts and researchers** building datasets of federal opportunities and awards.
- **Automations and AI agents** that need a dependable "what did agencies just post?" feed.

### What you get

One row per notice. Each row includes:

- `noticeId`, `title`, `solicitationNumber`, `agency` (the full agency path), `postedDate`, `noticeType` and `baseType`
- `responseDeadline`, `naicsCode`, `classificationCode`, `setAside` (plain description) and `setAsideCode`, and `active`
- `placeOfPerformance` (as one line) and `placeOfPerformanceState`
- `contactName`, `contactEmail`, `contactPhone` (the primary contact) and `contacts` (up to five)
- `award` for award notices: date, number, amount in USD, awardee name and UEI
- `sourceUrl` (the notice's page on sam.gov), `descriptionUrl`, `additionalInfoUrl`, and `attachmentCount` with `attachmentLinks`

Example row (illustrative values):

```json
{
  "noticeId": "a1b2c3d4e5f6",
  "title": "Cloud migration support services",
  "solicitationNumber": "W911QY-26-R-0042",
  "agency": "DEPT OF DEFENSE.DEPT OF THE ARMY.ARMY CONTRACTING COMMAND",
  "postedDate": "2026-10-02",
  "noticeType": "Solicitation",
  "responseDeadline": "2026-10-30T17:00:00-04:00",
  "naicsCode": "541511",
  "setAside": "Total Small Business Set-Aside (FAR 19.5)",
  "contactName": "Pat Buyer",
  "contactEmail": "pat.buyer@army.example",
  "placeOfPerformance": "Arlington, VA, 22202, USA",
  "sourceUrl": "https://sam.gov/opp/a1b2c3d4e5f6/view"
}
```

### Get your SAM.gov API key

1. Sign in to SAM.gov (create a free account if you do not have one).
2. Open your Account Details page and request a public API key.
3. Paste the key into the **SAM.gov API key** field of this Actor. It is stored as a secret setting, so it is hidden after you save it.

SAM.gov limits how many requests a key can make per day, and the limit depends on the type of account. Accounts without a federal role get a small daily allowance, so this Actor is built to use few requests: one request returns up to 1,000 notices, and the default cap is 5 requests per run. Your own limit is shown in SAM.gov; if you reach it, the Actor stops politely and keeps what it already delivered.

### Input

| Field | What it does |
| --- | --- |
| `samApiKey` | Your SAM.gov API key (required). |
| `keywords` | Words to look for in notice titles. Each keyword is a separate search and costs one request. Leave empty to list every notice in the date window. |
| `excludeKeywords` | Skip notices whose title contains any of these words. |
| `noticeTypes` | Solicitation, presolicitation, combined synopsis, sources sought, special notice, award notice, justification, surplus sale, intent to bundle. Empty means all. |
| `agencies` | Only notices whose agency path contains one of these words (for example VETERANS AFFAIRS). |
| `naicsCodes` | Industry codes. A short code such as 5415 matches every code that starts with it. |
| `setAsides` | Only notices reserved for these kinds of businesses (small business, 8(a), HUBZone, service-disabled veteran-owned, women-owned and others). |
| `states` | Two-letter state codes for the place of performance. |
| `activeOnly` | Skip notices SAM.gov marks as no longer active. On by default. |
| `responseDeadlineFrom`, `responseDeadlineTo` | Only notices whose response deadline falls in this window. Notices with no deadline are left out when you use it. |
| `daysBack`, `dateFrom`, `dateTo` | The posted-date window. Default: the last 3 days. SAM.gov allows at most one year. |
| `onlyNew` | Deliver only notices this Actor has not delivered for this exact search. On by default. |
| `maxResults` | Stop after this many notices. Default 100, up to 10,000. |
| `maxRequests` | Safety limit on requests to SAM.gov per run. Default 5. |

When you choose exactly one notice type, NAICS code, set-aside or state, the filter is sent to SAM.gov so fewer notices have to be downloaded. With several values, the Actor downloads the window and filters the results itself.

### Alerts on a schedule

1. Paste your key, add your `keywords` and any filters.
2. Leave `onlyNew` on and set `daysBack` to a little more than the gap between runs (for example 3 for a daily schedule).
3. Schedule the Actor from the Apify Console (for example every morning).
4. Each run delivers only notices you have not seen. If a run stops early (cost cap, request cap, key allowance or time limit), the next run continues where it stopped.

The "already delivered" list is kept in a storage called `sam-contract-alerts-state` in your own Apify account, with one list per distinct search.

### Pricing

You pay per notice delivered (pay per event). Apify's platform usage for the run is included, so you are not billed for it separately. See the Pricing tab for the current price. Set a maximum cost per run in the run options to cap spending: the Actor stops as soon as the cap is reached. SAM.gov itself does not charge for the API.

### Limits and good to know

- **Your key, your allowance.** If SAM.gov reports that your key has used its requests for the day, the run ends with a note and the notices already delivered are kept.
- **Large searches.** SAM.gov can report more matching notices than it hands back in one reply. When that happens the Actor reads the period one day at a time, newest day first, and tells you in the run's status message if a single day still had more than it could retrieve. Adding a keyword, notice type or NAICS code narrows the search.
- **Keywords search titles.** A keyword matches the notice title, not the full description text.
- **Descriptions and attachments.** `descriptionUrl` and the attachment links are the addresses SAM.gov provides; they are given without your key. Opening them through the API may need your key added, as SAM.gov's documentation describes.
- **Posted dates.** The window uses the date a notice was posted. Updates and amendments to older notices are not tracked as new notices.
- Notice content is written by the agencies. Always check the notice on sam.gov before you act on it.

### Data source and disclaimer

Data comes from the SAM.gov Get Opportunities API, a public service of the U.S. General Services Administration. This Actor is not affiliated with, endorsed by or sponsored by SAM.gov, the General Services Administration or any government agency.

# Actor input Schema

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

Required unless the Actor's owner has set one. Free: sign in to SAM.gov, open Account Details and request a public API key. SAM.gov limits how many requests a key may make per day (a small number for most accounts), so this Actor keeps its requests low.

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

Each keyword is a separate search of notice titles and costs one request to SAM.gov. Leave empty to list every notice in the date window.

## `excludeKeywords` (type: `array`):

Notices whose title contains any of these words are skipped.

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

Leave empty for all types. Solicitations and combined synopses are the notices that ask for bids.

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

Only notices whose agency path contains one of these words, for example VETERANS AFFAIRS or ARMY.

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

Industry codes such as 541511. A shorter code (like 5415) matches every code that starts with it.

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

Only notices reserved for these kinds of businesses. Leave empty for all.

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

Two-letter state codes such as VA or TX.

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

Skip notices SAM.gov marks as no longer active.

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

Only notices whose response deadline falls on or after this date, written YYYY-MM-DD. Notices with no deadline are left out when you use this.

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

Only notices whose response deadline falls on or before this date, written YYYY-MM-DD.

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

How many days before the end date to look, by posted date. Ignored when you fill in a start date.

## `dateFrom` (type: `string`):

First posted date to include, written YYYY-MM-DD. At most one year before the end date.

## `dateTo` (type: `string`):

Last posted date to include, written YYYY-MM-DD. Defaults to today (UTC).

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

Turn this on and run the Actor on a schedule to get an alert-style feed. The Actor remembers which notices it delivered for this exact search.

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

Stop after this many notices. You pay per notice delivered, so this also caps your cost.

## `maxRequests` (type: `integer`):

Safety limit. Each request counts against your SAM.gov key's daily allowance. Raise it only if your key allows more.

## Actor input object example

```json
{
  "keywords": [
    "software",
    "cybersecurity"
  ],
  "activeOnly": true,
  "daysBack": 3,
  "onlyNew": true,
  "maxResults": 100,
  "maxRequests": 5
}
```

# Actor output Schema

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

Every notice delivered by this run, as a table you can download as CSV, Excel or JSON.

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

// Run the Actor and wait for it to finish
const run = await client.actor("texxupport/sam-gov-contract-opportunity-alerts").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",
        "cybersecurity",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("texxupport/sam-gov-contract-opportunity-alerts").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",
    "cybersecurity"
  ]
}' |
apify call texxupport/sam-gov-contract-opportunity-alerts --silent --output-dataset

```

## MCP server setup

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

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/lIpToQu69r6hjybPC/builds/GnrilhzzQouCyyYyr/openapi.json
