{
  "openapi": "3.0.1",
  "info": {
    "title": "SAM.gov Contract Opportunities Scraper",
    "description": "Scrape US federal contract opportunities from SAM.gov with full descriptions, contracting officer emails and phones, attachments, NAICS/PSC, set-asides, deadlines and award details. No API key needed. Monitor only new notices on a schedule.",
    "version": "1.0",
    "x-build-id": "V9cQ4JvSnf8ZluzwO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/artificially~samgov-opportunities-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-artificially-samgov-opportunities-scraper",
        "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/artificially~samgov-opportunities-scraper/runs": {
      "post": {
        "operationId": "runs-sync-artificially-samgov-opportunities-scraper",
        "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/artificially~samgov-opportunities-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-artificially-samgov-opportunities-scraper",
        "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": {
          "keywords": {
            "title": "Keywords",
            "type": "string",
            "description": "Free-text search in the notice title, description and solicitation number. All words must match. Example: \"cybersecurity\" or \"janitorial services\". Leave empty to return everything that matches the other filters."
          },
          "noticeTypes": {
            "title": "Notice types",
            "type": "array",
            "description": "Notice type codes to include. Allowed values: o = Solicitation, k = Combined Synopsis/Solicitation, p = Presolicitation, r = Sources Sought, s = Special Notice, a = Award Notice, u = Justification (J&A), i = Intent to Bundle, g = Sale of Surplus Property. Example: [\"o\", \"k\"] for open solicitations, [\"a\"] for award notices. Leave empty for all types.",
            "items": {
              "type": "string",
              "enum": [
                "o",
                "k",
                "p",
                "r",
                "s",
                "a",
                "u",
                "i",
                "g"
              ],
              "enumTitles": [
                "Solicitation",
                "Combined Synopsis/Solicitation",
                "Presolicitation",
                "Sources Sought",
                "Special Notice",
                "Award Notice",
                "Justification (J&A)",
                "Intent to Bundle Requirements",
                "Sale of Surplus Property"
              ]
            }
          },
          "naicsCodes": {
            "title": "NAICS codes",
            "type": "array",
            "description": "NAICS industry codes (digits only). A shorter prefix matches every code under it. Example: [\"541512\", \"5415\"] (541512 = Computer Systems Design Services). Leave empty for all industries.",
            "items": {
              "type": "string"
            }
          },
          "pscCodes": {
            "title": "PSC codes",
            "type": "array",
            "description": "Product Service Codes (4 characters) or prefixes. Example: [\"R425\", \"DA01\"] (R425 = Engineering and Technical Support). Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "setAsideTypes": {
            "title": "Set-aside types",
            "type": "array",
            "description": "Only notices reserved for these small business programs. Use the codes from the allowed values, e.g. [\"SBA\"] (Total Small Business), [\"8A\"], [\"SDVOSBC\"], [\"WOSB\"], [\"HZC\"] (HUBZone). Leave empty for all notices, set-aside or not.",
            "items": {
              "type": "string",
              "enum": [
                "SBA",
                "SBP",
                "8A",
                "8AN",
                "HZC",
                "HZS",
                "SDVOSBC",
                "SDVOSBS",
                "WOSB",
                "WOSBSS",
                "EDWOSB",
                "EDWOSBSS",
                "VSA",
                "VSS",
                "LAS",
                "IEE",
                "ISBEE",
                "BICiv"
              ],
              "enumTitles": [
                "Total Small Business Set-Aside",
                "Partial Small Business Set-Aside",
                "8(a) Set-Aside",
                "8(a) Sole Source",
                "HUBZone Set-Aside",
                "HUBZone Sole Source",
                "Service-Disabled Veteran-Owned (SDVOSB) Set-Aside",
                "Service-Disabled Veteran-Owned (SDVOSB) Sole Source",
                "Women-Owned Small Business (WOSB) Set-Aside",
                "Women-Owned Small Business (WOSB) Sole Source",
                "Economically Disadvantaged WOSB (EDWOSB) Set-Aside",
                "Economically Disadvantaged WOSB (EDWOSB) Sole Source",
                "Veteran-Owned Small Business Set-Aside (VA)",
                "Veteran-Owned Small Business Sole Source (VA)",
                "Local Area Set-Aside",
                "Indian Economic Enterprise (IEE) Set-Aside",
                "Indian Small Business Economic Enterprise (ISBEE) Set-Aside",
                "Buy Indian Set-Aside"
              ]
            }
          },
          "agencies": {
            "title": "Agencies",
            "type": "array",
            "description": "Federal departments, agencies or offices by name or numeric SAM.gov organization ID. Each name is matched to the closest SAM.gov organization. Example: [\"Department of Veterans Affairs\", \"NASA\"] or [\"Army\"]. Leave empty for all agencies.",
            "items": {
              "type": "string"
            }
          },
          "states": {
            "title": "Place of performance (states)",
            "type": "array",
            "description": "Two-letter US state codes where the work is performed. Example: [\"VA\", \"MD\", \"TX\"]. Invalid codes are ignored. Leave empty for any location.",
            "items": {
              "type": "string"
            }
          },
          "postedWithinDays": {
            "title": "Posted within the last N days",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Only notices published in the last N days, as an integer from 1 to 3650. Example: 7. Ignored when postedFrom is set. Leave empty for no posted-date limit."
          },
          "postedFrom": {
            "title": "Posted from",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Only notices published on or after this date. Format YYYY-MM-DD, e.g. \"2026-01-31\". Overrides postedWithinDays."
          },
          "postedTo": {
            "title": "Posted to",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Only notices published on or before this date. Format YYYY-MM-DD, e.g. \"2026-03-31\"."
          },
          "responseDeadlineFrom": {
            "title": "Response deadline from",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Only notices whose response/offer due date is on or after this date. Format YYYY-MM-DD, e.g. \"2026-02-01\". Handy to skip opportunities you no longer have time to bid on. Notices without a deadline (e.g. award notices) are excluded when this is set."
          },
          "responseDeadlineTo": {
            "title": "Response deadline to",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Only notices whose response due date is on or before this date. Format YYYY-MM-DD, e.g. \"2026-04-30\"."
          },
          "openForResponsesOnly": {
            "title": "Still open for responses only",
            "type": "boolean",
            "description": "Set to true to get only notices whose response deadline is today or later, so you never get a solicitation you can no longer bid on. Notices without a deadline (e.g. award notices) are excluded when this is on. Ignored when responseDeadlineFrom is set.",
            "default": false
          },
          "activeOnly": {
            "title": "Active notices only",
            "type": "boolean",
            "description": "true skips archived and inactive notices. Set to false to include them (e.g. for historical research).",
            "default": true
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "-relevance",
              "-modifiedDate"
            ],
            "type": "string",
            "description": "Order of results. \"-relevance\" = best keyword match first (only applies when keywords are set). \"-modifiedDate\" = most recently updated first. Without keywords, and always in monitoring mode, the most recently updated notices come first.",
            "default": "-relevance"
          },
          "includeDescription": {
            "title": "Include full description",
            "type": "boolean",
            "description": "Add the full notice description as plain text (HTML removed) in the description field. Set to false for smaller output. Ignored when compactOutput is on.",
            "default": true
          },
          "includeAttachments": {
            "title": "Include attachments and links",
            "type": "boolean",
            "description": "Add the name, size and download URL of every public attachment and external link. Files are not downloaded. With compactOutput on, only the attachmentsCount is returned.",
            "default": true
          },
          "compactOutput": {
            "title": "Compact output (for AI agents)",
            "type": "boolean",
            "description": "Set to true to save a slim item per notice with only the key fields: noticeId, samUrl, title, solicitationNumber, noticeType, postedDate, responseDeadline, daysUntilDeadline, department, subTier, office, naicsCode, setAsideCode, setAside, placeOfPerformance.state, the first point of contact (name, email), attachmentsCount and award (amount, awardeeName). The full description, attachment list, addresses and other fields are dropped. Recommended when an AI agent or LLM reads the results. Leave false for the full item.",
            "default": false
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of notices to save in this run, from 1 to 10000. Each saved notice is one result. Example: 10 for a quick look, 500 for a full export.",
            "default": 100
          },
          "onlyNewSinceLastRun": {
            "title": "Only new since last run (monitoring)",
            "type": "boolean",
            "description": "Set to true to skip notices already returned by earlier runs with the same filters. Use it with a Schedule to get only fresh opportunities each day. Seen notice IDs are kept in the named key-value store \"samgov-opportunities-monitor\".",
            "default": false
          },
          "apiKey": {
            "title": "SAM.gov API key (optional)",
            "type": "string",
            "description": "Not required, leave empty. If you have a free SAM.gov public API key, the search runs through the official Get Opportunities API v2 (subject to its daily limits). If the key fails or the daily limit is used up, the Actor falls back to the public SAM.gov search."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Not needed for SAM.gov in most cases. Leave as is; enable only if you see repeated network errors.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}