# 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=clawdeus/sam-gov-contracts",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "SAM.gov Government Contracts — Federal Contract Opportunities",
        "description": "Search federal government contracts and opportunities from SAM.gov. Perfect for government contracting research, business development, and competitive intelligence.",
        "version": "1.0",
        "x-build-id": "MFOxpNqkvutDGZH20"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/clawdeus~sam-gov-contracts/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-clawdeus-sam-gov-contracts",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/clawdeus~sam-gov-contracts/runs": {
            "post": {
                "operationId": "runs-sync-clawdeus-sam-gov-contracts",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/clawdeus~sam-gov-contracts/run-sync": {
            "post": {
                "operationId": "run-sync-clawdeus-sam-gov-contracts",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "apiKey"
                ],
                "properties": {
                    "apiKey": {
                        "title": "SAM.gov API Key",
                        "type": "string",
                        "description": "Your SAM.gov public API key. Get one free at sam.gov → Account Details → Public API Key."
                    },
                    "keyword": {
                        "title": "Keyword",
                        "type": "string",
                        "description": "Search keyword to find in opportunity titles (e.g., 'construction', 'IT services', 'cybersecurity')."
                    },
                    "solicitationNumber": {
                        "title": "Solicitation Number",
                        "type": "string",
                        "description": "Search by specific solicitation number (e.g., 'W912DY-26-R-0001')."
                    },
                    "naicsCode": {
                        "title": "NAICS Code",
                        "type": "string",
                        "description": "Filter by NAICS code (up to 6 digits). Examples: 236220 (Commercial Construction), 541512 (Computer Systems Design), 561720 (Janitorial Services)."
                    },
                    "classificationCode": {
                        "title": "Classification Code",
                        "type": "string",
                        "description": "Filter by product/service classification code (e.g., 'Z' for maintenance/repair of real property)."
                    },
                    "state": {
                        "title": "State",
                        "type": "string",
                        "description": "Filter by place of performance state (2-letter code, e.g., 'CO', 'CA', 'TX')."
                    },
                    "zip": {
                        "title": "ZIP Code",
                        "type": "string",
                        "description": "Filter by place of performance ZIP code."
                    },
                    "organizationName": {
                        "title": "Organization / Agency Name",
                        "type": "string",
                        "description": "Filter by department or agency name (e.g., 'Department of Defense', 'General Services Administration')."
                    },
                    "postedFrom": {
                        "title": "Posted From Date",
                        "type": "string",
                        "description": "Start date for posted opportunities (YYYY-MM-DD format). Defaults to 30 days ago. Max range: 1 year."
                    },
                    "postedTo": {
                        "title": "Posted To Date",
                        "type": "string",
                        "description": "End date for posted opportunities (YYYY-MM-DD format). Defaults to today. Max range: 1 year."
                    },
                    "responseDeadlineFrom": {
                        "title": "Response Deadline From",
                        "type": "string",
                        "description": "Filter opportunities with response deadline on or after this date (YYYY-MM-DD)."
                    },
                    "responseDeadlineTo": {
                        "title": "Response Deadline To",
                        "type": "string",
                        "description": "Filter opportunities with response deadline on or before this date (YYYY-MM-DD)."
                    },
                    "procurementType": {
                        "title": "Procurement Type",
                        "enum": [
                            "",
                            "o",
                            "k",
                            "p",
                            "r",
                            "s",
                            "a",
                            "u",
                            "g",
                            "i"
                        ],
                        "type": "string",
                        "description": "Filter by type of procurement notice.",
                        "default": ""
                    },
                    "setAside": {
                        "title": "Set-Aside Type",
                        "enum": [
                            "",
                            "SBA",
                            "SBP",
                            "8A",
                            "8AN",
                            "HZC",
                            "HZS",
                            "SDVOSBC",
                            "SDVOSBS",
                            "WOSB",
                            "WOSBSS",
                            "EDWOSB",
                            "EDWOSBSS",
                            "VSA",
                            "VSS"
                        ],
                        "type": "string",
                        "description": "Filter by small business set-aside type.",
                        "default": ""
                    },
                    "limit": {
                        "title": "Max Results",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Maximum number of opportunities to return (1-1000). Use with caution — large values may be slow.",
                        "default": 25
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
