{
  "openapi": "3.0.1",
  "info": {
    "title": "SAM.gov Scraper – Government Bids & Federal Procurement",
    "description": "Scrape live US federal contracting opportunities from SAM.gov — solicitations, sources sought and awards — plus wage determinations, CFDA grant/loan programs and organization-only exclusion records, with no API key and no login. NAICS, set-aside, notice type and state filters, contacts, watch mode.",
    "version": "0.1",
    "x-build-id": "fKPocSlVOLV26NG8Q"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fetchsmith~sam-gov-opportunities-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fetchsmith-sam-gov-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/fetchsmith~sam-gov-opportunities-scraper/runs": {
      "post": {
        "operationId": "runs-sync-fetchsmith-sam-gov-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/fetchsmith~sam-gov-opportunities-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-fetchsmith-sam-gov-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": {
          "dataType": {
            "title": "Data type",
            "enum": [
              "opportunities",
              "wage-determinations-dbra",
              "wage-determinations-sca",
              "wage-determinations-cba",
              "assistance-listings",
              "exclusions"
            ],
            "type": "string",
            "description": "Which SAM.gov public dataset to pull. **Contract opportunities** (default) returns solicitations/awards. The three **wage determination** options return the Department of Labor determinations SAM.gov publishes: **Davis-Bacon Act** (construction, ~85k records), **Service Contract Act** (services, ~2.7k) and **Collective Bargaining Agreement** (~108k). Wage-determination modes support the keyword, state, active-only and max-results filters only — NAICS, set-aside, notice type, organization and detail enrichment are opportunity-only and are ignored (with a log warning) if set. They return the determination index (which determination applies to which state/counties, its revision and whether it is current), not the per-occupation hourly rate tables. **Assistance listings (CFDA)** returns the Catalog of Federal Domestic Assistance — federal grant/loan/direct-payment programs (~7.4k, ~2.9k currently active) — with objective, eligibility, funding-obligation history and agency contact per program. Supports keyword, organization, active-only and max-results only — NAICS/set-aside/notice-type/state are opportunity-only and ignored here (assistance-listing programs are nationwide, not filtered by place of performance). **Exclusions** returns SAM.gov's federal debarment/suspension list, restricted to organizations only (firms, vessels and special entity designations — ~35.2k records) — it never returns the individual-person exclusion records SAM.gov also publishes, to avoid shipping a people-search product; see the README for detail. Supports keyword (entity name) and organization only — NAICS/set-aside/notice-type/state/active-only are ignored (state is applied server-side but returns zero matches on this index; active-only has no effect on it at all).",
            "default": "opportunities"
          },
          "keyword": {
            "title": "Keyword",
            "type": "string",
            "description": "Searched against opportunity title/description. For wage determinations it matches the determination's reference number (e.g. \"AK20260001\"), NOT trades or occupations. For assistance listings it matches title/objective/program number. For exclusions it matches the excluded entity's name. Leave empty for all. Defaults to \"contract\" for opportunities so a first test run never returns 0 rows; other data types default to empty."
          },
          "naicsCodes": {
            "title": "NAICS codes",
            "type": "array",
            "description": "Filter to one or more 6-digit NAICS codes, e.g. 541511.",
            "items": {
              "type": "string"
            }
          },
          "setAsideTypes": {
            "title": "Set-aside types",
            "type": "array",
            "description": "Filter to SAM.gov set-aside codes, e.g. SBA (total small business). Codes are case-sensitive on SAM.gov's backend but this Actor corrects the case for you, so `sba` and `SBA` both work. Valid codes: SBA, SBP, 8A, 8AN, HZC, HZS, SDVOSBC, SDVOSBS, WOSB, WOSBSS, EDWOSB, EDWOSBSS, LAS, IEE, ISBEE, BICiv, VSA, VSS. The umbrella names 8(a), SDVOSB and HUBZone are also accepted and expand to the real code(s) they cover (SDVOSB -> SDVOSBC + SDVOSBS, HUBZone -> HZC + HZS). Three further codes SAM.gov accepts are supported but are not ordinary set-asides: NONE is SAM.gov's explicit \"unrestricted / no set-aside\" tag (~39k opportunities, ~3.3k of them active) — it NARROWS your search to those rows, and is not the same as leaving this field empty; SDB (Total Small Disadvantaged Business, ~464 rows) and ESB (Emerging Small Business, ~714 rows) are retired programs with zero active opportunities and nothing posted since 2020, kept because those historical rows are otherwise unreachable by this filter. Anything else is not a code SAM.gov knows: the run logs a warning and that value matches ZERO opportunities (it never widens your results). Multiple values are ORed.",
            "items": {
              "type": "string"
            }
          },
          "noticeTypes": {
            "title": "Notice types",
            "uniqueItems": true,
            "type": "array",
            "description": "Which SAM.gov notice types to include. All types if left empty. The last 4 (m/f/j/l) are legacy codes SAM.gov's own UI dropdown no longer lists and stopped issuing around 2019-2020, but ~97k real historical opportunities still carry them and are otherwise unreachable by this filter -- useful for historical research, not current solicitations. IMPORTANT: on a Watch mode run with \"also alert on lifecycle/deadline changes\" on, setting this filters out the very lifecycle transition that option watches for -- an opportunity whose notice type moves out of your selection (e.g. Solicitation to Award) stops matching the query entirely, so that change is never reported. Leave empty on a watchChanges run if you need to see notice-type transitions.",
            "items": {
              "type": "string",
              "enum": [
                "p",
                "o",
                "k",
                "r",
                "a",
                "s",
                "g",
                "i",
                "u",
                "m",
                "f",
                "j",
                "l"
              ],
              "enumTitles": [
                "Presolicitation",
                "Solicitation",
                "Combined Synopsis/Solicitation",
                "Sources Sought",
                "Award Notice",
                "Special Notice",
                "Sale of Surplus",
                "Intent to Bundle",
                "Justification",
                "Modification/Amendment/Cancel (legacy, retired ~2020)",
                "Foreign Government Standard (legacy, retired ~2019)",
                "Justification and Approval, J&A (legacy, retired ~2019)",
                "Fair Opportunity/Limited Sources Justification (legacy, retired ~2019)"
              ]
            }
          },
          "states": {
            "title": "Place of performance state(s)",
            "type": "array",
            "description": "2-letter US state codes, e.g. CA. For opportunities this is the place of performance; for wage determinations it is the state the determination covers. Multiple states are OR-ed. Not supported for assistance listings or exclusions (ignored for both).",
            "items": {
              "type": "string"
            }
          },
          "organizationId": {
            "title": "Organization ID",
            "type": "string",
            "description": "SAM.gov internal organization ID to filter to one agency/office (advanced; find via a search result's organizationHierarchy). Supported for opportunities, assistance listings and exclusions; ignored for wage determinations."
          },
          "activeOnly": {
            "title": "Active records only",
            "type": "boolean",
            "description": "Only return records SAM.gov currently flags active (for wage determinations: currently in force, i.e. not superseded by a later revision; for assistance listings: the program is currently active, ~2.9k of ~7.4k). Has no effect on exclusions — SAM.gov's exclusions index does not support server-side active-status filtering; check each row's own isActive/terminationDate fields instead. IMPORTANT: this is ON BY DEFAULT and, combined with Watch mode's \"also alert on lifecycle/deadline changes\", makes the active → inactive/awarded transition structurally unreportable — once a row goes inactive it stops matching the query entirely, so the change is never seen. Set this to false on any watchChanges run where you need that transition; see the README FAQ \"don't filter on the field you're watching\".",
            "default": true
          },
          "enrichDetail": {
            "title": "Enrich with detail call",
            "type": "boolean",
            "description": "Make one extra request per opportunity to add NAICS codes, set-aside, place-of-performance state/country and point-of-contact (name/email/phone, published by the agency itself as part of the public notice). Slower. Opportunities only; ignored for wage determinations, assistance listings and exclusions (their search rows already carry the full record).",
            "default": false
          },
          "includeAttachments": {
            "title": "Include attachment download links",
            "type": "boolean",
            "description": "Make one extra request per opportunity to list its attachments (drawings, full statements of work, forms) and add an `attachments` field with each file's name, size, MIME type and a direct, no-login download URL. Slower. Opportunities only; ignored for wage determinations, assistance listings and exclusions (SAM.gov does not attach files to those).",
            "default": false
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Stop after this many opportunities. SAM.gov's own search backend caps result depth at 10,000 for any single query — narrow keyword/filters to go deeper.",
            "default": 200
          },
          "watchLabel": {
            "title": "Watch label (only new since last run)",
            "type": "string",
            "description": "Optional. Name a saved search (e.g. \"my-naics-541511-watch\") and this run returns ONLY opportunities not delivered under that same label and filter set before, instead of the full match set every time. The first run for a label is a free baseline: it records what already matches and returns zero rows. Run it again later — on a schedule, typically — to get only what's new. The baseline is kept in your own Apify account (a named key-value store), keyed by label plus a fingerprint of your other filters, so changing a filter starts a fresh baseline instead of dumping previously-excluded opportunities as \"new\"."
          },
          "watchChanges": {
            "title": "Watch mode: also alert on lifecycle/deadline changes",
            "type": "boolean",
            "description": "Only used together with Watch label. When on, a run also re-delivers a record you already have if its watched fields changed since you last saw it: for opportunities, active/notice-type status (e.g. presolicitation turning into a solicitation, or an award landing), response deadline, modified date, modification count, awardee or description; for wage determinations, revision number, active status or modified date; for assistance listings, active or funded status, modified date, or historical-index entry count; for exclusions, active status or termination date (a debarment being lifted). Charged at the same per-row price as a new record. Each changed row is tagged with `_watchChangeType` (one or more of `isActive`, `noticeTypeCode`, `responseDate`, `modifiedDate`, `modificationsCount`, `awardeeName`, `description`, `revisionNumber`, `isFunded`, `historicalIndexCount`, `terminationDate`) plus the previous value(s) under `_watchPrevious`. Off by default so existing watches keep their current behaviour. IMPORTANT: do not combine this with Active records only (on by default!) or the Notice types filter -- both are server-side filters on fields this option watches, so a row whose isActive or noticeTypeCode moves out of your filter stops matching the search and its change can never be reported. The run warns you if you do; see the README FAQ \"don't filter on the field you're watching\".",
            "default": false
          },
          "webhookUrl": {
            "title": "Webhook URL (notify on completion)",
            "type": "string",
            "description": "Optional. An http(s) URL to POST a small JSON summary to when the run finishes — opportunities pushed, rows scanned, and (when Watch label is set) whether this was a baseline run plus the new/changed/skipped counts, along with the run's dataset ID so you can fetch the results. A convenience for callers who want a completion ping without setting up an Apify platform webhook (which needs separate Console/API configuration per Task, not per run). Best-effort: a failed or slow webhook is logged as a warning and never fails the run or affects charging — it fires after every opportunity has already been pushed and charged. Leave empty to skip."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}