# US Federal Contract Opportunities (SAM.gov) (`delfielectronics/us-federal-opportunities`) Actor

SAM.gov contract opportunities from the official public extract: no API key, no proxy. Filter by NAICS, PSC, set-aside, agency, state, dates; daily alerts with onlyNew.

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

## Pricing

Pay per event

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 extract)

Get **US federal contract opportunities from SAM.gov** as clean JSON, straight from the official **public data
extract**: no API key, no login, no proxy and no browser. Solicitations, combined synopses, presolicitations,
sources sought, special notices and **award notices with amount and awardee**, filtered by **NAICS, PSC,
set-aside, agency, place-of-performance state, posting date, response deadline and keywords**.

Every notice becomes one record: notice id, title, solicitation number, notice type, department, sub-tier and
office (with CGAC, FPDS and AAC codes), posting date, **response deadline**, set-aside, NAICS, PSC, place of
performance, office address, award (number, date, amount, awardee), the SAM.gov link and the notice text.

### What you can use it for

- **Bid alerts**: run it daily with **Only notices not returned before** and get only new opportunities for your
  NAICS codes, set-asides and states.
- **Business development**: find agencies buying what you sell before the response deadline.
- **Competitor and market intelligence**: award notices with amounts and awardees, by agency and NAICS.
- **AI agents, CRMs and spreadsheets**: structured notices via the Apify API, integrations or MCP.

### How it works

1. The actor downloads the public **Contract Opportunities** CSV extract that SAM.gov publishes on its Data
   Services page (one file of all active notices, newest first), streaming it row by row.
2. Rows are filtered as they arrive; once the rows are older than your posting window, the download stops, so a
   7-day window reads only a few MB of the file.
3. With **Only notices not returned before**, a notice is returned once per memory name and set of filters
   (memory kept 400 days): a ready-made alert feed.

### Input

| Field | What it does |
|---|---|
| Notice types | Solicitation, combined synopsis/solicitation, presolicitation, sources sought, special notice, award notice, justification, modification, sale of surplus, bundle; empty = all |
| NAICS codes | Prefixes of 2-6 digits, e.g. `541` (professional services), `5415` (IT services), `236` |
| Product/service codes (PSC) | Prefixes, e.g. `D3` (IT services), `Y1` (construction) |
| Set-asides | e.g. Small Business, 8(a), HUBZone, SDVOSB, WOSB |
| Departments or agencies | Words in the department or sub-tier name, e.g. `veterans affairs`, `army` |
| Place of performance states | Two-letter codes, e.g. `VA`, `TX`, `DC`, `PR` |
| Posted in the last N days | 7 by default; 0 = the whole extract; or set **Posted from** / **Posted to** dates |
| Response deadline from | Keep notices still open on or after a date |
| Keywords | Whole words or phrases in the title |
| Include description | The notice text (on by default) |
| Only notices not returned before + Memory name | Daily alert feeds; one memory name per feed |
| Max notices | Stop after this many |

### Output example

```json
{
  "noticeId": "ca63d14ddc0a41908aad16e0fa965fcc",
  "title": "Micro Gin Motor Control Center Upgrade",
  "solicitationNumber": "124PSA27P0007",
  "noticeType": "award",
  "type": "Award Notice",
  "baseType": "Combined Synopsis/Solicitation",
  "department": "AGRICULTURE, DEPARTMENT OF",
  "subTier": "AGRICULTURAL RESEARCH SERVICE",
  "office": "USDA ARS AFM APD",
  "cgac": "012",
  "fpdsCode": "12H2",
  "aacCode": "1232SA",
  "postedAt": "2026-11-03 10:31:32",
  "postedDate": "2026-11-03",
  "responseDeadline": null,
  "archiveType": "auto15",
  "archiveDate": "2026-11-18",
  "setAside": {"code": "NONE", "label": "No Set aside used"},
  "naics": "238210",
  "psc": "J059",
  "placeOfPerformance": {"street": null, "city": "Stoneville", "state": "MS", "zip": "38776", "country": "USA"},
  "officeAddress": {"city": "BELTSVILLE", "state": "MD", "zip": "20705", "country": "USA"},
  "award": {"number": "124PSA27P0007", "date": "2026-11-03", "amount": 3295000.0,
            "awardee": "GENTRY CONTROLS & CONSULTING LLC Lago Vista TX 78645 USA"},
  "additionalInfoLink": null,
  "url": "https://sam.gov/opp/ca63d14ddc0a41908aad16e0fa965fcc/view",
  "description": "…",
  "source": "SAM.gov Contract Opportunities (public data extract)"
}
```

The run also writes a **SUMMARY** record to its key-value store: rows read and skipped, notices matched and saved,
the posting dates seen, bytes read and why the run stopped.

### Pricing

