{
  "openapi": "3.0.1",
  "info": {
    "title": "SAM.gov Federal Contracts Scraper + Monitor — No Login, $3/1k",
    "description": "Scrape SAM.gov federal contract opportunities: RFPs, solicitations, sources sought, awards. Filter by keyword, NAICS, PSC, set-aside, notice type, agency, state, posted and due dates. Contracting officer contacts, full text. No login or cookies. MCP-ready for AI agents. $3 per 1,000 records.",
    "version": "0.0",
    "x-build-id": "KDiAhzSj9uHhLW4U5"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fortuitous_pirate~sam-gov-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fortuitous_pirate-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/fortuitous_pirate~sam-gov-scraper/runs": {
      "post": {
        "operationId": "runs-sync-fortuitous_pirate-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/fortuitous_pirate~sam-gov-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-fortuitous_pirate-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": "Search Keywords",
            "type": "string",
            "description": "Search terms, e.g. 'software development', 'cybersecurity', 'janitorial'. One search per line: several lines run as separate searches and the results are merged (de-duplicated). Leave empty to match everything within the other filters."
          },
          "keywordMode": {
            "title": "Keyword Match",
            "enum": [
              "ANY",
              "ALL",
              "EXACT"
            ],
            "type": "string",
            "description": "ANY = any of the words (SAM.gov's default), ALL = every word, EXACT = the exact phrase.",
            "default": "ANY"
          },
          "keywordList": {
            "title": "Keyword list (bulk)",
            "type": "array",
            "description": "Alternative to the Keywords box for API users: an array of search terms, each run as its own search.",
            "items": {
              "type": "string"
            }
          },
          "listUrl": {
            "title": "Bulk list URL (CSV / Google Sheet)",
            "type": "string",
            "description": "URL of a CSV, TSV or text file, or a Google Sheet shared as 'anyone with the link'. The first column is read; each row is treated as a keyword search, a solicitation number (e.g. N4008426R1026) or a notice ID / sam.gov URL, detected automatically."
          },
          "naicsCodes": {
            "title": "NAICS Codes",
            "type": "array",
            "description": "Filter by industry codes, one per line. Prefixes work too (5415 matches 541511, 541512, ...). Common IT: 541511 (Programming), 541512 (Systems Design), 541519 (Other IT), 518210 (Data/Hosting), 541690 (Consulting)",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "pscCodes": {
            "title": "PSC Codes (Product Service Codes)",
            "type": "array",
            "description": "Filter by Product Service Code / classification code, one per line, e.g. DA10 (IT software), R425 (engineering support), S201 (custodial), Z1DA (maintenance of hospitals), 6515 (medical supplies).",
            "items": {
              "type": "string"
            }
          },
          "setAsideTypes": {
            "title": "Set-Aside Types",
            "type": "array",
            "description": "Filter by set-aside code: SBA (Total Small Business), SBP (Partial SB), 8A, 8AN (8(a) Sole Source), HZC / HZS (HUBZone), SDVOSBC / SDVOSBS (Service-Disabled Vet), WOSB / WOSBSS, EDWOSB / EDWOSBSS, VSA / VSS (VA Veteran-Owned), LAS (Local Area), IEE, ISBEE, BICiv.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "opportunityTypes": {
            "title": "Opportunity (Notice) Types",
            "type": "array",
            "description": "Filter by notice type. Use codes or names (case-insensitive): o = Solicitation, k = Combined Synopsis/Solicitation, p = Presolicitation, r = Sources Sought, s = Special Notice, a = Award Notice, u = Justification, g = Sale of Surplus Property, i = Intent to Bundle. Leave empty for all types.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "agencies": {
            "title": "Agencies / Offices",
            "type": "array",
            "description": "Filter by contracting department, agency or office, one per line. Names, acronyms or SAM.gov organization IDs (e.g. 'Department of Veterans Affairs', 'DEPT OF THE NAVY', 'GSA', 100006568). Each name is matched against SAM.gov's federal hierarchy; the match is shown in the log and in the OUTPUT summary.",
            "items": {
              "type": "string"
            }
          },
          "states": {
            "title": "Place of Performance States",
            "type": "array",
            "description": "Filter by state codes where work will be performed (e.g., CA, TX, VA, DC)",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "activeOnly": {
            "title": "Active Opportunities Only",
            "type": "boolean",
            "description": "On (default): only notices still open on SAM.gov. Off: include archived/inactive notices too (useful for award history and research).",
            "default": true
          },
          "status": {
            "title": "Status",
            "enum": [
              "active",
              "inactive",
              "all"
            ],
            "type": "string",
            "description": "active = open notices only (default), inactive = archived notices only, all = both. Overrides 'Active Opportunities Only' when set."
          },
          "postedWithinDays": {
            "title": "Posted Within (Days)",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Only notices published or updated within this many days. Ignored when 'Posted From' is set.",
            "default": 30
          },
          "postedFrom": {
            "title": "Posted From",
            "type": "string",
            "description": "Only notices published or updated on/after this date. YYYY-MM-DD, 'today', or relative like '7 days' (= 7 days ago). Overrides 'Posted Within (Days)'."
          },
          "postedTo": {
            "title": "Posted To",
            "type": "string",
            "description": "Only notices published or updated on/before this date. YYYY-MM-DD, 'today', or relative like '2 days'."
          },
          "responseDeadlineFrom": {
            "title": "Response Deadline From",
            "type": "string",
            "description": "Only notices whose response/offer due date is on/after this date. YYYY-MM-DD, 'today', or relative like '3 days' (= 3 days from now). Use 'today' or '5 days' to skip solicitations you can no longer bid on."
          },
          "responseDeadlineTo": {
            "title": "Response Deadline To",
            "type": "string",
            "description": "Only notices whose response/offer due date is on/before this date. YYYY-MM-DD or relative like '30 days' (= within the next 30 days)."
          },
          "solicitationNumbers": {
            "title": "Solicitation Numbers (lookup)",
            "type": "array",
            "description": "Look up specific solicitations by number, one per line (e.g. N4008426R1026, 36C26026Q0576). Returns every notice carrying that number (original, amendments, award), active or archived. When set, search filters are ignored.",
            "items": {
              "type": "string"
            }
          },
          "noticeIds": {
            "title": "Notice IDs or SAM.gov URLs (lookup)",
            "type": "array",
            "description": "Fetch specific notices by 32-character notice ID or URL like https://sam.gov/opp/<id>/view, one per line. When set, search filters are ignored.",
            "items": {
              "type": "string"
            }
          },
          "maxOpportunities": {
            "title": "Maximum Results",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of opportunities to scrape. A single SAM.gov query returns at most 10,000 notices; split bigger pulls with date windows.",
            "default": 100
          },
          "sortBy": {
            "title": "Sort By",
            "enum": [
              "-modifiedDate",
              "-relevance"
            ],
            "type": "string",
            "description": "Recently modified (best for daily feeds and monitoring) or relevance (best with keywords).",
            "default": "-modifiedDate"
          },
          "fetchDetails": {
            "title": "Fetch Full Details",
            "type": "boolean",
            "description": "Fetch each notice's detail record: full description text, contracting officer contacts (name, email, phone), NAICS/PSC, set-aside, place of performance, award data. Turn off for a faster, listing-only pull.",
            "default": true
          },
          "includeAttachmentUrls": {
            "title": "Include Attachment URLs",
            "type": "boolean",
            "description": "Include direct download URLs for RFPs, SOWs, pricing templates, and other documents. URLs can be opened in browser to download.",
            "default": true
          },
          "downloadAttachments": {
            "title": "Download Attachment Files",
            "type": "boolean",
            "description": "Also save each public attachment file (PDF, DOCX, XLSX...) into the run's key-value store and add storedKey / storedUrl to the attachment. Download URLs are listed either way. No extra charge.",
            "default": false
          },
          "maxAttachmentSizeMb": {
            "title": "Max Attachment Size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Skip downloading files larger than this. Only used with 'Download Attachment Files'.",
            "default": 25
          },
          "maxAttachmentDownloads": {
            "title": "Max Attachment Downloads per Run",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Stop saving files after this many downloads (URLs are still listed).",
            "default": 200
          },
          "includeDescription": {
            "title": "Include Description Text",
            "type": "boolean",
            "description": "On (default): include the summary and the full notice text. Off: leave both empty for slimmer CSV/Excel exports (contacts, codes and attachments are still included).",
            "default": true
          },
          "onlyNew": {
            "title": "Monitor mode: only new or updated notices",
            "type": "boolean",
            "description": "Remembers every notice it has returned (in a key-value store named after Monitor ID) and on later runs returns only notices that are new or were updated since. Schedule the actor daily to get a change feed. Works with search filters and with solicitation-number lookups (tracks amendments to the bids you follow).",
            "default": false
          },
          "monitorId": {
            "title": "Monitor ID",
            "type": "string",
            "description": "Name of this watchlist. Each ID keeps its own seen-state (store samgov-monitor-<hash>), so several profiles can run side by side. Only used with monitor mode.",
            "default": "default"
          },
          "firstRunMode": {
            "title": "First Run Mode",
            "enum": [
              "emitAll",
              "baseline"
            ],
            "type": "string",
            "description": "When the monitor has no saved state yet: emitAll returns every current match (good for a first test); baseline records every current match silently and returns nothing, so the next scheduled run reports only what changed since.",
            "default": "emitAll"
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Optional. After each run a JSON summary (monitorId, runId, newCount, updatedCount, itemsPushed, first 50 opportunities) is POSTed here: Slack, Zapier, Make, n8n or your own API."
          },
          "proxyConfiguration": {
            "title": "Proxy (optional)",
            "type": "object",
            "description": "SAM.gov answers Apify's cloud IPs directly, so no proxy is needed and none is used by default. Set one only if your own network policy requires it."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}