# SAM.gov Government Contract Monitor (`datapilot/sam-gov-government-contract-monitor`) Actor

Search by keywords, agency, or NAICS code and extract award title, agency, contract value, date, contractor, contract type, set-aside, and location. Supports Apify Proxy and batch processing.

- **URL**: https://apify.com/datapilot/sam-gov-government-contract-monitor.md
- **Developed by:** [Data Pilot](https://apify.com/datapilot) (community)
- **Categories:** Lead generation, News, Other
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 scraped results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#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 Contract** Monitor is a powerful Apify Actor designed to discover, track, and collect awarded **SAM.gov Government Contract** data directly from SAM.gov's own search and opportunity APIs using fast impersonated HTTP requests. This tool provides comprehensive **SAM.gov Government Contract** intelligence including award title, awarding agency, contract value, award date, contractor name, contract type, set-aside classification, and place of performance for any keyword, agency, or NAICS code. Whether you're building a procurement dashboard, tracking competitor awards, or conducting federal spending research, the SAM.gov Government Contract Monitor delivers actionable **SAM.gov Government Contract** insights efficiently.

With browser-impersonated HTTP requests, deep opportunity-detail fetching, multi-key fallback parsing, and reliable Apify Dataset delivery, the SAM.gov Government Contract Monitor ensures comprehensive **SAM.gov Government Contract** coverage across any list of search keywords. It focuses on key **SAM.gov Government Contract** signals including contractor name, award value, and set-aside type, making it an essential tool for procurement research and federal contract intelligence.

***

### 📋 Table of Contents

- [Features](#-features)
- [Data Source](#-data-source)
- [How It Works](#-how-it-works)
- [Input](#-input)
- [Output](#-output)
- [Technical Stack](#-technical-stack)
- [Data Fields](#-data-fields-explained)
- [Use Cases](#-use-cases)
- [Quick Start](#-quick-start)
- [Configuration](#-configuration)
- [Performance](#-performance)
- [Important Notes](#-important-notes)
- [License & Legal](#-license--legal)

***

### 🔥 Features

- **Fast Impersonated HTTP Requests** – Uses `curl_cffi` with Chrome impersonation for lightweight, high-speed access to **SAM.gov Government Contract** endpoints without a full browser.
- **Keyword-Based Search** – Accepts any number of search keywords and scans awarded **SAM.gov Government Contract** notices for each.
- **Agency & NAICS Filtering** – Narrows results to a specific awarding agency or NAICS classification code.
- **Deep Opportunity Detail Fetching** – Follows each search result's notice ID to pull full **SAM.gov Government Contract** award details.
- **Multi-Key Fallback Parsing** – Recursively checks multiple possible field names for contractor, award value, date, and location data.
- **Contractor & Award Value Extraction** – Parses awardee name and dollar amount from nested award objects.
- **Set-Aside Detection** – Identifies small business or socio-economic set-aside classifications on each **SAM.gov Government Contract**.
- **Place of Performance Parsing** – Extracts city and state from either the opportunity or the awardee's registered address.
- **Practical Filtering** – Automatically skips records missing both a contractor name and an award value to keep data useful.
- **Residential Proxy Support** – Apify residential proxy for reliable **SAM.gov Government Contract** access.
- **Batch Processing** – Scan any number of keywords in a single run, up to a configurable item cap.
- **Real-Time Dataset Push** – Pushes all collected **SAM.gov Government Contract** records to Apify Dataset in a single batch.
- **Graceful Error Handling** – Skips a failing request without stopping the whole run.

***

### 📊 Data Source

#### **SAM.gov Public Search & Opportunity APIs**

- **Authority**: SAM.gov's own public search (`sam.gov/api/prod/sgs/v1/search`) and opportunity detail (`sam.gov/api/prod/opps/v3/opportunities`) APIs
- **Access Method**: Fast async HTTP requests via `curl_cffi`, impersonating a real Chrome browser
- **Coverage**: Any publicly listed **SAM.gov Government Contract** award notice matching the given search criteria
- **Data**: JSON search results cross-referenced with full opportunity detail records
- **Access**: Public API endpoints, no API key required
- **Update Frequency**: Reflects each **SAM.gov Government Contract** award's current state at time of run

***

### ⚙️ How It Works

The SAM.gov Government Contract Monitor accepts a list of search keywords along with optional agency and NAICS filters, then queries SAM.gov's search API for awarded opportunity notices sorted by most recently modified. For each result, the Actor fetches the full opportunity detail record using its notice ID and merges it with the original search result. It then parses contractor name, award value, award date, agency hierarchy, set-aside type, contract type, and place of performance using a multi-key fallback strategy that checks several possible field names per attribute. Records missing both a contractor name and an award value are discarded to keep the dataset useful. Every valid **SAM.gov Government Contract** record is collected and pushed to the Apify Dataset in a single batch at the end of the run.

**Key Processing Steps:**

1. **Input Parsing** – Accept a list of keywords, plus optional agency and NAICS code filters
2. **Proxy Setup** – Configure Apify residential proxy for the impersonated HTTP session
3. **Keyword Loop** – Iterate through each **SAM.gov Government Contract** search keyword
4. **Search Request** – Query SAM.gov's search API for awarded notices matching the keyword
5. **Detail Fetch** – Retrieve the full opportunity record for each result's notice ID
6. **Contractor & Value Parsing** – Extract awardee name and contract dollar value with multi-key fallback
7. **Agency Hierarchy Parsing** – Build the full awarding agency path from the organization hierarchy
8. **Date & Location Parsing** – Extract award date and place of performance (city/state)
9. **Set-Aside Classification** – Identify any small business or socio-economic set-aside type
10. **Practical Filtering** – Skip records missing both contractor name and award value
11. **Item Cap Enforcement** – Stop collecting once the configured maximum item count is reached
12. **Dataset Push** – Push all collected records from the run in a single batch

**Key Benefits:**

- Pull **SAM.gov Government Contract** award data for any keyword without manual searching
- Track which contractors are winning federal work in a given agency or NAICS code
- Monitor competitor or partner companies' **SAM.gov Government Contract** award activity over time
- Feed procurement dashboards, market research pipelines, or business development tools
- Automate recurring **SAM.gov Government Contract** checks as new awards are posted

***

### 📥 Input

The Actor accepts the following input parameters:

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `keywords` | array | `["Software Development"]` | List of search terms to scan for awarded **SAM.gov Government Contract** notices. |
| `agency` | string | `""` | Optional awarding agency name to filter results. |
| `naics_code` | string | `""` | Optional NAICS classification code to filter results. |
| `maxItems` | integer | `50` | Maximum number of **SAM.gov Government Contract** records to collect. |
| `useApifyProxy` | boolean | `true` | Enable Apify residential proxies. |

**Example Input:**

```json
{
  "keywords": ["Software Development", "Cybersecurity Services"],
  "agency": "",
  "naics_code": "",
  "maxItems": 50,
  "useApifyProxy": true
}
```

**Scrape a Single Keyword:**

```json
{
  "keywords": ["Cloud Computing"]
}
```

**Filter by Agency and NAICS Code:**

```json
{
  "keywords": ["IT Services"],
  "agency": "Department of Defense",
  "naics_code": "541512",
  "maxItems": 100
}
```

***

### 📤 Output

The Actor pushes **SAM.gov Government Contract** records with the following structure:

| Field | Type | Description |
|-------|------|-------------|
| `award_title` | string | Title of the awarded **SAM.gov Government Contract** notice |
| `agency` | string | Full awarding agency hierarchy for the **SAM.gov Government Contract** |
| `value_usd` | string | Award value formatted as a USD amount (e.g., "$1,250,000.00") |
| `award_date` | string | Date the **SAM.gov Government Contract** was awarded |
| `contractor_name` | string | Name of the awarded contractor/business |
| `contract_type` | string | Type of contract or award notice |
| `set_aside` | string | Small business or socio-economic set-aside classification, if any |
| `location` | string | Place of performance (city, state) for the **SAM.gov Government Contract** |

**Example SAM.gov Government Contract Record:**

```json
{
  "award_title": "Enterprise Cloud Migration Services",
  "agency": "Department of Defense / Defense Information Systems Agency",
  "value_usd": "$4,850,000.00",
  "award_date": "2026-07-15",
  "contractor_name": "Example Federal Solutions LLC",
  "contract_type": "Firm Fixed Price",
  "set_aside": "Total Small Business Set-Aside",
  "location": "Arlington, VA"
}
```

***

### 🧰 Technical Stack

- **HTTP Client:** `curl_cffi` with Chrome impersonation for fast, browser-like access to **SAM.gov Government Contract** endpoints
- **Concurrency:** `asyncio` for non-blocking, multi-keyword search and detail fetching
- **URL Encoding:** `urllib.parse` for building SAM.gov search query parameters
- **Date Handling:** `datetime` with timezone-aware UTC timestamps
- **Proxy:** Apify Proxy with `RESIDENTIAL` configuration
- **Logging:** Apify Actor logging system
- **Platform:** Apify Actor serverless environment

***

### 📊 Data Fields Explained

#### **Award Identity**

- **award\_title**: The public title of the **SAM.gov Government Contract** award notice
- **agency**: The full awarding agency path, built from the organization hierarchy

#### **Financial Details**

- **value\_usd**: The awarded contract's dollar value, formatted for readability
- **award\_date**: The date the **SAM.gov Government Contract** was officially awarded

#### **Contractor Details**

- **contractor\_name**: The legal or business name of the awarded contractor
- **contract\_type**: The contract vehicle or award type (e.g., Firm Fixed Price)
- **set\_aside**: Any small business or socio-economic set-aside classification applied

#### **Location**

- **location**: The place of performance city and state for the **SAM.gov Government Contract**

***

### 🎯 Use Cases

- **Competitor Tracking** – Monitor which companies are winning **SAM.gov Government Contract** awards in your industry
- **Business Development** – Identify agencies and NAICS codes with active award activity to target
- **Market Research** – Study federal spending trends across keywords, agencies, and set-aside types
- **Partner Vetting** – Check a potential teaming partner's **SAM.gov Government Contract** award history
- **Procurement Analytics** – Feed award data into internal dashboards and BI tools
- **Academic Research** – Study public federal contracting patterns at scale
- **Compliance Monitoring** – Track set-aside and small business award trends over time

***

### 🚀 Quick Start

#### **1. Prepare Input**

Go to Apify Console and enter:

```json
{
  "keywords": ["Software Development"]
}
```

#### **2. Run the Actor**

Click **Start**. The Actor will:

- Search SAM.gov for awarded notices matching each keyword
- Fetch full opportunity details for every matching result
- Parse contractor, value, date, agency, and location data
- Push all results to the Dataset

#### **3. Monitor Progress**

Console shows:

```
[SAM.gov Monitor] Scanning awarded contracts for: ['Software Development']
Done! Successfully saved 42 awarded contract(s) to Dataset.
```

#### **4. View & Download Results**

- **Results Tab**: All **SAM.gov Government Contract** records
- **Export**: JSON, CSV, Excel, or HTML
- **Filter**: By agency, contractor, or award value
- **API Access**: Available via the Apify API

***

### ⚙️ Configuration

Single keyword search:

```json
{
  "keywords": ["Cybersecurity Services"]
}
```

Multiple keywords with item cap:

```json
{
  "keywords": ["IT Services", "Cloud Computing", "Data Analytics"],
  "maxItems": 200
}
```

Run without proxy:

```json
{
  "keywords": ["Software Development"],
  "useApifyProxy": false
}
```

***

### 📈 Performance

#### **Processing Speed**

- One search request per keyword, plus one detail request per matching result
- 1 second delay between keyword searches to reduce blocking
- Faster than browser-based scraping since no rendering engine is required

#### **Resource Usage**

- Memory: Low, since no browser instance is launched
- Network: One search request plus one detail request per **SAM.gov Government Contract** result
- Proxy: One residential proxy tunnel shared across the HTTP session for the run

***

### ⚠️ Important Notes

#### **Legal & Compliance**

- **Fair Use**: Respects SAM.gov's public API endpoints and applies pacing delays between requests
- **Public Data Only**: Retrieves only publicly listed **SAM.gov Government Contract** award data
- **Privacy**: Collecting contract data may be subject to applicable regulations and SAM.gov's Terms of Use — use only for legitimate purposes
- **Legal**: Not legal advice — consult qualified professionals before using this data for compliance-sensitive decisions

#### **Data Quality**

- **Freshness**: Reflects each **SAM.gov Government Contract** award's state at time of run
- **Completeness**: Field availability depends on what SAM.gov has published for each notice; some records may return partial data
- **Accuracy**: Sourced directly from SAM.gov's own search and opportunity APIs
- **Verification**: Cross-check high-stakes figures against the live SAM.gov website

#### **Best Practices**

- Always configure a residential proxy for the most reliable **SAM.gov Government Contract** access
- Use agency or NAICS code filters to narrow large keyword searches
- Re-run periodically to track newly posted awards
- Expect some fields to occasionally return `"N/A"` if SAM.gov has not published that data
- Batch multiple keywords together in one run to reduce overhead

***

### 📄 License & Legal

**Terms of Use:**

- Use for legitimate research, procurement, and business development purposes
- Respect SAM.gov's Terms of Use
- Do not use for unsolicited contact, harassment, or unlawful purposes
- Use **SAM.gov Government Contract** data responsibly and in compliance with applicable laws

**Disclaimer:**
SAM.gov Government Contract Monitor is provided as-is for research and analytics purposes. Users are responsible for compliance with SAM.gov's ToS and all applicable laws. This is not legal advice.

***

### ⚖️ SAM.gov Government Contract Excellence

This Actor is optimized for **SAM.gov Government Contract** research with:

- ✅ Fast, browser-impersonated HTTP access
- ✅ Deep opportunity-detail fetching for every result
- ✅ Multi-key fallback parsing for maximum field coverage
- ✅ Practical filtering to skip incomplete records
- ✅ Real-time Dataset push
- ✅ Production-ready code

# Actor input Schema

## `keywords` (type: `array`):

List of search keywords

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

Filter by Agency

## `naics_code` (type: `string`):

Filter by NAICS Code

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

Maximum number of contracts to collect

## `useApifyProxy` (type: `boolean`):

Use Residential proxy

## Actor input object example

```json
{
  "keywords": [
    "CNC Machining"
  ],
  "agency": "",
  "naics_code": "",
  "maxItems": 50,
  "useApifyProxy": true
}
```

# 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("datapilot/sam-gov-government-contract-monitor").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("datapilot/sam-gov-government-contract-monitor").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 datapilot/sam-gov-government-contract-monitor --silent --output-dataset

```

## MCP server setup

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

```

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/PInNLgVPWDidLRMjl/builds/MvlJhiWWmZgLJULBY/openapi.json
