# US Federal Contract Opportunities - SAM.gov Public Data Feed (`noisy_jubilee/us-federal-contract-opportunities`) Actor

Daily U.S. federal contract opportunities from GSA's official SAM.gov public extract. Filter by NAICS, set-aside, agency, keyword and deadline; get only new notices. Contacts removed.

- **URL**: https://apify.com/noisy_jubilee/us-federal-contract-opportunities.md
- **Developed by:** [Stephen](https://apify.com/noisy_jubilee) (community)
- **Categories:** Lead generation, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.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

## US Federal Contract Opportunities - SAM.gov Public Data Feed

Find U.S. federal contract opportunities that fit your business. You can filter by **NAICS code** (prefixes work),
**set-aside** (SBA, 8(a), HUBZone, SDVOSB, WOSB...), **agency**, **keywords**, **notice type**, **posted date** and
**response deadline**. Schedule it daily with **"new since last run"** to get only fresh notices.

- **Official data, no scraping.** Reads the daily public Contract Opportunities extract that GSA publishes at
  [sam.gov/data-services](https://sam.gov/data-services). No login, no key.
- **Privacy-safe.** Contact names, emails and phone numbers are removed, from the contact columns and from description
  text. Awardee names are never output.
- **Clean output.** Windows-1252 text is decoded correctly, garbled characters are repaired, set-aside codes are
  normalised, and deadlines come in UTC alongside the original value.
- **Optional live API mode** with *your own* SAM.gov public API key, for fresher data than the daily file. (API mode is
  tested against recorded responses only; we have not yet run it with a live key.)

### Pricing (pay per event)

| Event | Price |
|---|---|
| Opportunity returned | $0.002 |
| Actor start (Apify standard, once per run) | $0.0003 |

Scanning, filtering and unchanged notices in "new" mode are free: a daily check that finds nothing new costs only the
$0.0003 start. 500 opportunities cost $1.00. Set **Max results** or a max charge per run to cap spend.

### Input examples

```json
{"naicsCodes": ["5415"], "setAsideCodes": ["SBA", "SDVOSBC"], "postedSince": "7 days", "onlyOpen": true}
```

```json
{"keywords": ["cybersecurity", "zero trust"], "agencies": ["VETERANS AFFAIRS"], "outputMode": "new", "snapshotName": "va-cyber"}
```

### Output (one item per notice)

Full real example: [listing/output-example.json](listing/output-example.json).

`noticeId, title, solicitationNumber, noticeType, baseType, department, subTier, office, cgac, fpdsCode, aacCode,
officeLocation, postedDate (US Eastern), postedAtUtc, responseDeadline, responseDeadlineUtc, archiveDate, setAsideCode,
setAside, naicsCode, classificationCode, placeOfPerformance, samUrl, additionalInfoUrl, description, award (only for
award notices: number/date/amount), changeType (new/updated in 'new' modes), source`.

### Notes

- The public extract is rebuilt once a day (about 23:30 US Eastern) and holds active notices only (about 71k).
- "New since last run" keeps a list of notice IDs in your named key-value store `us-contract-opportunities-state`.
  Use one `snapshotName` per saved search.
- **Default mode needs no key and has no request limit:** it reads the public daily extract file (one download per run).
- **Optional API mode** uses *your own* SAM.gov public API key (a secret input; never logged or stored in results).
  The ~10 requests/day limit reported for non-federal keys applies **only to this optional API mode**, not to the
  default extract mode. Each request returns up to 1,000 notices; `maxApiRequests` defaults to 3. Descriptions aren't
  included in API mode. (The 10/day figure comes from SAM.gov's docs/forums and we haven't verified it.)
- **Award notices** are an optional filter, **off by default**. Turn on **Include award notices** (or pick "Award
  Notice" in Notice types) to get them with award number, date and amount. Awardee names are never output.
- **Agency point-of-contact fields are excluded.** The extract's Primary/Secondary contact name, title, email, phone
  and fax columns are never output. Emails and phone numbers are also redacted from titles and descriptions, and
  `mailto:` links are dropped (best effort). Use the `samUrl` link to read the full notice on SAM.gov.

### Limits

- Our test run scanned the full extract (70,878 rows, 213 MB) in about 3.5 s at 256 MB memory; the extract is streamed, not
  loaded into memory. 256 MB is the default.
- `maxResults` default 500. Data is as fresh as GSA's daily file (see Notes).

### Source and disclaimer

Data: SAM.gov Contract Opportunities public data extract, U.S. General Services Administration
(https://sam.gov/data-services). This Actor is unofficial and is not affiliated with or endorsed by GSA or SAM.gov.
Notice text is reproduced as published, with contact details removed. Always check the official notice before bidding.

### No warranty

Provided as is, without warranty of any kind. Results are automated and can be incomplete or wrong; check anything important against the original source before relying on it.

# Actor input Schema

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

NAICS codes or prefixes (e.g. '5415' matches 541511, 541512...). Empty = all.

## `setAsideCodes` (type: `array`):

SAM.gov set-aside codes, e.g. SBA, SBP, 8A, 8AN, HZC, HZS, SDVOSBC, SDVOSBS, WOSB, WOSBSS, EDWOSB, EDWOSBSS, VSA, VSS, LAS, IEE, ISBEE, BICiv. Empty = any (including none).

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

Case-insensitive text matched against department, sub-tier and office names and codes, e.g. 'VETERANS AFFAIRS', 'ARMY', '3600'.

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

Case-insensitive words or phrases matched in the title (and description, if enabled).

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

'any' = at least one keyword must appear; 'all' = every keyword must appear.

## `searchDescription` (type: `boolean`):

Match keywords in the notice description as well as the title.

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

Only these notice types. Empty = all except award notices.

## `includeAwardNotices` (type: `boolean`):

Award notices are excluded by default. Awardee names are never output (they can identify sole proprietors).

## `placeOfPerformanceStates` (type: `array`):

Two-letter US state codes, e.g. VA, DC, CA. Note: most notices leave this blank, so this filter is strict.

## `postedSince` (type: `string`):

YYYY-MM-DD or relative like '3 days', '2 weeks', '1 month'. Posted dates are U.S. Eastern.

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

YYYY-MM-DD or relative (e.g. '0 days' = today). Notices without a deadline are excluded when a deadline range is set.

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

YYYY-MM-DD. Notices without a deadline are excluded when a deadline range is set.

## `onlyOpen` (type: `boolean`):

Drop notices whose response deadline is already in the past. Notices without a deadline are kept.

## `outputMode` (type: `string`):

'all' = every match. 'new' = only notices not seen in the previous run of this snapshot. 'newOrUpdated' = also notices whose title, type, deadline, set-aside, NAICS or description changed. Unchanged notices are free.

## `snapshotName` (type: `string`):

Use a different name per saved search when using 'new' modes. Stored in your named key-value store 'us-contract-opportunities-state'.

## `includeDescription` (type: `boolean`):

Include the notice description (emails, phone numbers and labelled contact names are removed).

## `maxDescriptionChars` (type: `integer`):

Truncate long descriptions to this many characters.

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

Stop after this many output items (0 = no limit). Each output item is one billable event.

## `dataSource` (type: `string`):

'extract' = GSA's daily public extract (no key, refreshed once a day). 'api' = the SAM.gov Get Opportunities public API using YOUR OWN key (fresher; no descriptions).

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

Only for dataSource 'api'. Get it from your SAM.gov Account Details page. It is used only for your run and never logged or stored.

## `maxApiRequests` (type: `integer`):

Cap on API pages (1,000 notices each). Non-federal SAM.gov keys may be limited to about 10 requests per day.

## Actor input object example

```json
{
  "naicsCodes": [
    "541511",
    "541512"
  ],
  "keywordMode": "any",
  "searchDescription": true,
  "includeAwardNotices": false,
  "postedSince": "7 days",
  "onlyOpen": true,
  "outputMode": "all",
  "snapshotName": "default",
  "includeDescription": true,
  "maxDescriptionChars": 20000,
  "maxResults": 500,
  "dataSource": "extract",
  "maxApiRequests": 3
}
```

# Actor output Schema

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

One row per matching SAM.gov contract opportunity (contact fields removed).

## `summary` (type: `string`):

SUMMARY record in the default key-value store: counts, charges and status of the run.

# 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 = {
    "naicsCodes": [
        "541511",
        "541512"
    ],
    "postedSince": "7 days"
};

// Run the Actor and wait for it to finish
const run = await client.actor("noisy_jubilee/us-federal-contract-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 = {
    "naicsCodes": [
        "541511",
        "541512",
    ],
    "postedSince": "7 days",
}

# Run the Actor and wait for it to finish
run = client.actor("noisy_jubilee/us-federal-contract-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 '{
  "naicsCodes": [
    "541511",
    "541512"
  ],
  "postedSince": "7 days"
}' |
apify call noisy_jubilee/us-federal-contract-opportunities --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,noisy_jubilee/us-federal-contract-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/pyXHyPZbfhlqxNDr3/builds/eUWbgtKwgTJDCa413/openapi.json
