# SAM.gov Contract Opportunities - Federal Contracts Lookup (`j0401/sam-gov-contracts`) Actor

US federal contract opportunities from SAM.gov (85K+ live notices): solicitations, presolicitations, sources sought, awards and special notices across every agency. Filter by keyword, agency, NAICS, set-aside or state; look up one notice; see what changed; or count the market. No API key.

- **URL**: https://apify.com/j0401/sam-gov-contracts.md
- **Developed by:** [Wenhao Yang](https://apify.com/j0401) (community)
- **Stats:** 2 total users, 1 monthly users, 66.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.10 / 1,000 sam.gov 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?

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

## SAM.gov Contract Opportunities - Federal Contracts, Solicitations & Awards

👋 The US federal government posts every contract opportunity it intends to award over $25,000 to **SAM.gov** - solicitations, combined synopsis/solicitations, presolicitations, sources sought, sole-source justifications, awards, and special notices. This actor gives you that whole register as clean, structured records: **~85,000 live notices across every federal agency**, searchable by keyword, agency, NAICS code, set-aside, place of performance and date.

### Low cost

**From $0.0001 per notice** (per row delivered - a notice, or one summary row in aggregate mode). One hundredth of a cent.

Federal contract data has a reputation for being expensive and fussy - most ways in require a registered API key, and those keys expire on you. There is no key here: nothing to register, nothing to renew, nothing to wait for. We took the harder road so you don't have to - the register is pulled, reconciled and served fresh every day.

### What you can ask it

- **Find work you can actually bid on** - `keyword` + `deadlineFrom` finds notices still open for responses, with the deadline and the contracting office's own contact.
- **Chase a specific agency** - filter to `DEPT OF DEFENSE`, `VETERANS AFFAIRS`, `HOMELAND SECURITY`, or narrow to a contracting office like `DLA LAND AND MARITIME` or `CDC`.
- **Find your NAICS** - `54` for professional and technical services, `23` for construction, `33` for manufacturing, or an exact code like `541511`.
- **Small-business set-asides** - `SBA`, `SDVOSBC` (service-disabled veteran-owned), `WOSB` / `EDWOSB`, `8A`, `HZC` (HUBZone), and partial set-asides.
- **Who won what** - `awardedOnly` returns the notices that name a contractor, with the award number, date and dollar value as the agency filed them. Most carry all three; a few award notices arrive incomplete on the government's side.
- **What changed since yesterday** - `changes` reports new notices, shifted deadlines, fresh awards and cancellations against the previous daily snapshot.
- **The shape of the market** - `aggregate` counts notices by agency, sub-tier, place of performance (state) or contracting state, notice type, set-aside program, NAICS sector or month. Ask for the market summary with no filters at all and it answers instantly.

### Records

Every notice record carries these fields:

| | |
|---|---|
| **Identity** | `noticeId`, `title`, `solicitationNumber`, `type`, `baseType`, `link` |
| **Buyer** | `department`, `subTier`, `office`, `organizationType`, `contractingCity` / `State` / `Zip` |
| **Classification** | `naicsCode`, `classificationCode` (PSC), `setAsideCode`, `setAside` |
| **Place of performance** | `popCity`, `popState`, `popZip` |
| **Timing** | `postedDate`, `responseDeadline`, `archiveDate` |
| **Contact** | `primaryContactName` / `Email` / `Phone` |
| **Award (when placed)** | `awardNumber`, `awardDate`, `awardAmount`, `awardee` |
| **Text** | `description` - the notice's own summary |

Dates are normalized to ISO. `awardAmount` is a plain number. A notice record always carries these keys, in every mode that returns notices.

### Modes

| Mode | What it does |
|---|---|
| `search` *(default)* | Notices matching your filters |
| `notice` | One `noticeId`, in full |
| `changes` | What moved since the previous daily snapshot |
| `aggregate` | Counts by one dimension |

Leave `mode` blank and the actor routes for you: a `noticeId` looks that notice up; any filter (or "newest first") returns matching notices; a completely bare request returns the market summary.

### Notes on the data

- **What's in here is what SAM publishes.** A notice's own wording, agency, deadlines and award facts - as filed. We do not editorialize, score, or infer.
- **"Still open" means the response window is still ahead.** The register carries a deadline on most notices, but about two thirds of them are already past. `openOnly` tests the date, not merely its presence.
- **Money arrives as text in the government's file** (and, occasionally, as a sentence describing several line items). We keep only clean single values, so `awardAmount` never holds prose.
- **A few records carry bad dates** - the source occasionally files an award dated in the year 9202. Those dates are blanked rather than passed on (the notice itself is still delivered).
- **Award notices are the ones with a contractor named.** Everything else is an opportunity, not a signed contract.
- **Descriptions are truncated** at 1,000 characters to keep delivery fast. Each record's `link` opens the full notice on SAM.gov.

### Also worth knowing

Contract opportunities are notices of intent. A `Solicitation` is asking for bids; an `Award Notice` is a contract already placed; a `Special Notice` or `Sources Sought` is market research ahead of a solicitation. `type` tells you which you have.

Federal contracting has its own vocabulary - NAICS for industry, PSC (`classificationCode`) for product or service, and a ladder of set-aside programs for small business. All of it is in the records, unfiltered.

### Related actors

Looking for the demand side of a different market? The same house runs state and local government registers - Texas procurement and vendor data, Washington contracts and licenses, California licensing and permits - under the same low-cost, per-record model.

# Actor input Schema

## `mode` (type: `string`):

search = notices matching your filters. notice = one noticeId in full. changes = what moved since yesterday's snapshot. aggregate = counts by one dimension. Leave blank to auto-route: a noticeId looks up that notice; any filter (or newest first) returns notices; a bare request returns the market summary.

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

Free text, matched against the notice title, description and solicitation number. E.g. "software", "janitorial", "MRI".

## `noticeId` (type: `string`):

Exact SAM notice id (32 hex chars), e.g. "e54059f8ba714ac7805c86a5708db032". Returns that notice in full.

## `solicitationNumber` (type: `string`):

The agency's own solicitation number, e.g. "1232SA26P0430". Substring match.

## `noticeType` (type: `string`):

Blank = all. "Solicitation" and "Combined Synopsis/Solicitation" are the ones actually asking for bids; "Award Notice" is a contract already placed.

## `department` (type: `string`):

Top-level department, substring, e.g. "DEPT OF DEFENSE", "VETERANS AFFAIRS", "HOMELAND SECURITY". Use office to narrow to a contracting office (e.g. "DLA LAND AND MARITIME").

## `office` (type: `string`):

The specific contracting office, substring, e.g. "DLA LAND AND MARITIME", "CDC".

## `naicsCode` (type: `string`):

2-6 digits. A short prefix matches the whole sector: "54" = professional/technical services, "23" = construction, "33" = manufacturing. "541511" matches exactly.

## `setAside` (type: `string`):

Small-business set-aside program. SBA = total small business; SDVOSBC = service-disabled veteran-owned; WOSB / EDWOSB = women-owned; 8A = 8(a); HZC = HUBZone; SBP = partial small business; NONE = no set-aside used. Blank = all.

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

Two-letter state of the work, e.g. "TX", "VA". Matches only notices that carry a place of performance.

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

YYYY-MM-DD.

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

YYYY-MM-DD.

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

YYYY-MM-DD. Use with a keyword to find work you can still bid on.

## `deadlineTo` (type: `string`):

YYYY-MM-DD.

## `openOnly` (type: `boolean`):

Only notices whose response window is still ahead and which have not been awarded.

## `awardedOnly` (type: `boolean`):

Only notices that carry an award (awardee / award number present).

## `groupBy` (type: `string`):

For mode=aggregate. department / subTier = who is buying; state = place of performance (matches the state filter); contractingState = where the buying office sits; type = notice kind; setAside = small-business programs; naics2 = NAICS sector; postedMonth = notice volume by month. Blank = department.

## `aggregate` (type: `boolean`):

Turn on to return one summary row per group instead of individual notices.

## `newestFirst` (type: `boolean`):

Sort matches by posted date, newest first. On its own (no other filter) it still returns notices - the newest in the register - rather than the aggregate summary.

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

Cap the notices pushed (0 = a ceiling of 200; hard maximum 5000).

## Actor input object example

```json
{
  "openOnly": false,
  "awardedOnly": false,
  "aggregate": false,
  "newestFirst": false,
  "maxResults": 200
}
```

# Actor output Schema

## `recordsUrl` (type: `string`):

SAM.gov contract opportunities - as JSON

## `datasetUrl` (type: `string`):

No description

## `runUrl` (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("j0401/sam-gov-contracts").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("j0401/sam-gov-contracts").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 j0401/sam-gov-contracts --silent --output-dataset

```

## MCP server setup

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

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/b6S1AEx3BIzhLtjgF/builds/hoFZ1rJimfnJ4scto/openapi.json
