# SAM.gov Government Contracts — Federal Contract Opportunities (`clawdeus/sam-gov-contracts`) Actor

Search federal government contracts and opportunities from SAM.gov. Perfect for government contracting research, business development, and competitive intelligence.

- **URL**: https://apify.com/clawdeus/sam-gov-contracts.md
- **Developed by:** [Odysseus Clawdeus](https://apify.com/clawdeus) (community)
- **Categories:** Lead generation, Developer tools
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / 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?

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 Government Contracts

Search federal government contract opportunities directly from [SAM.gov](https://sam.gov) — the official U.S. government system for contract opportunities, federal awards, and entity registrations.

### What It Does

This actor searches the SAM.gov Opportunities API and returns structured data for government contract opportunities including solicitations, awards, sources sought, pre-solicitations, and more.

**Perfect for:**

- 🏗️ Government contractors looking for new opportunities
- 📊 Market researchers tracking federal spending
- 🔍 Business development teams monitoring agency activity
- 📈 Data analysts studying procurement trends
- 🤖 Automated bid monitoring pipelines

### Features

- **Search by keyword** — Find opportunities by title (e.g., "construction", "cybersecurity")
- **Filter by NAICS code** — Target your industry sector
- **Filter by state** — Find local opportunities
- **Filter by set-aside** — Small business, 8(a), HUBZone, SDVOSB, WOSB, and more
- **Filter by procurement type** — Solicitations, awards, sources sought, etc.
- **Filter by agency** — Target specific departments
- **Date range filtering** — Posted date and response deadline ranges
- **Up to 1,000 results** per run with automatic pagination

### API Key (Required — Free)

This actor requires a SAM.gov API key. Getting one is **free**:

1. Create an account at [sam.gov](https://sam.gov)
2. Go to **Account Details**
3. Click **Public API Key** to generate your key
4. Paste it into the `apiKey` input field

### Input Example

```json
{
  "apiKey": "YOUR_SAM_GOV_API_KEY",
  "keyword": "construction",
  "naicsCode": "236220",
  "state": "CO",
  "setAside": "SBA",
  "postedFrom": "2026-01-01",
  "limit": 25
}
```

### Output Example

```json
{
  "title": "Renovation of Federal Building",
  "solicitationNumber": "47PF0026R0045",
  "noticeId": "abc123def456",
  "type": "Solicitation",
  "baseType": "Combined Synopsis/Solicitation",
  "organization": "GENERAL SERVICES ADMINISTRATION.PUBLIC BUILDINGS SERVICE.PBS R8",
  "postedDate": "2026-03-15",
  "responseDeadline": "2026-04-15 05:00:00 PM EDT",
  "naicsCode": "236220",
  "classificationCode": "Z",
  "setAside": "Total Small Business Set-Aside (FAR 19.5)",
  "setAsideCode": "SBA",
  "active": "Yes",
  "placeOfPerformance": {
    "city": "Denver",
    "state": "CO",
    "zip": "80202",
    "country": "USA"
  },
  "award": null,
  "contacts": [
    {
      "name": "Jane Smith",
      "title": "Contracting Officer",
      "email": "jane.smith@gsa.gov",
      "phone": "3035551234",
      "type": "primary"
    }
  ],
  "descriptionUrl": "https://api.sam.gov/prod/opportunities/v1/noticedesc?noticeid=abc123def456",
  "samUrl": "https://sam.gov/opp/abc123def456/view",
  "additionalInfoLink": null,
  "resourceLinks": []
}
```

### Set-Aside Types

| Code | Description |
|------|-------------|
| SBA | Total Small Business Set-Aside |
| SBP | Partial Small Business Set-Aside |
| 8A | 8(a) Set-Aside |
| 8AN | 8(a) Sole Source |
| HZC | HUBZone Set-Aside |
| HZS | HUBZone Sole Source |
| SDVOSBC | Service-Disabled Veteran-Owned SB Set-Aside |
| SDVOSBS | Service-Disabled Veteran-Owned SB Sole Source |
| WOSB | Women-Owned Small Business Set-Aside |
| WOSBSS | Women-Owned Small Business Sole Source |
| EDWOSB | Economically Disadvantaged WOSB Set-Aside |
| VSA | Veteran-Owned Small Business Set-Aside |

### Procurement Types

| Code | Description |
|------|-------------|
| o | Solicitation |
| k | Combined Synopsis/Solicitation |
| p | Pre-solicitation |
| r | Sources Sought |
| s | Special Notice |
| a | Award Notice |
| u | Justification (J\&A) |
| g | Sale of Surplus Property |

### Rate Limits

SAM.gov API has daily rate limits based on your account type. The actor respects these limits. If you hit the limit, wait 24 hours or contact SAM.gov support.

### Data Source

All data comes directly from the official [SAM.gov Opportunities API](https://open.gsa.gov/api/get-opportunities-public-api/). This is public U.S. government data.

### Tips

- **Date range is required** — The API requires `postedFrom` and `postedTo`. If not provided, the actor defaults to the last 30 days.
- **Max date range is 1 year** — SAM.gov limits date ranges to 1 year.
- **Combine filters** for targeted results — e.g., NAICS code + state + set-aside.
- **Check `descriptionUrl`** — Append your API key to download the full description.

# Actor input Schema

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

Your SAM.gov public API key. Get one free at sam.gov → Account Details → Public API Key.

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

Search keyword to find in opportunity titles (e.g., 'construction', 'IT services', 'cybersecurity').

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

Search by specific solicitation number (e.g., 'W912DY-26-R-0001').

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

Filter by NAICS code (up to 6 digits). Examples: 236220 (Commercial Construction), 541512 (Computer Systems Design), 561720 (Janitorial Services).

## `classificationCode` (type: `string`):

Filter by product/service classification code (e.g., 'Z' for maintenance/repair of real property).

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

Filter by place of performance state (2-letter code, e.g., 'CO', 'CA', 'TX').

## `zip` (type: `string`):

Filter by place of performance ZIP code.

## `organizationName` (type: `string`):

Filter by department or agency name (e.g., 'Department of Defense', 'General Services Administration').

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

Start date for posted opportunities (YYYY-MM-DD format). Defaults to 30 days ago. Max range: 1 year.

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

End date for posted opportunities (YYYY-MM-DD format). Defaults to today. Max range: 1 year.

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

Filter opportunities with response deadline on or after this date (YYYY-MM-DD).

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

Filter opportunities with response deadline on or before this date (YYYY-MM-DD).

## `procurementType` (type: `string`):

Filter by type of procurement notice.

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

Filter by small business set-aside type.

## `limit` (type: `integer`):

Maximum number of opportunities to return (1-1000). Use with caution — large values may be slow.

## Actor input object example

```json
{
  "procurementType": "",
  "setAside": "",
  "limit": 25
}
```

# 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("clawdeus/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("clawdeus/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 clawdeus/sam-gov-contracts --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,clawdeus/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/2E9qt33FcoBLcoe1h/builds/MFOxpNqkvutDGZH20/openapi.json
