{
  "openapi": "3.0.1",
  "info": {
    "title": "SAM.gov Scraper - Federal Contracts, RFPs, Contacts & Awards",
    "description": "Scrape SAM.gov federal contract opportunities: solicitations, RFPs, sources sought and award notices with contracting officer e-mail and phone, NAICS/PSC titles, set-aside, deadline, attachments and history. Filters, monitor mode, market counts. No API key. $0.045 per 1,000 notices.",
    "version": "0.1",
    "x-build-id": "NuN5gw22RuagRAW8a"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/topapi~sam-gov-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-topapi-sam-gov-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/topapi~sam-gov-scraper/runs": {
      "post": {
        "operationId": "runs-sync-topapi-sam-gov-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/topapi~sam-gov-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-topapi-sam-gov-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": "array",
            "description": "Words to search for, as you would type them in SAM.gov's search box. They are searched together (see Keyword match). Leave empty to list notices by the filters below only.",
            "items": {
              "type": "string"
            }
          },
          "keywordMode": {
            "title": "Keyword match",
            "enum": [
              "ALL",
              "ANY",
              "EXACT"
            ],
            "type": "string",
            "description": "How SAM.gov matches the keywords: every word, any word, or the exact phrase.",
            "default": "ALL"
          },
          "searchKeywordsSeparately": {
            "title": "Search each keyword separately",
            "type": "boolean",
            "description": "Run one search per keyword (each with its own Max results per search) instead of one search for all of them.",
            "default": false
          },
          "keywordScope": {
            "title": "Keywords must be in",
            "enum": [
              "anywhere",
              "title"
            ],
            "type": "string",
            "description": "\"The title\" keeps only notices whose title holds the keywords.",
            "default": "anywhere"
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "type": "array",
            "description": "Drop notices whose title or description holds any of these words (never charged).",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "SAM.gov search or notice addresses",
            "type": "array",
            "description": "Paste a SAM.gov contract-opportunity search (sam.gov/search/?index=opp...) with your filters set, or notice pages (sam.gov/opp/<id>/view).",
            "items": {
              "type": "string"
            }
          },
          "noticeIds": {
            "title": "Notice ids",
            "type": "array",
            "description": "SAM.gov notice ids (the 32 characters in sam.gov/opp/<id>/view). Each returns that notice, current or archived.",
            "items": {
              "type": "string"
            }
          },
          "solicitationNumbers": {
            "title": "Solicitation numbers",
            "type": "array",
            "description": "Every notice filed under these solicitation numbers (presolicitation, solicitation, award...), current or archived.",
            "items": {
              "type": "string"
            }
          },
          "urlsFromFile": {
            "title": "Notice ids or addresses from a file",
            "type": "string",
            "description": "Address of a plain-text or CSV file listing notice ids or SAM.gov addresses (one per line). A file in your own Apify storage (a key-value store record or a dataset export, api.apify.com/v2/...) is read with your run's token."
          },
          "noticeTypes": {
            "title": "Notice types",
            "type": "array",
            "description": "One or more notice types. Empty = every type.",
            "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",
                "Sale of Surplus Property",
                "Intent to Bundle Requirements (DoD-Funded)"
              ]
            }
          },
          "naicsCodes": {
            "title": "NAICS codes",
            "type": "array",
            "description": "NAICS codes, e.g. 541511, or prefixes: 5415 matches every code under it, 54 the whole sector.",
            "items": {
              "type": "string"
            }
          },
          "pscCodes": {
            "title": "PSC codes",
            "type": "array",
            "description": "Product and service codes, e.g. R425, or prefixes: R4 matches every code under it.",
            "items": {
              "type": "string"
            }
          },
          "setAsideCodes": {
            "title": "Set-asides",
            "type": "array",
            "description": "One or more set-asides. Empty = any.",
            "items": {
              "type": "string",
              "enum": [
                "SBA",
                "SBP",
                "8A",
                "8AN",
                "HZC",
                "HZS",
                "SDVOSBC",
                "SDVOSBS",
                "WOSB",
                "WOSBSS",
                "EDWOSB",
                "EDWOSBSS",
                "LAS",
                "IEE",
                "ISBEE",
                "BICiv",
                "VSA",
                "VSS",
                "NONE"
              ],
              "enumTitles": [
                "Total Small Business (SBA)",
                "Partial Small Business (SBP)",
                "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)",
                "Local Area Set-Aside (LAS)",
                "Indian Economic Enterprise (IEE)",
                "Indian Small Business Economic Enterprise (ISBEE)",
                "Buy Indian (BICiv)",
                "Veteran-Owned Small Business Set-Aside, VA (VSA)",
                "Veteran-Owned Small Business Sole Source, VA (VSS)",
                "No set-aside (NONE)"
              ]
            }
          },
          "agencies": {
            "title": "Agencies",
            "type": "array",
            "description": "Departments, agencies or offices by name (e.g. \"Veterans Affairs\", \"Defense Logistics Agency\") or SAM.gov organization id. A name is looked up in SAM.gov's federal hierarchy; the run log says which organization it read.",
            "items": {
              "type": "string"
            }
          },
          "states": {
            "title": "Place of performance: states",
            "type": "array",
            "description": "Two-letter state or territory codes (VA, TX, DC, PR...) or names.",
            "items": {
              "type": "string"
            }
          },
          "placeOfPerformanceZip": {
            "title": "Place of performance: ZIP code",
            "type": "string",
            "description": "A five-digit ZIP code."
          },
          "countries": {
            "title": "Place of performance: countries",
            "type": "array",
            "description": "Three-letter country codes: USA, DEU, JPN, KOR...",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "title": "Status",
            "enum": [
              "active",
              "inactive",
              "all"
            ],
            "type": "string",
            "description": "SAM.gov keeps about 45,000 active notices and 5.6 million archived ones.",
            "default": "active"
          },
          "postedFrom": {
            "title": "Posted from",
            "type": "string",
            "description": "Only notices posted on or after this day."
          },
          "postedTo": {
            "title": "Posted to",
            "type": "string",
            "description": "Only notices posted on or before this day."
          },
          "postedWithinDays": {
            "title": "Posted within (days)",
            "minimum": 0,
            "type": "integer",
            "description": "Only notices posted in the last N days (0 or empty = no limit)."
          },
          "modifiedFrom": {
            "title": "Updated from",
            "type": "string",
            "description": "Only notices updated on or after this day."
          },
          "modifiedTo": {
            "title": "Updated to",
            "type": "string",
            "description": "Only notices updated on or before this day."
          },
          "responseDeadlineFrom": {
            "title": "Response due from",
            "type": "string",
            "description": "Only notices whose response deadline is on or after this day (notices without a deadline are left out)."
          },
          "responseDeadlineTo": {
            "title": "Response due to",
            "type": "string",
            "description": "Only notices whose response deadline is on or before this day."
          },
          "openForResponsesOnly": {
            "title": "Still open for responses",
            "type": "boolean",
            "description": "Drop notices whose response deadline has passed (notices without a deadline stay). Checked by this actor on the search results, before anything is charged.",
            "default": false
          },
          "awardedOnly": {
            "title": "Award notices only",
            "type": "boolean",
            "description": "Only award notices (the ones naming the contractor, award number, date and amount).",
            "default": false
          },
          "minAwardAmount": {
            "title": "Minimum award amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only notices whose award amount is at least this (award notices). Checked by this actor on the notice record, before anything is charged."
          },
          "maxAwardAmount": {
            "title": "Maximum award amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only notices whose award amount is at most this."
          },
          "onlyWithContactEmail": {
            "title": "Only notices with a contact e-mail",
            "type": "boolean",
            "description": "Drop notices that name no contracting officer e-mail (never charged).",
            "default": false
          },
          "dedupeBySolicitation": {
            "title": "One notice per solicitation number",
            "type": "boolean",
            "description": "Keep only the newest notice of each solicitation number (a presolicitation, its solicitation and its award share one).",
            "default": false
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 0,
            "type": "integer",
            "description": "Most notices (or summary rows) for the whole run. 0 = every match: searches over 10,000 matches are read in date ranges.",
            "default": 100
          },
          "maxResultsPerSearch": {
            "title": "Max results per search",
            "minimum": 0,
            "type": "integer",
            "description": "Most notices from each search (keyword, address). 0 = no per-search limit.",
            "default": 0
          },
          "sortBy": {
            "title": "Sort",
            "enum": [
              "newest",
              "oldest",
              "relevance",
              "title",
              "title_desc"
            ],
            "type": "string",
            "description": "Order SAM.gov returns the notices in.",
            "default": "newest"
          },
          "includeDetails": {
            "title": "Notice record",
            "type": "boolean",
            "description": "Open each notice for its full description, NAICS and PSC codes with titles, set-aside, contracting officer contacts (name, title, e-mail, phone), place of performance, archive date and the full award (number, date, amount, awardee UEI, CAGE and location). Included in the notice price. Off = the search fields only (faster).",
            "default": true
          },
          "includeDescription": {
            "title": "Description",
            "type": "boolean",
            "description": "The notice's description text.",
            "default": true
          },
          "descriptionFormat": {
            "title": "Description format",
            "enum": [
              "text",
              "html",
              "both"
            ],
            "type": "string",
            "description": "Plain text (descriptionText), SAM.gov's HTML (descriptionHtml), or both.",
            "default": "text"
          },
          "descriptionMaxChars": {
            "title": "Description length limit",
            "minimum": 0,
            "type": "integer",
            "description": "Cut descriptions to this many characters (0 = full text).",
            "default": 0
          },
          "includeAttachments": {
            "title": "Attachment list",
            "type": "boolean",
            "description": "Every public file and link of the notice (SOW, PWS, pricing sheets, amendments): name, size, type, date and a download address that needs no SAM.gov account. Charged per notice that has at least one.",
            "default": true
          },
          "includeHistory": {
            "title": "Version history",
            "type": "boolean",
            "description": "Every version of the notice (the original and each amendment, cancellation or archive) with its notice id, date and type, plus the linked notice. Charged per notice.",
            "default": false
          },
          "downloadAttachments": {
            "title": "Download attachment files",
            "type": "boolean",
            "description": "Save each public attachment file to the run's key-value store (downloadedFiles gives its key and address). Charged per file saved.",
            "default": false
          },
          "maxAttachmentSizeMb": {
            "title": "Largest file to download (MB)",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Files above this size are listed but not downloaded.",
            "default": 25
          },
          "maxAttachmentDownloads": {
            "title": "Most files to download",
            "minimum": 0,
            "type": "integer",
            "description": "Most files saved in one run (0 = no limit).",
            "default": 200
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "aggregate"
            ],
            "type": "string",
            "description": "Summary counts the notices matching your keywords and filters by one dimension (Group by) without reading them: the size of a market in seconds.",
            "default": "search"
          },
          "groupBy": {
            "title": "Group by",
            "enum": [
              "noticeType",
              "setAside",
              "state",
              "naicsSector",
              "department",
              "month"
            ],
            "type": "string",
            "description": "The dimension Summary mode counts by. Month posted covers Posted from/to, or the last 12 months.",
            "default": "noticeType"
          },
          "monitorMode": {
            "title": "Monitor mode",
            "type": "boolean",
            "description": "Return only notices that are new since the last run, or updated (an amendment of a solicitation seen before, or a changed notice). Pairs with a schedule. The first run returns everything (or saves a baseline, below).",
            "default": false
          },
          "monitorStoreName": {
            "title": "Monitor name",
            "type": "string",
            "description": "Name of the memory this monitor keeps (letters, digits, dashes). Give each saved search its own name; empty = one memory per input."
          },
          "skipFirstRun": {
            "title": "First run saves a baseline",
            "type": "boolean",
            "description": "The first monitor run records what exists and returns nothing (nothing charged); later runs return what is new.",
            "default": false
          },
          "includeUpdates": {
            "title": "Return updated notices",
            "type": "boolean",
            "description": "Also return amendments of solicitations seen before and notices changed since the last run (changeType UPDATED).",
            "default": true
          },
          "emitUnchanged": {
            "title": "Return unchanged notices too",
            "type": "boolean",
            "description": "Return every match, each marked NEW, UPDATED or UNCHANGED (all charged).",
            "default": false
          },
          "resetMonitor": {
            "title": "Reset the monitor memory",
            "type": "boolean",
            "description": "Forget what earlier runs saw and start over.",
            "default": false
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "POST the notices of this run (JSON) here when it finds any."
          },
          "webhookHeaders": {
            "title": "Webhook headers",
            "type": "object",
            "description": "Extra HTTP headers for the webhook, e.g. {\"Authorization\": \"Bearer ...\"}."
          },
          "slackWebhookUrl": {
            "title": "Slack webhook URL",
            "type": "string",
            "description": "A Slack incoming-webhook address for a short message per run."
          },
          "discordWebhookUrl": {
            "title": "Discord webhook URL",
            "type": "string",
            "description": "A Discord webhook address for a short message per run."
          },
          "notificationLimit": {
            "title": "Notices per alert",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Most notices listed in one alert.",
            "default": 10
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Default: the run's own connection, then an Apify datacenter proxy, then a US residential one only if SAM.gov refuses the others. Pick a group or your own proxies to use only those.",
            "default": {
              "useApifyProxy": true
            }
          },
          "maxConcurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Notice records read at once.",
            "default": 20
          },
          "maxRequestRetries": {
            "title": "Retries per request",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Attempts per request before it counts as failed.",
            "default": 3
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}