{
  "openapi": "3.0.1",
  "info": {
    "title": "SAM.gov Opportunities Monitor (own API key + AI summary)",
    "description": "Bring your own SAM.gov API key: federal contract opportunities from the official API. Filter by keyword, NAICS, set-aside, type, state and date; monitor mode returns only new or updated notices; optional summaries. Not affiliated with the U.S. GSA or SAM.gov.",
    "version": "0.1",
    "x-build-id": "7X1s2fEUcs4gEOWuf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jwaiworks~samgov-opportunities-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jwaiworks-samgov-opportunities-monitor",
        "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/jwaiworks~samgov-opportunities-monitor/runs": {
      "post": {
        "operationId": "runs-sync-jwaiworks-samgov-opportunities-monitor",
        "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/jwaiworks~samgov-opportunities-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-jwaiworks-samgov-opportunities-monitor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "apiKey"
        ],
        "properties": {
          "apiKey": {
            "title": "SAM.gov public API key",
            "type": "string",
            "description": "Your own key from SAM.gov > Account Details > Public API Key. It is used only for this run: sent only to api.sam.gov, and never stored, logged or shown by the Actor (Apify keeps run input encrypted as a secret field). Keys allow 10 requests/day without a SAM.gov role, 1,000/day with one, and must be renewed every 90 days."
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Keep only notices whose title, solicitation number or agency contains one of these words (case-insensitive, whole word). Applied after the search.",
            "items": {
              "type": "string"
            }
          },
          "titleSearch": {
            "title": "Title search (sent to SAM.gov)",
            "type": "string",
            "description": "SAM.gov's own title search (the API 'title' parameter)."
          },
          "naicsCodes": {
            "title": "NAICS codes",
            "type": "array",
            "description": "e.g. 541511. One search per code.",
            "items": {
              "type": "string"
            }
          },
          "setAsideCodes": {
            "title": "Set-aside codes",
            "type": "array",
            "description": "e.g. SBA (Total Small Business), 8A, HZC, SDVOSBC, WOSB. One search per code.",
            "items": {
              "type": "string",
              "enum": [
                "SBA",
                "SBP",
                "8A",
                "8AN",
                "HZC",
                "HZS",
                "SDVOSBC",
                "SDVOSBS",
                "WOSB",
                "WOSBSS",
                "EDWOSB",
                "EDWOSBSS",
                "LAS",
                "IEE",
                "ISBEE",
                "BICiv",
                "VSA",
                "VSS"
              ]
            }
          },
          "noticeTypes": {
            "title": "Notice types",
            "type": "array",
            "description": "Leave empty for all types.",
            "items": {
              "type": "string",
              "enum": [
                "o",
                "k",
                "p",
                "r",
                "s",
                "a",
                "u",
                "g",
                "i"
              ],
              "enumTitles": [
                "Solicitation",
                "Combined Synopsis/Solicitation",
                "Presolicitation",
                "Sources Sought",
                "Special Notice",
                "Award Notice",
                "Justification (J&A)",
                "Sale of Surplus Property",
                "Intent to Bundle Requirements (DoD-Funded)"
              ]
            }
          },
          "states": {
            "title": "Place of performance states",
            "type": "array",
            "description": "2-letter codes, e.g. VA, TX. One search per state.",
            "items": {
              "type": "string"
            }
          },
          "classificationCodes": {
            "title": "Product/service (classification) codes",
            "type": "array",
            "description": "PSC codes, e.g. D or R425. One search per code.",
            "items": {
              "type": "string"
            }
          },
          "organizationName": {
            "title": "Agency / organization name",
            "type": "string",
            "description": "e.g. GENERAL SERVICES ADMINISTRATION."
          },
          "organizationCode": {
            "title": "Organization code",
            "type": "string",
            "description": "Federal Hierarchy code."
          },
          "solicitationNumber": {
            "title": "Solicitation number",
            "type": "string",
            "description": "Exact solicitation number."
          },
          "zip": {
            "title": "Place of performance ZIP",
            "type": "string",
            "description": "5-digit ZIP."
          },
          "activeOnly": {
            "title": "Active notices only",
            "type": "boolean",
            "description": "Skip archived notices.",
            "default": true
          },
          "postedWithinDays": {
            "title": "Posted in the last N days",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Used when no posted dates are given.",
            "default": 7
          },
          "postedFrom": {
            "title": "Posted from",
            "type": "string",
            "description": "YYYY-MM-DD. At most 1 year before Posted to (SAM.gov rule)."
          },
          "postedTo": {
            "title": "Posted to",
            "type": "string",
            "description": "YYYY-MM-DD. Defaults to today."
          },
          "responseDeadlineFrom": {
            "title": "Response deadline from",
            "type": "string",
            "description": "YYYY-MM-DD. Use with Response deadline to (max 1 year apart)."
          },
          "responseDeadlineTo": {
            "title": "Response deadline to",
            "type": "string",
            "description": "YYYY-MM-DD."
          },
          "monitorMode": {
            "title": "Monitor mode (only new or updated)",
            "type": "boolean",
            "description": "Remember what was seen and output only new or updated notices. Schedule daily.",
            "default": false
          },
          "monitorStateName": {
            "title": "Monitor name",
            "type": "string",
            "description": "Separate monitors keep separate memory.",
            "default": "default"
          },
          "aiSummary": {
            "title": "Add AI summary",
            "type": "boolean",
            "description": "Plain-English summary per delivered opportunity. Built-in summarizer: $0.005 each. With your own AI key below: $0.02 each.",
            "default": false
          },
          "fetchDescriptions": {
            "title": "Fetch full descriptions",
            "type": "boolean",
            "description": "Download each notice's description text for better summaries. Each description costs one of your SAM.gov API requests.",
            "default": false
          },
          "maxDescriptionFetches": {
            "title": "Max descriptions per run",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Limits how many of your daily API requests go to descriptions.",
            "default": 20
          },
          "llmApiKey": {
            "title": "Your LLM API key (optional)",
            "type": "string",
            "description": "Optional: your own OpenAI-compatible AI key. Used only for this run, never stored, logged or shown. Summaries made with it cost $0.02 each (built-in ones $0.005). Only notice business fields and description are sent, never contact details. If your AI call fails, the built-in summary is used and charged at $0.005."
          },
          "llmBaseUrl": {
            "title": "LLM base URL",
            "type": "string",
            "description": "OpenAI-compatible endpoint.",
            "default": "https://api.openai.com/v1"
          },
          "llmModel": {
            "title": "LLM model",
            "type": "string",
            "description": "Model name for your endpoint.",
            "default": "gpt-4o-mini"
          },
          "includePointOfContact": {
            "title": "Include point-of-contact names, emails, phones",
            "type": "boolean",
            "description": "Off by default: these are personal data of government staff, published for questions about a notice. Turn on only if you need them for that purpose.",
            "default": false
          },
          "includePre2022AwardeeData": {
            "title": "Include awardee details on pre-2022 award notices",
            "type": "boolean",
            "description": "Award notices dated before 2022-04-04 may contain Dun & Bradstreet data that SAM.gov's terms say may not be shared in bulk. Turn on only if your use is allowed.",
            "default": false
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "type": "integer",
            "description": "Optional cap on opportunities per run."
          },
          "maxApiRequests": {
            "title": "Max SAM.gov API requests per run",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Protects your daily quota: 10 fits a key with no SAM.gov role; raise it if your key allows 1,000/day.",
            "default": 10
          },
          "pageSize": {
            "title": "Results per API page",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "SAM.gov maximum is 1000.",
            "default": 1000
          },
          "minDelaySeconds": {
            "title": "Seconds between API requests",
            "minimum": 0,
            "maximum": 60,
            "type": "integer",
            "description": "Polite pacing.",
            "default": 1
          },
          "apiBaseUrl": {
            "title": "API base URL",
            "type": "string",
            "description": "https://api.sam.gov (production) or https://api-alpha.sam.gov (test). Other hosts are refused so your key only goes to SAM.gov.",
            "default": "https://api.sam.gov"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}