Pay per event, no subscription. The prices are on the **Pricing** tab; you are charged for two events:

| Event | When |
|---|---|
| Extract (`extract`) | once per run, just before the first notice is saved (or at the end of a run that read the file and matched nothing) |
| Opportunity (`opportunity`) | once per notice saved to the dataset |

- The extract fee is charged only when your remaining budget also covers at least one notice; otherwise nothing is
  downloaded. A run whose download breaks before any notice is saved fails and is not charged the extract fee.
- The form starts with **Max notices** = 100 for a cheap first run; the API default is 100000.
- Set a maximum cost per run in Apify and the actor stops cleanly when it is reached.

### Data and privacy

Source: **SAM.gov**, the official US government system for award management (General Services Administration).
The actor uses only the public data extract that SAM.gov publishes for download; it does not log in and does not
scrape the website. Works of the US federal government are in the public domain; credit: *Data from SAM.gov*.

Notices name the contracting officials who handle them: the actor **drops all contact columns** (names, titles,
e-mails, phones, fax) and **masks e-mail addresses and US phone numbers inside the notice text**
(`[email removed]`, `[phone removed]`); names written in the text stay as the agency published them. Awardees are companies published by law; the awardee is returned only for notices posted on
or after 4 April 2022 (older award data may include restricted third-party business data), while award number,
date and amount stay.

### Known limits

- The public extract holds the **latest version of each active notice** (about 70,000); archived notices and
  attachments are not included. SAM.gov refreshes the file daily.
- Notice texts are cut by SAM.gov at about 32,000 characters.
- Masking in the notice text covers e-mail addresses and 10-digit US phone numbers; 7-digit DSN numbers, foreign
  numbers and extensions written apart (`ext. 4476`) stay.
- A run without a posting window reads the whole file (about 216 MB); a window of days reads only its part.
- The file is published in Windows-1252 encoding; the rare characters it cannot hold are replaced and counted in
  the SUMMARY.

# Actor input Schema

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

Keep these SAM.gov notice types (current type of the notice). Empty = all types.

## `naics` (type: `array`):

Keep notices whose NAICS code starts with these 2-6 digits (e.g. 541 = professional services, 236 = building construction, 5415 = IT services). Empty = all.

## `psc` (type: `array`):

Keep notices whose PSC (classification code) starts with these 1-4 letters or digits (e.g. D3 = IT services, Y1 = construction). Empty = all.

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

Keep notices with these set-aside codes. Empty = all, including notices without a set-aside.

## `departments` (type: `array`):

Keep notices whose department or sub-tier agency contains any of these texts (e.g. defense, veterans affairs, army). Empty = all.

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

Two-letter US state or territory codes of the place of performance (e.g. VA, TX, DC, PR). Empty = everywhere, including notices without a place.

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

Notices posted on the last day of the window and the N days before it (US Eastern time); the window ends today, or on 'Posted to' when that is set. 0 = no lower limit (the whole public extract). Ignored when 'Posted from' is set.

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

First posting date to keep (YYYY-MM-DD). Overrides 'Posted in the last N days'.

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

Last posting date to keep (YYYY-MM-DD). Empty = up to today.

## `deadlineFrom` (type: `string`):

Keep only notices whose response deadline is on or after this date (YYYY-MM-DD), read in the deadline's own time zone as published; notices without a deadline are dropped when this is set.

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

Keep notices whose title contains any of these whole words or phrases (case ignored, e.g. cybersecurity, janitorial services). Empty = all.

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

Add the notice text (up to ~32,000 characters as published by SAM.gov), with e-mail addresses and US phone numbers masked.

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

Return only notices this actor has not returned to you before under the same memory name and filters (memory kept 400 days).

## `stateKey` (type: `string`):

Name of the 'Only notices not returned before' memory (1-50 letters, digits, - or \_). Use different names for separate alert feeds.

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

Stop after saving this many notices. The form starts at 100 for a cheap first run; the API default is 100000.

## Actor input object example

```json
{
  "noticeTypes": [],
  "naics": [
    "541"
  ],
  "psc": [],
  "setAsides": [],
  "departments": [],
  "states": [],
  "postedWithinDays": 7,
  "keywords": [],
  "includeDescription": true,
  "onlyNew": false,
  "stateKey": "default",
  "maxItems": 100
}
```

# Actor output Schema

## `overview` (type: `string`):

The run's opportunities in the Store table view.

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

Every field of every opportunity record.

# 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 = {
    "naics": [
        "541"
    ],
    "maxItems": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("delfielectronics/us-federal-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 = {
    "naics": ["541"],
    "maxItems": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("delfielectronics/us-federal-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 '{
  "naics": [
    "541"
  ],
  "maxItems": 100
}' |
apify call delfielectronics/us-federal-opportunities --silent --output-dataset

```

## MCP server setup

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