{
  "openapi": "3.0.1",
  "info": {
    "title": "SAM.gov Government Contract Opportunities Monitor",
    "description": "SAM.gov government contracts monitor: US federal contract opportunities (solicitations, RFPs, sources sought, awards) scored to your NAICS, PSC, keywords and set-asides. Amendments merged into one row per solicitation, deadline filters, daily bid alerts. No API key needed.",
    "version": "0.1",
    "x-build-id": "eyzNUOLdVG6gVd2mp"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lindenwerk~sam-gov-contract-matcher/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lindenwerk-sam-gov-contract-matcher",
        "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/lindenwerk~sam-gov-contract-matcher/runs": {
      "post": {
        "operationId": "runs-sync-lindenwerk-sam-gov-contract-matcher",
        "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/lindenwerk~sam-gov-contract-matcher/run-sync": {
      "post": {
        "operationId": "run-sync-lindenwerk-sam-gov-contract-matcher",
        "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",
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "monitor",
              "search",
              "awards"
            ],
            "type": "string",
            "description": "monitor = only solicitations not returned by a previous run with the same stateKey (new or amended); this is the default when the field is omitted, e.g. in API calls. search = every matching opportunity posted in the last postedWithinDays days (or since postedFrom). awards = Award Notices only, with awardee and amount. The form opens with search (last 7 days) so a first try shows results right away; switch to monitor before you schedule it.",
            "default": "monitor"
          },
          "profileName": {
            "title": "Profile name",
            "type": "string",
            "description": "Free label copied to every row. Also the default stateKey in monitor mode, so different profiles keep separate \"already seen\" lists. Example: \"cyber-sdvosb-va\"."
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Words matched in the title (full weight) and in the description (lower weight). Case-insensitive. Keywords with 4+ letters also match longer words starting with them (\"cyber\" matches \"cybersecurity\"); shorter ones (IT, AV) only as whole words. Wrap in double quotes to force whole-word matching (\"\\\"roof\\\"\" will not match \"roofing\").",
            "items": {
              "type": "string"
            }
          },
          "naicsCodes": {
            "title": "NAICS codes (exact or prefix)",
            "type": "array",
            "description": "NAICS codes or prefixes. A 6-digit code matches exactly (strongest score); shorter prefixes match every code that starts with them (\"5415\" = computer systems design, \"2382\" = building equipment contractors, \"5617\" = services to buildings). With no keywords, only rows that match a code are returned.",
            "items": {
              "type": "string"
            }
          },
          "pscCodes": {
            "title": "PSC / product service codes (prefix)",
            "type": "array",
            "description": "Product Service Code prefixes (SAM.gov \"ClassificationCode\"): \"D\" = IT services, \"DA01\", \"R4\" = professional support, \"Z2\" = real property repair, \"S2\" = housekeeping, \"70\" = IT equipment. Weaker evidence than NAICS.",
            "items": {
              "type": "string"
            }
          },
          "setAsides": {
            "title": "Set-asides",
            "type": "array",
            "description": "Keep only opportunities with these set-asides. Use families: \"small-business\", \"8a\", \"hubzone\", \"sdvosb\", \"wosb\" (incl. EDWOSB), \"veteran\" (VA), \"indian\", \"local\", \"none\" (= unrestricted / full and open), or exact SAM.gov codes such as \"SBA\", \"SBP\", \"8A\", \"8AN\", \"HZC\", \"SDVOSBC\", \"WOSB\", \"EDWOSB\", \"VSA\". Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "agencies": {
            "title": "Agencies",
            "type": "array",
            "description": "Keep only opportunities whose department, sub-tier or office contains one of these texts (case-insensitive), e.g. [\"Veterans Affairs\", \"Army Corps of Engineers\", \"NASA\"], or an exact CGAC / office (AAC) code such as \"036\" or \"W912DY\".",
            "items": {
              "type": "string"
            }
          },
          "states": {
            "title": "States (place of performance)",
            "type": "array",
            "description": "2-letter US state / territory codes, e.g. [\"VA\", \"MD\", \"DC\"]. Matches the place of performance; if a notice gives none, the contracting office state is used (and said so in matchReasons).",
            "items": {
              "type": "string"
            }
          },
          "noticeTypes": {
            "title": "Notice types",
            "type": "array",
            "description": "Which SAM.gov notice types to return. Default: solicitation, presolicitation, sources-sought. Awards mode always uses award.",
            "items": {
              "type": "string",
              "enum": [
                "solicitation",
                "presolicitation",
                "sources-sought",
                "special-notice",
                "award",
                "justification",
                "modification",
                "intent-to-bundle",
                "surplus-sale",
                "other"
              ],
              "enumTitles": [
                "solicitation (Solicitation, Combined Synopsis/Solicitation)",
                "presolicitation",
                "sources-sought (market research / RFI)",
                "special-notice (industry days, events)",
                "award (Award Notice)",
                "justification (J&A, sole source)",
                "modification (Modification/Amendment/Cancel)",
                "intent-to-bundle",
                "surplus-sale (Sale of Surplus Property)",
                "other"
              ]
            }
          },
          "onlyOpen": {
            "title": "Only open opportunities",
            "type": "boolean",
            "description": "Drop opportunities whose response deadline has passed. Notices without a deadline are kept.",
            "default": true
          },
          "deadlineWithinDays": {
            "title": "Responses due within (days)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only opportunities whose response deadline is at most this many days away (notices without a deadline are dropped). 0 or empty = no limit."
          },
          "minDaysUntilDeadline": {
            "title": "At least this many days to respond",
            "minimum": 0,
            "type": "integer",
            "description": "Drop opportunities due sooner than this many days (too little time to bid). 0 or empty = off."
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "type": "array",
            "description": "Opportunities whose title or description contains any of these words are dropped (never charged).",
            "items": {
              "type": "string"
            }
          },
          "minScore": {
            "title": "Minimum relevance score",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Only opportunities with relevanceScore >= minScore are returned (and charged as scored-match). Guide for a NAICS + keywords profile: exact NAICS only = 50, one title keyword only = 46, NAICS + one title keyword = 73, NAICS + two title keywords = 85+. A NAICS-only profile scores 100 for an exact code. Ignored for an unscored feed.",
            "default": 40
          },
          "competitorNames": {
            "title": "Competitor names (awards)",
            "type": "array",
            "description": "Awards mode: only return awards won by a company whose name contains one of these texts (case-insensitive), e.g. [\"Booz Allen\", \"Leidos\"].",
            "items": {
              "type": "string"
            }
          },
          "minAwardAmount": {
            "title": "Minimum award amount (USD, awards)",
            "minimum": 0,
            "type": "integer",
            "description": "Awards mode: drop awards below this amount (awards without an amount are dropped too)."
          },
          "maxAwardAmount": {
            "title": "Maximum award amount (USD, awards)",
            "minimum": 0,
            "type": "integer",
            "description": "Awards mode: drop awards above this amount."
          },
          "lookbackDays": {
            "title": "Lookback days (monitor, first run)",
            "minimum": 1,
            "maximum": 14,
            "type": "integer",
            "description": "Monitor mode: how many posting days the first run looks back. Later runs continue from the newest posting day of the previous run (with one day overlap); already delivered solicitations are skipped and not charged.",
            "default": 3
          },
          "postedWithinDays": {
            "title": "Posted within (days, search/awards)",
            "minimum": 0,
            "type": "integer",
            "description": "Search and awards mode: only notices posted in the last N days. Default 30 (the form prefills 7). 0 = all active notices in SAM.gov (reads the whole ~210 MB extract, slower). Shorter windows are faster and cheaper.",
            "default": 30
          },
          "postedFrom": {
            "title": "Posted from (date)",
            "type": "string",
            "description": "Optional first posting day (YYYY-MM-DD). Overrides postedWithinDays / lookbackDays."
          },
          "includeUpdates": {
            "title": "Include updated solicitations (monitor)",
            "type": "boolean",
            "description": "Monitor mode: also return a solicitation again when SAM.gov posts a newer version (amendment, presolicitation -> solicitation); such rows have changeType = \"updated\".",
            "default": true
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of rows to return (and charge) in this run, best matches first. 0 = no limit. Default 200; the form prefills 25 for a cheap first try, so raise it (or set 0) for full results. The run also stops when your maximum total charge for the run is reached. Monitor mode delivers the rest next run.",
            "default": 200
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "deadline",
              "postedDate"
            ],
            "type": "string",
            "description": "Order of the output rows.",
            "default": "relevance"
          },
          "includeDescription": {
            "title": "Include description",
            "type": "boolean",
            "description": "Include the notice description (personal names, e-mails and phone numbers removed).",
            "default": true
          },
          "descriptionMaxLength": {
            "title": "Description max length",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of characters of the description per row.",
            "default": 600
          },
          "stateKey": {
            "title": "State key (monitor)",
            "type": "string",
            "description": "Name of the \"already seen\" list kept in the named key-value store \"sam-gov-matcher-state\". Default: the profile name. Use a different key per profile or schedule."
          },
          "resetState": {
            "title": "Reset monitor state",
            "type": "boolean",
            "description": "Forget everything seen by earlier runs with this stateKey (use it after changing the profile).",
            "default": false
          },
          "firstRunBackfillDays": {
            "title": "First-run backfill days (monitor mode)",
            "minimum": 0,
            "maximum": 14,
            "type": "integer",
            "description": "Monitor mode: if a run without saved state (the very first run for this stateKey, or after Reset monitor state) finds nothing new in its lookbackDays window, for example because it starts on a US weekend or federal holiday, it looks back this many posting days once instead, so you see the current open opportunities. Later runs are normal monitor runs. Not used with postedFrom. 0 = off.",
            "default": 7
          },
          "samApiKey": {
            "title": "Your SAM.gov public API key (optional)",
            "type": "string",
            "description": "Optional. The public extract is updated once a day, so the newest notices can be ~1 day old. With your own SAM.gov public API key (generated in your SAM.gov account under Account Details) the Actor also fetches notices posted since the extract was built (up to 2 API requests per run; API rows have no description, so keywords match their title only). The key is stored encrypted, used only in your run and never logged or output."
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}