# SAM.gov API: Contract Opportunities, Exclusions & Awards (`pp-api/samgov-api`) Actor

SAM.gov and USAspending data as clean rows: open federal contract opportunities by NAICS, set-aside and deadline, registered entities by UEI or CAGE with expiry, exclusions and debarments, and contract awards. No SAM.gov rate limit, no scraping. Free preview with no key.

- **URL**: https://apify.com/pp-api/samgov-api.md
- **Developed by:** [PP API Inc.](https://apify.com/pp-api) (community)
- **Categories:** Business, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.10 / 1,000 results

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 API: contract opportunities, entities, exclusions and awards

This Actor gives you U.S. federal contracting data as clean rows: open SAM.gov contract opportunities you can bid on, registered entities with UEI, CAGE, NAICS and registration expiry, exclusions (debarred, suspended and restricted parties), and contract awards from USAspending. It reads from [samgovapi.io](https://samgovapi.io), a SAM.gov API, so you get structured JSON with a source link on every record instead of scraping SAM.gov or living with its 10-requests-a-day limit.

**Try it with no key.** Leave the API key empty and run: you get up to 5 real rows of the dataset you pick, with your filters applied.

#### What you get

| Dataset | What it returns |
|---|---|
| Contract opportunities | `title`, `type` (solicitation, sources sought, presolicitation, award notice), `department`, `office`, `posted_date`, `response_deadline`, `set_aside`, `naics`, `psc`, place of performance, `solicitation_number`, link to the notice. Open bids only, closing soonest or newest first. |
| Registered entities | `legal_name`, `dba_name`, `uei`, `cage`, `registration_status`, `expiration_date`, address, `primary_naics` and every listed NAICS and PSC, entity type, website. Find registrations expiring soon. |
| Exclusions | `name`, `classification`, `uei`, `cage`, `exclusion_type`, `exclusion_program`, `excluding_agency`, `active_date`, `termination_date`, address. Screen suppliers and teaming partners. |
| Contract awards | `recipient_name`, `recipient_uei`, `awarding_agency`, `piid`, `naics`, `psc`, `description`, `action_date`, `potential_end_date`, `obligated`, `potential_value`, `set_aside`. Find incumbents and likely recompetes. |

Filters: keyword or name, NAICS, PSC, set-aside, state, agency, notice type, posted and deadline dates, registration status, expiry window, fiscal year and minimum amount.

#### Why an API instead of SAM.gov

SAM.gov's own API gives users without a role 10 requests a day and caps opportunity searches at one year per query, and scraping the site breaks often. This Actor reads samgovapi.io, which loads the public SAM.gov and USAspending extracts and serves them with paging and filters. Every row keeps a link to its SAM.gov or USAspending source.

The same data is a REST API ([docs](https://samgovapi.io/docs)) and a remote MCP server for Claude, ChatGPT and Cursor at `https://samgovapi.io/api/mcp`.

#### How to use it

1. Run it with no key to see real rows.
2. Get a free API key at [samgovapi.io/sign-up](https://samgovapi.io/sign-up). The free plan includes 10,000 credits a month and needs no card.
3. Paste the key, pick a dataset, set your NAICS, set-aside or keyword and run. Schedule it daily for a bid digest and send the rows to a webhook, Google Sheets, Slack or your CRM through Apify integrations.

Each page of up to 100 rows is one request on your samgovapi.io plan. See [pricing](https://samgovapi.io/pricing).

#### Example row (illustrative values)

```json
{
  "title": "IT Help Desk Support Services",
  "type": "Solicitation",
  "department": "VETERANS AFFAIRS, DEPARTMENT OF",
  "posted_date": "2026-11-17T04:21:09.000Z",
  "response_deadline": "2026-12-01T21:00:00.000Z",
  "set_aside": "Service-Disabled Veteran-Owned Small Business (SDVOSB) Set-Aside",
  "naics": "541512",
  "psc": "D399",
  "pop_state": "VA",
  "solicitation_number": "36C10B27Q0001"
}
```

#### FAQ

**How fresh is the data?** Opportunities and awards refresh daily; entity registrations and exclusions follow the public SAM.gov extracts. Each run logs the source date.

**Can I check if a company is excluded?** Yes. Choose Exclusions and enter the exact name, UEI or CAGE code.

**Can I find recompetes?** Yes. Choose Contract awards, set your NAICS and "Expiring within" days to list contracts whose potential end date is near.

Independent data service operated by Stunning Couches LLC, not affiliated with or endorsed by GSA SAM.gov.

# Actor input Schema

## `apiKey` (type: `string`):

Your samgovapi.io key. Free plan with 10,000 credits a month, no card: https://samgovapi.io/sign-up. Leave empty for a free preview of up to 5 real rows.

## `dataset` (type: `string`):

Contract opportunities are SAM.gov notices you can bid on. Entities are SAM.gov registrations with UEI, CAGE, NAICS and expiry. Exclusions are debarred, suspended and restricted parties. Awards are federal contract awards from USAspending.

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

Opportunities: words in the title or the solicitation number. Entities: legal or DBA name, UEI or CAGE. Exclusions: name contains. Awards: recipient name contains.

## `naics` (type: `string`):

Opportunities and awards: NAICS code or prefix, for example 5415. Entities: 6-digit NAICS code the entity lists.

## `psc` (type: `string`):

Product and service code, for example D399 or R425.

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

Opportunities: set-aside code such as SBA, 8A, WOSB, EDWOSB, SDVOSBC or HZC. Entities: business type or SBA program code such as 8A or A2.

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

Two-letter state: place of performance for opportunities, physical address for entities.

## `agency` (type: `string`):

Opportunities and awards: department, sub-tier or awarding agency name, for example Veterans Affairs.

## `agencyCode` (type: `string`):

Opportunities and awards: agency code such as 097 (Defense) or 047 (GSA).

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

Opportunities: the SAM.gov notice type.

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

Opportunities: only active notices that are not award notices and whose response deadline has not passed.

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

Opportunities: posted on or after this date, YYYY-MM-DD.

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

Opportunities: posted on or before this date, YYYY-MM-DD.

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

Opportunities: response deadline on or after this date, YYYY-MM-DD.

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

Opportunities: response deadline on or before this date, YYYY-MM-DD. Use it for bids closing this week.

## `sort` (type: `string`):

Opportunities: order of the results.

## `entityStatus` (type: `string`):

Entities: SAM.gov registration status.

## `expiringWithinDays` (type: `integer`):

Entities: registrations that expire within this many days. Awards: contracts whose potential end date falls within this many days (likely recompetes).

## `uei` (type: `string`):

Exclusions: exact UEI. Awards: recipient UEI.

## `cage` (type: `string`):

Exclusions: exact CAGE code.

## `classification` (type: `string`):

Exclusions: kind of excluded party.

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

Exclusions: leave out terminated exclusions.

## `fiscalYear` (type: `integer`):

Awards: federal fiscal year of the award action.

## `minAmount` (type: `integer`):

Awards: obligated at least this many dollars.

## `actionFrom` (type: `string`):

Awards: action date on or after, YYYY-MM-DD.

## `actionTo` (type: `string`):

Awards: action date on or before, YYYY-MM-DD.

## `vehicle` (type: `string`):

Awards: contract vehicle name, for example OASIS or SEWP.

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

Stop after this many requests on your samgovapi.io plan. Each page of up to 100 rows is one request.

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

Stop after this many rows.

## Actor input object example

```json
{
  "dataset": "opportunities",
  "naics": "541512",
  "noticeType": "all",
  "openOnly": true,
  "sort": "posted",
  "entityStatus": "active",
  "classification": "any",
  "activeOnly": true,
  "maxRequests": 100,
  "maxItems": 100
}
```

# Actor output Schema

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

All rows from this run as a dataset.

# 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 = {
    "dataset": "opportunities",
    "naics": "541512",
    "noticeType": "all",
    "sort": "posted",
    "entityStatus": "active",
    "classification": "any",
    "maxItems": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("pp-api/samgov-api").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 = {
    "dataset": "opportunities",
    "naics": "541512",
    "noticeType": "all",
    "sort": "posted",
    "entityStatus": "active",
    "classification": "any",
    "maxItems": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("pp-api/samgov-api").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 '{
  "dataset": "opportunities",
  "naics": "541512",
  "noticeType": "all",
  "sort": "posted",
  "entityStatus": "active",
  "classification": "any",
  "maxItems": 100
}' |
apify call pp-api/samgov-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,pp-api/samgov-api"
        }
    }
}
```

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/liCG5oBc1cEgup5rD/builds/ELD5eg5ZNGhSAzGeW/openapi.json
