# SAM.gov Contract Opportunities (US Federal Tenders) (`ayuki/samgov-contract-opportunities`) Actor

Search US federal contract opportunities from the official SAM.gov Opportunities API with your own free API key. Filter by posted date, NAICS, PSC, set-aside, notice type, state and keyword.

- **URL**: https://apify.com/ayuki/samgov-contract-opportunities.md
- **Developed by:** [LV Data Tools](https://apify.com/ayuki) (community)
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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 Opportunities (US Federal Tenders)

Search **US federal government contract opportunities** from the official **SAM.gov Get Opportunities API**: solicitations, presolicitations, sources sought, combined synopsis/solicitations, special notices and award notices. Filter by **posted date, NAICS code, PSC (product service code), small-business set-aside, notice type, place-of-performance state and title keyword**, and export to JSON, CSV or Excel.

Unofficial tool. **Source: SAM.gov**

### You need your own free SAM.gov API key

This Actor does not include an API key. You enter your own in the `samApiKey` field (stored as an encrypted secret input, never logged or written to output).

1. Sign in (or create a free account) at [SAM.gov](https://sam.gov).
2. Open your profile → **Account Details**.
3. Under **Public API Key**, enter your account password and request/view the key. Copy it right away; it is visible until you leave the page.
4. Paste it into `samApiKey`.

**Keys expire every 90 days.** Generate a new one on the same page and update your input/schedule when it expires.

#### Rate limits

Non-federal SAM.gov keys are limited to about **10 requests per day**. The Actor uses the maximum page size (1,000 notices per request), stops as soon as it has `maxItems` results, and never makes more than `maxRequests` (default 2) requests per run. With the default `maxItems` = 100, a run uses **one** request. If the daily limit is reached you get a clear error ("daily request limit reached"); try again the next day or narrow the date range.

### Input

| Field | Description |
|---|---|
| `samApiKey` | **Required**, secret. Your SAM.gov public API key |
| `postedFrom` / `postedTo` | YYYY-MM-DD; default last 7 days; max range 1 year |
| `noticeTypes` | `o` Solicitation, `k` Combined Synopsis/Solicitation, `p` Presolicitation, `r` Sources Sought, `s` Special Notice, `a` Award Notice, `u` Justification, `g` Sale of Surplus Property, `i` Intent to Bundle |
| `naicsCode` | e.g. `541511` |
| `pscCode` | e.g. `D302` |
| `setAside` | e.g. `SBA`, `8A`, `SDVOSBC`, `WOSB`, `HZC` |
| `state` | Place of performance, e.g. `VA` |
| `keyword` | Title keyword |
| `includePointOfContact` | Include contracting-officer contacts (default **false**) |
| `maxItems` | Default **100** |
| `maxRequests` | Default 2, max 10 |

```json
{"samApiKey": "<your key>", "noticeTypes": ["o", "k"], "naicsCode": "541511", "setAside": "SBA", "maxItems": 100}
```

### Output

```json
{
  "noticeId": "ffb2ba56e3204bc8827838747d4af048",
  "title": "26-SIMACQ-E30-0034 Cell Phone Repeaters Removal and Replacement",
  "solicitationNumber": "N6339427Q4002",
  "agencyPath": "DEPT OF DEFENSE.DEPT OF THE NAVY.NAVSEA.NAVSEA WARFARE CENTER.COMMANDING OFFICER",
  "noticeType": "Combined Synopsis/Solicitation",
  "postedDate": "2026-10-14",
  "responseDeadline": "2026-10-27T15:00:00-07:00",
  "naicsCode": "517112",
  "pscCode": "DG10",
  "setAsideCode": "SBA",
  "setAside": "Small Business Set Aside - Total",
  "placeOfPerformance": {"city": "Port Hueneme CBC Base", "state": "CA", "zip": "93043", "country": "USA"},
  "award": null,
  "descriptionApiUrl": "https://api.sam.gov/prod/opportunities/v1/noticedesc?noticeid=ffb2ba56e3204bc8827838747d4af048",
  "resourceLinks": ["https://sam.gov/api/prod/opps/v3/opportunities/resources/files/bafc790a245e4b6889ca8df61df01c3c/download"],
  "url": "https://sam.gov/opp/ffb2ba56e3204bc8827838747d4af048/view",
  "attribution": "Source: SAM.gov"
}
```

Award notices include `award` (date, number, amount, awardee name, UEI, city/state). `descriptionApiUrl` needs your API key appended to download the full text; the Actor does not fetch it to save your daily quota. `RUN_STATS` records requests used and total matches.

### Data source and terms

**Source: SAM.gov.** Data comes from the SAM.gov Get Opportunities Public API (General Services Administration). Works of the US Government are generally in the public domain; this Actor is not affiliated with or endorsed by GSA or SAM.gov and uses no government logo or seal. Award notices posted before 2022-04-04 are not provided. Use your own API key in line with SAM.gov's terms of use.

### Personal data

Notices list contracting-officer contacts. These **points of contact are excluded by default**. Enable `includePointOfContact` only if you need them to respond to an opportunity, and don't use them for unrelated marketing.

### Privacy notice

Controller: **Artyom Kutnevskiy (trading as LV Data Tools), contact lvdatatools@gmail.com**. Version 0.1, 2026-10-15.

- **Data concerned:** US federal contract opportunity notices published on SAM.gov: notice IDs, titles, agencies, notice types, dates, NAICS/PSC codes, set-asides, place of performance, office address and award details (award number, amount, awardee business name, UEI and city/state). Notices also contain contracting-officer **points of contact** (name, title, email, phone).
- **Minimisation:** points of contact are **excluded by default**; they are output only if you enable `includePointOfContact`, for the purpose of responding to the opportunity. Notice description texts are not downloaded (only the SAM.gov API link to them, without any key). Award notices posted before 2022-04-04 are skipped. Awardees are normally businesses; a sole proprietor's business name may coincide with a person's name.
- **Source:** SAM.gov Get Opportunities Public API (`api.sam.gov/opportunities/v2/search`), called with **your own** API key. Source: SAM.gov. SAM.gov data is a US Government work and generally in the public domain; it is not an endorsement by GSA or SAM.gov.
- **Your API key:** entered as a secret (encrypted) input, used only for requests to api.sam.gov during your run, and never logged, stored in output or shared. The Actor contains no key of its own.
- **Roles:** the publisher (LV Data Tools) is controller for the Actor's own source collection and minimisation, and acts as processor for each user's run output under §5.2 of the Apify Standard Actor Contract, while the user is controller of that output and its reuse.
- **Purpose:** discovery of federal contracting opportunities and award research for businesses. No profiling of people, contact enrichment or automated decision-making about individuals. Do not use contact data for unrelated marketing.
- **Legal basis:** Art. 6(1)(f) GDPR (legitimate interest), with the minimisation above. Users must establish the basis for their own reuse.
- **Recipients:** the user running the Actor and recipients they choose. Apify Technologies s.r.o. provides the hosting platform. Datasets are not automatically sent to other parties by this Actor.
- **Retention:** LV Data Tools keeps no separate copy of output. Responses are processed in memory. Output datasets and `RUN_STATS` follow the user's Apify storage/retention settings. Logs contain counters only, never the API key or records.
- **Transfers outside the EEA:** the source is in the US and hosting may involve transfers depending on Apify's infrastructure; see [Apify's privacy policy](https://apify.com/privacy-policy).
- **Rights:** access, rectification, erasure, restriction, objection (Art. 21) and complaint to a supervisory authority, e.g. Latvia's Datu valsts inspekcija ([dvi.gov.lv](https://www.dvi.gov.lv/)). Requests concerning the Actor go to lvdatatools@gmail.com; for a user's exported dataset, contact that user as well. Corrections to notices themselves are made by the publishing agency on SAM.gov.
- **Individual notification / Art. 14(5)(b) assessment (2026-10-15):** contacts are excluded by default and no separate copy of output is kept; officials appear in notices their agency chose to publish for contracting purposes. Individual notification would involve disproportionate effort; safeguards are this public notice, contact exclusion by default and individual handling of objections.

### FAQ

**Why do I need my own key?** SAM.gov issues personal API keys with daily limits; sharing one key across users is not allowed and would exhaust its quota.

**Can I get more than 1,000 results?** Raise `maxItems` and `maxRequests` (each request = up to 1,000 notices). `RUN_STATS.truncatedByRequestCap` tells you when more results were available than your `maxRequests` allowed.

**Is this official?** No. It is an independent tool using the public SAM.gov API.

# Actor input Schema

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

Required. Your own free public API key from SAM.gov > Account Details. Keys expire every 90 days. Stored encrypted; never logged or output.

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

YYYY-MM-DD. Default: 7 days before 'Posted to'. Range max 1 year.

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

YYYY-MM-DD. Default: today.

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

Empty = all types.

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

e.g. 541511 (up to 6 digits).

## `pscCode` (type: `string`):

Product Service Code, e.g. D302 or R.

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

Set-aside type code.

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

Two-letter US state code, e.g. VA.

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

Searches notice titles (SAM.gov 'title' parameter).

## `includePointOfContact` (type: `boolean`):

Off by default. When on, the contracting officer contacts published in the notice are included.

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

Maximum opportunities to return.

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

Each request returns up to 1000 notices. Non-federal keys allow about 10 requests per day.

## Actor input object example

```json
{
  "includePointOfContact": false,
  "maxItems": 100,
  "maxRequests": 2
}
```

# Actor output Schema

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

No description

## `stats` (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 = {
    "maxItems": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("ayuki/samgov-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 = { "maxItems": 100 }

# Run the Actor and wait for it to finish
run = client.actor("ayuki/samgov-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 '{
  "maxItems": 100
}' |
apify call ayuki/samgov-contract-opportunities --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ayuki/samgov-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/8BFoDMTuXNGzfidAN/builds/D0BZZNBGhcE2VgKlz/openapi.json
