{
  "openapi": "3.0.1",
  "info": {
    "title": "SAM.gov Contract Opportunities API Scraper",
    "description": "US federal contract opportunities from the official SAM.gov API: solicitations, sources sought, awards, set-asides, NAICS, deadlines, contacts.",
    "version": "0.1",
    "x-build-id": "Vj9n3H54AIbOv5hRt"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/knotty_mistveil~sam-gov-opportunities/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-knotty_mistveil-sam-gov-opportunities",
        "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/knotty_mistveil~sam-gov-opportunities/runs": {
      "post": {
        "operationId": "runs-sync-knotty_mistveil-sam-gov-opportunities",
        "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/knotty_mistveil~sam-gov-opportunities/run-sync": {
      "post": {
        "operationId": "run-sync-knotty_mistveil-sam-gov-opportunities",
        "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 API key",
            "type": "string",
            "description": "Required. Your own free SAM.gov public API key. Sign in at sam.gov, open Account Details and click 'Request API Key' (personal, non-federal keys allow 10 requests per day; a federal or entity-linked account gets 1,000). The key is stored encrypted by Apify and never written to the log. If you leave this empty, the Actor falls back to the SAM_API_KEY environment variable."
          },
          "daysBack": {
            "title": "Days back",
            "minimum": 1,
            "maximum": 366,
            "type": "integer",
            "description": "How many days of postings to fetch, counting back from today. Ignored when both 'Posted from' and 'Posted to' are set. SAM.gov allows a window of at most one year.",
            "default": 7
          },
          "dateFrom": {
            "title": "Posted from (YYYY-MM-DD)",
            "type": "string",
            "description": "Earliest posted date, for example 2026-09-01. Leave empty to use 'Days back'."
          },
          "dateTo": {
            "title": "Posted to (YYYY-MM-DD)",
            "type": "string",
            "description": "Latest posted date, for example 2026-09-07. Leave empty for today."
          },
          "noticeTypes": {
            "title": "Notice types",
            "type": "array",
            "description": "Only return these notice types (SAM.gov 'ptype' codes). Leave empty for every type. You may also type full names such as 'Solicitation' or 'Sources Sought'.",
            "items": {
              "type": "string",
              "enum": [
                "o",
                "k",
                "p",
                "r",
                "a",
                "s",
                "u",
                "i",
                "g"
              ],
              "enumTitles": [
                "o - Solicitation",
                "k - Combined Synopsis/Solicitation",
                "p - Presolicitation",
                "r - Sources Sought",
                "a - Award Notice",
                "s - Special Notice",
                "u - Justification (J&A)",
                "i - Intent to Bundle Requirements",
                "g - Sale of Surplus Property"
              ]
            },
            "default": []
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Case-insensitive OR match over title, solicitation number, agency, NAICS, classification code, set-aside and awardee. A single keyword is sent to the SAM.gov API as a title search; two or more are matched locally.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "title": {
            "title": "Title contains",
            "type": "string",
            "description": "Server-side SAM.gov title search. Takes precedence over 'Keywords' for the API query; keywords are then applied locally as an extra filter."
          },
          "naicsCodes": {
            "title": "NAICS codes",
            "type": "array",
            "description": "Industry codes, for example 541512. One full 6-digit code is sent to the API; several codes (or prefixes such as 5415) are matched locally against every NAICS code on the notice.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "setAsides": {
            "title": "Set-aside codes",
            "type": "array",
            "description": "SAM.gov set-aside codes, for example SBA (total small business), SBP, 8A, 8AN, HZC, HZS, SDVOSBC, SDVOSBS, WOSB, EDWOSB, VSA, VSS. One code is sent to the API; several are matched locally.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "classificationCode": {
            "title": "Classification code (PSC)",
            "type": "string",
            "description": "Product or Service Code, for example D310 or Z2AA. Sent to the SAM.gov API as 'ccode'."
          },
          "state": {
            "title": "Place of performance state",
            "type": "string",
            "description": "Two-letter US state code, for example TX. Sent to the SAM.gov API."
          },
          "zip": {
            "title": "Place of performance ZIP",
            "type": "string",
            "description": "ZIP code of the place of performance, for example 35806. Sent to the SAM.gov API."
          },
          "organizationName": {
            "title": "Organization name",
            "type": "string",
            "description": "Contracting organization name as SAM.gov spells it, for example 'ACC-APG HUNTSVILLE'. Sent to the SAM.gov API."
          },
          "solicitationNumber": {
            "title": "Solicitation number",
            "type": "string",
            "description": "Fetch a single solicitation by its number, for example W912DY26R0042."
          },
          "noticeId": {
            "title": "Notice ID",
            "type": "string",
            "description": "Fetch a single notice by its SAM.gov noticeId (the hex id in the sam.gov/opp/... URL)."
          },
          "responseDeadlineFrom": {
            "title": "Response deadline from (YYYY-MM-DD)",
            "type": "string",
            "description": "Only notices whose response deadline falls on or after this date. Useful to skip notices that already closed."
          },
          "responseDeadlineTo": {
            "title": "Response deadline to (YYYY-MM-DD)",
            "type": "string",
            "description": "Only notices whose response deadline falls on or before this date."
          },
          "activeOnly": {
            "title": "Active notices only",
            "type": "boolean",
            "description": "Drop notices SAM.gov has archived (active = No). Applied locally after fetching.",
            "default": false
          },
          "fetchDescriptions": {
            "title": "Download full descriptions",
            "type": "boolean",
            "description": "Also download the full notice text into the 'description' field. WARNING: this costs one extra SAM.gov API request per record and personal non-federal keys allow only 10 requests per day, so use it with a small 'Max results'.",
            "default": false
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after this many opportunities. You are charged per result returned, so this is also your cost cap.",
            "default": 500
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}