# GovCon Intelligence Engine — SAM.gov Opportunity Scraper (`texmt/govcon-intelligence-engine`) Actor

Pulls federal contracting opportunities from the SAM.gov API. Scores each record 0–100 across six dimensions, classifies by category and urgency, detects changes run-over-run, and surfaces actionable alerts. Pay-per-event.

- **URL**: https://apify.com/texmt/govcon-intelligence-engine.md
- **Developed by:** [Kevin](https://apify.com/texmt) (community)
- **Categories:** Developer tools, Integrations, Other
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 opportunity analyzeds

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

## GovCon Intelligence Engine — SAM.gov Opportunity Scraper

Pulls federal contracting opportunities from the [SAM.gov Opportunities API](https://open.gsa.gov/api/get-opportunities-public-api/), scores each record 0–100, classifies it by category and urgency, detects changes run-over-run, and surfaces actionable alerts. Designed for government contractors who need a reliable, structured feed of federal opportunities — not raw SAM.gov data dumps.

**Pricing:** Pay-per-event. See the Apify Store page for current pricing.

---

### Who This Is For

- Small businesses and government contractors monitoring SAM.gov daily
- Capture teams tracking specific agencies, NAICS codes, or set-aside types
- BD automation pipelines that need structured, scored opportunity data
- Anyone who wants to stop manually searching SAM.gov

---

### Quick Start

1. Get a free SAM.gov API key at **https://sam.gov/profile/details**
2. Run the actor with at minimum `{ "samApiKey": "YOUR_KEY" }`
3. Results appear in the default Apify dataset

---

### Key Features

- Queries the official SAM.gov REST API — no browser scraping, no fragile HTML parsing
- Scores every opportunity 0–100 across multiple dimensions with a transparent `scoreBreakdown`
- Classifies records by category: `bid_opportunity`, `pre_solicitation`, `award_notice`, `market_research`, `special_notice`, `justification`
- Normalizes set-aside codes, agency names, and place of performance across all records
- Detects changes run-over-run: new, modified, unchanged, and relisted records
- Emits per-record action fields: `recommendedAction`, `alertPriority`, `alertReason`
- Flags data-quality anomalies via `dataQualityFlags` for diagnostic visibility
- Supports watchlist scoring: configure preferred keywords, NAICS codes, agencies, states, and set-asides for personalized scoring boosts
- Optional webhook (n8n, Zapier, Make) and Slack Block Kit integration

---

### Scoring Methodology (0–100)

Each opportunity is scored using a multi-component model. The full breakdown is available in `scoreBreakdown` on every record.

| Component | Range | What it measures |
|---|---|---|
| `noticeTypeScore` | 0–25 | Record category (solicitation, pre-sol, sources sought, etc.) |
| `setAsideScore` | 0–20 | Set-aside type vs. your preferred set-asides |
| `deadlineScore` | −20 to +18 | Urgency: days until response deadline |
| `valueScore` | 0–15 | Contract value tier |
| `dataQualityScore` | 0–10 | Completeness of key fields |
| `watchlistScore` | 0–10 | Matches to your preferred keywords, NAICS, agencies, and states |
| `penaltyScore` | subtracted | Applied for non-actionable categories, expired records, missing required fields |

Scores are clamped to 0–100. `scoreConfidence` (0–100) reflects how complete the underlying data is. `scoreVersion` identifies the scoring formula version; `buildVersion` identifies the actor release.

---

### Classification and Action Fields

Every record includes:

| Field | Values | Meaning |
|---|---|---|
| `recordCategory` | `bid_opportunity` `pre_solicitation` `award_notice` `market_research` `special_notice` `justification` `other` | Notice type classification |
| `deadlineUrgency` | `today` `soon` `upcoming` `distant` `expired` `none` | Deadline proximity label (`soon` = within 7 days) |
| `lifecycleStage` | `open` `closing_soon` `awarded` `archived` `unknown` | Opportunity lifecycle state |
| `recommendedAction` | `bid_now` `review_soon` `watch` `research_only` `ignore` | Score- and category-driven action recommendation |
| `alertPriority` | `high` `medium` `low` `none` | Alert urgency level |
| `alertReason` | string or null | Human-readable explanation of why this record warrants attention |

`award_notice` and `justification` records always receive `alertPriority: none` and `alertReason: null`. Expired records always receive `alertPriority: none`.

---

### Change Detection

When `trackChanges: true` (default), the actor stores a normalized snapshot of each opportunity in Apify KV store between runs and detects real field changes on subsequent runs.

Each record receives one of four `changeType` values:

| Value | Meaning |
|---|---|
| `new` | First time this `noticeId` has been seen |
| `modified` | One or more tracked fields changed since the last run |
| `unchanged` | No detectable change since the last run |
| `relisted` | Record reappeared after being absent in a prior run |

The `changedFields` array lists exactly which normalized fields changed. Change detection uses normalized values only — raw formatting differences (e.g. set-aside code variants that normalize to the same value) never produce false `modified` results. `firstSeenAt` and `lastSeenAt` are preserved across runs.

---

### Flagged Reasons

`flaggedReasonsV2` is an array of diagnostic strings on each record. Flags are category-aware — non-actionable notice types (award notices, justifications) do not receive flags that are meaningless for them.

Common flags:

| Flag | Meaning |
|---|---|
| `new_record` | First time this notice has been seen |
| `modified_record` | Fields changed since last run |
| `bid_relevant` | Category is actively biddable |
| `deadline_today` | Response deadline is today |
| `deadline_soon` | Deadline within 7 days |
| `expired` | Deadline has passed |
| `set_aside_match` | Positive set-aside designation present |
| `watchlist_match` | Matched a preferred keyword, NAICS, agency, or state |
| `high_value` | Estimated value at or above $1M |
| `missing_naics` | NAICS code absent |
| `missing_value` | No estimated contract value |
| `missing_deadline` | No response deadline provided |
| `award_notice` | Record is an award notice |
| `likely_removed` | Record was absent in recent runs |

---

### Data Quality Flags

`dataQualityFlags` is a separate diagnostic array that flags raw data anomalies from SAM.gov. These are informational only and do not affect scoring or alerts.

| Flag | Meaning |
|---|---|
| `empty_set_aside_string` | Set-aside field was an empty string in the source |
| `empty_response_deadline_string` | Deadline field was an empty string in the source |
| `deadline_before_posted_date` | Response deadline is earlier than the posted date |
| `missing_naics` | NAICS code absent |
| `foreign_state_code_format` | Non-US place of performance with ISO 3166-2 region code in the state field |

---

### Output Modes

| Mode | What is included |
|---|---|
| `full` | All records with all fields (default) |
| `bid_feed` | Solicitations, pre-solicitations, and sources sought only |
| `awards_feed` | Award notices and justifications only |
| `alerts` | New or modified records, records with urgent deadlines, and records with `bid_now` or `review_soon` action — award notices and justifications excluded |
| `etl_flat` | All records with nested objects flattened to underscore-delimited keys for data pipeline compatibility |

Each run also appends a summary record with `runType: "summary"` containing aggregate stats: total records, new/modified counts, top agencies, top NAICS codes, bid-relevant count, and top 5 opportunities by score.

---

### Input Parameters

#### Core Filters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `samApiKey` | string | required | SAM.gov public API key |
| `keywords` | string[] | `[]` | Keywords to filter opportunities (matched against title in SAM.gov query) |
| `naicsCode` | string | — | Single NAICS code filter |
| `agency` | string | — | Agency name partial match |
| `noticeType` | string[] | `[]` | Notice type codes: `o` Solicitation, `p` Presolicitation, `k` Combined, `r` Sources Sought, `s` Special Notice, `a` Award, `u` Justification, `g` Surplus Sale, `i` Bundle Intent |
| `setAside` | string[] | `[]` | Set-aside codes to filter on: `SBA`, `8A`, `8AN`, `HZC`, `HZS`, `SDVOSBC`, `SDVOSBS`, `WOSB`, `WOSBSS`, `EDWOSB`, `EDWOSBSS`, `VSB`, `VOSB` |
| `activeOnly` | boolean | `true` | Only return currently active opportunities |
| `postedFrom` / `postedTo` | string | — | Posted date range (ISO 8601 or MM/DD/YYYY) |
| `deadlineFrom` / `deadlineTo` | string | — | Response deadline date range |
| `minContractValue` / `maxContractValue` | integer | — | Contract value filter in USD |
| `maxResults` | integer | `100` | Maximum opportunities to fetch and process (1–10,000) |

#### Behavior

| Parameter | Type | Default | Description |
|---|---|---|---|
| `trackChanges` | boolean | `true` | Enable KV-store change detection across runs |
| `outputMode` | string | `full` | `full` · `bid_feed` · `awards_feed` · `alerts` · `etl_flat` |
| `minScore` | integer | `0` | Exclude records below this opportunity score |
| `onlyFlagged` | boolean | `false` | Only output records with at least one flag |

#### Watchlist / Scoring Preferences

These fields boost scoring and populate `watchlistMatch` and `watchlistMatches` on matched records.

| Parameter | Type | Default | Description |
|---|---|---|---|
| `preferredKeywords` | string[] | `[]` | Keywords matched against record titles for scoring bonus |
| `preferredNaicsCodes` | string[] | `[]` | NAICS codes that receive a scoring bonus when matched |
| `preferredAgencies` | string[] | `[]` | Agency names (partial match) that receive a scoring bonus |
| `preferredStates` | string[] | `[]` | State codes (e.g. `VA`, `TX`) matched against place of performance |
| `preferredSetAsides` | string[] | `[]` | Set-aside types (`SBA`, `SDVOSB`, `WOSB`, `HUBZONE`, `8A`, `VOSB`, `OTHER`) that receive maximum set-aside score |

#### Integrations

| Parameter | Type | Description |
|---|---|---|
| `webhookUrl` | string | POST all output records as JSON to this URL at end of run (n8n, Zapier, Make, or custom endpoint) |
| `slackWebhookUrl` | string | Send a Slack Block Kit summary with run stats and top 5 opportunities by score |

---

### Output Fields (per record)

#### Core Notice Fields
`noticeId` · `title` · `solicitationNumber` · `agency` · `agencyCode` · `noticeType` · `noticeTypeCode` · `naicsCode` · `naicsCodes` · `classificationCode` · `setAside` · `setAsideLabel` · `postedDate` · `responseDeadLine` · `archiveDate` · `active` · `estimatedValue` · `awardDate` · `awardNumber` · `awardee` · `placeOfPerformance` · `pointOfContact` · `descriptionUrl` · `opportunityUrl` · `scrapedAt`

#### Normalized Fields
`normalizedSetAside` · `normalizedAgency` · `normalizedPlaceOfPerformance` (object: `city`, `state`, `country`, `raw`)

#### Classification and Deadline
`recordCategory` · `bidRelevance` · `daysUntilDeadline` · `deadlineUrgency` · `isExpired` · `isAward` · `isActiveOpportunity` · `lifecycleStage` · `dataCompletenessScore`

#### Scoring
`opportunityScoreV2` · `opportunityScore` (alias) · `scoreBreakdown` · `scoreConfidence` · `scoreVersion` · `buildVersion`

#### Change Detection
`changeType` · `changedFields` · `firstSeenAt` · `lastSeenAt` · `isNewRecord` · `isModifiedRecord` · `isLikelyRemoved` · `previousNoticeType` · `previousResponseDeadline` · `previousEstimatedValue`

#### Watchlist
`watchlistMatch` · `watchlistMatches`

#### Flags and Reasons
`flaggedReasonsV2` · `flaggedReasons` (alias) · `dataQualityFlags` · `matchReasons` · `disqualifyingReasons`

#### Action and Alerts
`recommendedAction` · `alertPriority` · `alertReason`

---

### Example Inputs

#### SDVOSB IT opportunities at DoD
```json
{
  "samApiKey": "YOUR_KEY",
  "keywords": ["cybersecurity", "zero trust", "SIEM"],
  "naicsCode": "541512",
  "agency": "DEPARTMENT OF DEFENSE",
  "setAside": ["SDVOSBC"],
  "activeOnly": true,
  "maxResults": 200,
  "minScore": 40,
  "outputMode": "alerts",
  "preferredKeywords": ["cybersecurity", "zero trust"],
  "preferredSetAsides": ["SDVOSB"]
}
````

#### Daily new-opportunity monitor for a specific NAICS

```json
{
  "samApiKey": "YOUR_KEY",
  "noticeType": ["o", "k", "r"],
  "activeOnly": true,
  "trackChanges": true,
  "outputMode": "alerts",
  "preferredNaicsCodes": ["541511", "541512"],
  "preferredAgencies": ["GSA", "Department of Veterans Affairs"],
  "preferredStates": ["VA", "MD", "DC"],
  "webhookUrl": "https://your-n8n.cloud/webhook/govcon"
}
```

#### Awards intelligence feed

```json
{
  "samApiKey": "YOUR_KEY",
  "noticeType": ["a"],
  "activeOnly": false,
  "outputMode": "awards_feed",
  "maxResults": 500,
  "trackChanges": false
}
```

***

### Limitations and Notes

- **SAM.gov API rate limits apply.** The free public API key is subject to daily and per-minute quotas. The actor handles 429 rate limit responses with exponential backoff but cannot exceed what SAM.gov permits.
- **Date range required.** The SAM.gov API requires a posting date range. If none is provided, the actor defaults to the last 30 days.
- **Estimated value availability.** Estimated contract value is not present on all opportunity types. It is most reliably populated on award notices.
- **Change detection requires consistent runs.** The KV store used for change detection is scoped to the Apify actor run environment. If you clear storage or run in a new environment, all records will appear as `new` on the first run.
- **This actor queries the SAM.gov Opportunities API.** It does not scrape the SAM.gov website and does not access documents, attachments, or full opportunity descriptions.

# Actor input Schema

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

Your SAM.gov public API key. Get a free key at https://sam.gov/profile/details

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

Search terms to filter opportunities (e.g. \['cybersecurity', 'cloud migration']). Used for both the API query and keyword-relevance scoring.

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

Filter by a single NAICS code (e.g. '541511' for Custom Computer Programming Services).

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

Filter by agency name (partial match). E.g. 'DEPARTMENT OF DEFENSE' or 'GSA'.

## `noticeType` (type: `array`):

Filter by notice type codes. Leave empty for all types.

## `setAside` (type: `array`):

Filter by set-aside codes. Opportunities matching these codes receive a score bonus.

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

When true, only returns currently active/open opportunities.

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

Only include opportunities posted on or after this date. Accepts ISO 8601 (2024-01-01) or MM/DD/YYYY.

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

Only include opportunities posted on or before this date.

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

Filter by response deadline start date.

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

Filter by response deadline end date.

## `minContractValue` (type: `integer`):

Minimum estimated contract value in USD. Used in value-fit scoring.

## `maxContractValue` (type: `integer`):

Maximum estimated contract value in USD. Used in value-fit scoring.

## `maxResults` (type: `integer`):

Maximum number of opportunities to fetch and process.

## `trackChanges` (type: `boolean`):

Enable KV-store change detection. Each run detects new, modified, and unchanged opportunities.

## `outputMode` (type: `string`):

Controls which records are included in the output dataset.

## `minScore` (type: `integer`):

Only output opportunities with an opportunity score at or above this threshold.

## `onlyFlagged` (type: `boolean`):

When true, only output opportunities that have at least one flaggedReason.

## `webhookUrl` (type: `string`):

POST all results as JSON to this URL at the end of each run.

## `slackWebhookUrl` (type: `string`):

Send a Block Kit deal summary to this Slack webhook URL.

## `preferredKeywords` (type: `array`):

Your watchlist keywords — scored and flagged when matched in title. E.g. \['cybersecurity', 'AI/ML', 'cloud'].

## `preferredNaicsCodes` (type: `array`):

Preferred NAICS codes for watchlist scoring and bonus points. E.g. \['541511', '541512'].

## `preferredAgencies` (type: `array`):

Preferred agencies for watchlist matching (partial match on agency path). E.g. \['GSA', 'Department of Veterans Affairs'].

## `preferredStates` (type: `array`):

Preferred states for place-of-performance matching (2-letter codes). E.g. \['TX', 'VA', 'MD'].

## `preferredSetAsides` (type: `array`):

Preferred set-aside types for watchlist and scoring bonus. Exact match gives maximum set-aside score.

## Actor input object example

```json
{
  "keywords": [],
  "noticeType": [],
  "setAside": [],
  "activeOnly": true,
  "maxResults": 100,
  "trackChanges": true,
  "outputMode": "full",
  "minScore": 0,
  "onlyFlagged": false,
  "preferredKeywords": [],
  "preferredNaicsCodes": [],
  "preferredAgencies": [],
  "preferredStates": [],
  "preferredSetAsides": []
}
```

# 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("texmt/govcon-intelligence-engine").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("texmt/govcon-intelligence-engine").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 texmt/govcon-intelligence-engine --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=texmt/govcon-intelligence-engine",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "GovCon Intelligence Engine — SAM.gov Opportunity Scraper",
        "description": "Pulls federal contracting opportunities from the SAM.gov API. Scores each record 0–100 across six dimensions, classifies by category and urgency, detects changes run-over-run, and surfaces actionable alerts. Pay-per-event.",
        "version": "0.1",
        "x-build-id": "TzMJgYaYQN5he4SoH"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/texmt~govcon-intelligence-engine/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-texmt-govcon-intelligence-engine",
                "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/texmt~govcon-intelligence-engine/runs": {
            "post": {
                "operationId": "runs-sync-texmt-govcon-intelligence-engine",
                "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/texmt~govcon-intelligence-engine/run-sync": {
            "post": {
                "operationId": "run-sync-texmt-govcon-intelligence-engine",
                "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": [
                    "samApiKey"
                ],
                "properties": {
                    "samApiKey": {
                        "title": "SAM.gov API Key",
                        "type": "string",
                        "description": "Your SAM.gov public API key. Get a free key at https://sam.gov/profile/details"
                    },
                    "keywords": {
                        "title": "Keywords",
                        "type": "array",
                        "description": "Search terms to filter opportunities (e.g. ['cybersecurity', 'cloud migration']). Used for both the API query and keyword-relevance scoring.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "naicsCode": {
                        "title": "NAICS Code",
                        "type": "string",
                        "description": "Filter by a single NAICS code (e.g. '541511' for Custom Computer Programming Services)."
                    },
                    "agency": {
                        "title": "Agency / Department",
                        "type": "string",
                        "description": "Filter by agency name (partial match). E.g. 'DEPARTMENT OF DEFENSE' or 'GSA'."
                    },
                    "noticeType": {
                        "title": "Notice Type(s)",
                        "type": "array",
                        "description": "Filter by notice type codes. Leave empty for all types.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "o",
                                "p",
                                "k",
                                "r",
                                "s",
                                "g",
                                "i",
                                "a",
                                "u"
                            ],
                            "enumTitles": [
                                "Solicitation (o)",
                                "Presolicitation (p)",
                                "Combined Synopsis/Solicitation (k)",
                                "Sources Sought (r)",
                                "Special Notice (s)",
                                "Sale of Surplus Property (g)",
                                "Intent to Bundle Requirements (i)",
                                "Award Notice (a)",
                                "Justification (u)"
                            ]
                        },
                        "default": []
                    },
                    "setAside": {
                        "title": "Set-Aside Type(s)",
                        "type": "array",
                        "description": "Filter by set-aside codes. Opportunities matching these codes receive a score bonus.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "SBA",
                                "8A",
                                "8AN",
                                "HZC",
                                "HZS",
                                "SDVOSBC",
                                "SDVOSBS",
                                "WOSB",
                                "WOSBSS",
                                "EDWOSB",
                                "EDWOSBSS",
                                "VSB",
                                "VOSB"
                            ],
                            "enumTitles": [
                                "Total Small Business (SBA)",
                                "8(a) Set-Aside (8A)",
                                "8(a) Sole Source (8AN)",
                                "HUBZone Set-Aside (HZC)",
                                "HUBZone Sole Source (HZS)",
                                "SDVOSB Set-Aside (SDVOSBC)",
                                "SDVOSB Sole Source (SDVOSBS)",
                                "WOSB Set-Aside (WOSB)",
                                "WOSB Sole Source (WOSBSS)",
                                "EDWOSB Set-Aside (EDWOSB)",
                                "EDWOSB Sole Source (EDWOSBSS)",
                                "Veteran-Owned Small Business (VSB)",
                                "Veteran-Owned Small Business (VOSB)"
                            ]
                        },
                        "default": []
                    },
                    "activeOnly": {
                        "title": "Active Opportunities Only",
                        "type": "boolean",
                        "description": "When true, only returns currently active/open opportunities.",
                        "default": true
                    },
                    "postedFrom": {
                        "title": "Posted From (date)",
                        "type": "string",
                        "description": "Only include opportunities posted on or after this date. Accepts ISO 8601 (2024-01-01) or MM/DD/YYYY."
                    },
                    "postedTo": {
                        "title": "Posted To (date)",
                        "type": "string",
                        "description": "Only include opportunities posted on or before this date."
                    },
                    "deadlineFrom": {
                        "title": "Response Deadline From (date)",
                        "type": "string",
                        "description": "Filter by response deadline start date."
                    },
                    "deadlineTo": {
                        "title": "Response Deadline To (date)",
                        "type": "string",
                        "description": "Filter by response deadline end date."
                    },
                    "minContractValue": {
                        "title": "Min Contract Value ($)",
                        "type": "integer",
                        "description": "Minimum estimated contract value in USD. Used in value-fit scoring."
                    },
                    "maxContractValue": {
                        "title": "Max Contract Value ($)",
                        "type": "integer",
                        "description": "Maximum estimated contract value in USD. Used in value-fit scoring."
                    },
                    "maxResults": {
                        "title": "Max Results",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Maximum number of opportunities to fetch and process.",
                        "default": 100
                    },
                    "trackChanges": {
                        "title": "Track Changes (KV-based)",
                        "type": "boolean",
                        "description": "Enable KV-store change detection. Each run detects new, modified, and unchanged opportunities.",
                        "default": true
                    },
                    "outputMode": {
                        "title": "Output Mode",
                        "enum": [
                            "full",
                            "bid_feed",
                            "awards_feed",
                            "alerts",
                            "etl_flat"
                        ],
                        "type": "string",
                        "description": "Controls which records are included in the output dataset.",
                        "default": "full"
                    },
                    "minScore": {
                        "title": "Minimum Opportunity Score (0–100)",
                        "minimum": 0,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Only output opportunities with an opportunity score at or above this threshold.",
                        "default": 0
                    },
                    "onlyFlagged": {
                        "title": "Only Flagged Opportunities",
                        "type": "boolean",
                        "description": "When true, only output opportunities that have at least one flaggedReason.",
                        "default": false
                    },
                    "webhookUrl": {
                        "title": "Webhook URL (n8n / Zapier / Make)",
                        "type": "string",
                        "description": "POST all results as JSON to this URL at the end of each run."
                    },
                    "slackWebhookUrl": {
                        "title": "Slack Incoming Webhook URL",
                        "type": "string",
                        "description": "Send a Block Kit deal summary to this Slack webhook URL."
                    },
                    "preferredKeywords": {
                        "title": "Watchlist Keywords",
                        "type": "array",
                        "description": "Your watchlist keywords — scored and flagged when matched in title. E.g. ['cybersecurity', 'AI/ML', 'cloud'].",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "preferredNaicsCodes": {
                        "title": "Preferred NAICS Codes",
                        "type": "array",
                        "description": "Preferred NAICS codes for watchlist scoring and bonus points. E.g. ['541511', '541512'].",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "preferredAgencies": {
                        "title": "Preferred Agencies",
                        "type": "array",
                        "description": "Preferred agencies for watchlist matching (partial match on agency path). E.g. ['GSA', 'Department of Veterans Affairs'].",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "preferredStates": {
                        "title": "Preferred States",
                        "type": "array",
                        "description": "Preferred states for place-of-performance matching (2-letter codes). E.g. ['TX', 'VA', 'MD'].",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "preferredSetAsides": {
                        "title": "Preferred Set-Aside Types",
                        "type": "array",
                        "description": "Preferred set-aside types for watchlist and scoring bonus. Exact match gives maximum set-aside score.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "SBA",
                                "8A",
                                "HUBZONE",
                                "SDVOSB",
                                "WOSB",
                                "VOSB",
                                "OTHER"
                            ],
                            "enumTitles": [
                                "Total Small Business (SBA)",
                                "8(a) (8A)",
                                "HUBZone (HUBZONE)",
                                "SDVOSB (SDVOSB)",
                                "WOSB (WOSB)",
                                "Veteran-Owned Small Business (VOSB)",
                                "Other Set-Aside (OTHER)"
                            ]
                        },
                        "default": []
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
