{
  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}