{
  "openapi": "3.0.1",
  "info": {
    "title": "US Federal Contracts Scraper (SAM + awards, hard cap)",
    "description": "Join public U.S. federal contract opportunities from SAM.gov with USAspending.gov award history: agency, NAICS/PSC, set-aside, deadlines, value and incumbent company names. User-supplied SAM API key; awards work with no key. Hard maxItems cap. No personal contacts. Pay per record.",
    "version": "0.1",
    "x-build-id": "WQ9jQNoIMsKhRNuEo"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapemole~us-gov-contracts-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapemole-us-gov-contracts-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/scrapemole~us-gov-contracts-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapemole-us-gov-contracts-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/scrapemole~us-gov-contracts-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapemole-us-gov-contracts-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": "Search terms for contract descriptions and titles, e.g. cybersecurity or janitorial. Each item is its own search, then results are merged. A single string, keyword, query, q or a newline-separated Keywords box also work.",
            "items": {
              "type": "string"
            }
          },
          "keyword": {
            "title": "Keyword (alias)",
            "type": "string",
            "description": "Single search term. Accepted so jungle_synthesizer inputs run unchanged."
          },
          "keywordList": {
            "title": "Keyword list (alias)",
            "type": "array",
            "description": "Bulk keyword array. Accepted so fortuitous_pirate inputs run unchanged.",
            "items": {
              "type": "string"
            }
          },
          "keywordMode": {
            "title": "Keyword match",
            "enum": [
              "ANY",
              "ALL",
              "EXACT"
            ],
            "type": "string",
            "description": "ANY (default) = any word, ALL = every word, EXACT = the exact phrase. Used when searching USAspending and as the SAM title query.",
            "default": "ANY"
          },
          "naicsCodes": {
            "title": "NAICS codes",
            "type": "array",
            "description": "Industry codes, e.g. 541511 (programming), 541512 (systems design), 561720 (janitorial). Prefixes are kept as entered. naics also works.",
            "items": {
              "type": "string"
            }
          },
          "pscCodes": {
            "title": "PSC codes",
            "type": "array",
            "description": "Product or Service Codes, e.g. DA10, D318, R425. psc also works.",
            "items": {
              "type": "string"
            }
          },
          "setAsideTypes": {
            "title": "Set-aside types",
            "type": "array",
            "description": "Opportunity set-aside codes: SBA, 8A, HZC, SDVOSBC, WOSB, EDWOSB, and the other SAM.gov codes. setAsideType (single value) also works. Applied on SAM when a key is set; kept on award details when USAspending publishes them.",
            "items": {
              "type": "string"
            }
          },
          "opportunityTypes": {
            "title": "Notice types",
            "type": "array",
            "description": "SAM notice types: o (Solicitation), k (Combined Synopsis/Solicitation), p (Presolicitation), r (Sources Sought), s (Special Notice), a (Award Notice), u (Justification), g (Sale of Surplus), i (Intent to Bundle). opportunityType also works. Only used on the SAM path.",
            "items": {
              "type": "string"
            }
          },
          "agencies": {
            "title": "Agencies",
            "type": "array",
            "description": "Awarding department or agency names, e.g. Department of Veterans Affairs or GSA. agency (single string) also works.",
            "items": {
              "type": "string"
            }
          },
          "states": {
            "title": "Place of performance states",
            "type": "array",
            "description": "Two-letter state codes (CA, TX, VA, DC). state also works.",
            "items": {
              "type": "string"
            }
          },
          "solicitationNumbers": {
            "title": "Solicitation numbers",
            "type": "array",
            "description": "Look up specific solicitations (e.g. N4008426R1026). On the SAM path this uses solnum; on the awards path it is used as a keyword / solicitation identifier.",
            "items": {
              "type": "string"
            }
          },
          "noticeIds": {
            "title": "Notice IDs or SAM.gov URLs",
            "type": "array",
            "description": "32-character SAM notice IDs or https://sam.gov/opp/<id>/view URLs. Requires a SAM API key.",
            "items": {
              "type": "string"
            }
          },
          "postedWithinDays": {
            "title": "Posted within (days)",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Only records posted or updated in this many days. Ignored when Posted From is set. For the no-key awards path this bounds the USAspending time window.",
            "default": 365
          },
          "postedFrom": {
            "title": "Posted from",
            "type": "string",
            "description": "YYYY-MM-DD, today, or a relative span such as 7 days (ago). Overrides Posted within."
          },
          "postedTo": {
            "title": "Posted to",
            "type": "string",
            "description": "YYYY-MM-DD, today, or a relative span such as 2 days."
          },
          "activeOnly": {
            "title": "Active only",
            "type": "boolean",
            "description": "On the SAM path: only open opportunities. On the awards path: only awards whose period of performance has not ended.",
            "default": true
          },
          "status": {
            "title": "Status (alias)",
            "enum": [
              "active",
              "inactive",
              "all"
            ],
            "type": "string",
            "description": "active, inactive or all. Overrides Active only when set. Accepted so fortuitous_pirate inputs run unchanged."
          },
          "maxItems": {
            "title": "Max records in total",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard cap for the whole run. The Actor stops when this many rows have been delivered. maxOpportunities, limit and count also work.",
            "default": 100
          },
          "includeAwards": {
            "title": "Include USAspending awards / incumbents",
            "type": "boolean",
            "description": "On (default): attach matched past awards and incumbent company names to each opportunity, or — when no SAM API key is set — deliver award rows directly from USAspending.gov (no key required).",
            "default": true
          },
          "maxAwardsPerNotice": {
            "title": "Max awards per opportunity",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "When joining awards onto a SAM notice, keep at most this many past awards. Default 5.",
            "default": 5
          },
          "samApiKey": {
            "title": "SAM.gov API key",
            "type": "string",
            "description": "Your own free public API key from Account Details on SAM.gov. Required only for live opportunities. If this is empty, the Actor skips SAM, says so in the log and RUN_SUMMARY, and still returns USAspending award rows when Include awards is on. Never logged or written to the dataset. apiKey and api_key also work."
          },
          "maxConcurrency": {
            "title": "Parallel detail fetches",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "How many USAspending award-detail requests to run at once.",
            "default": 2
          },
          "maxRetries": {
            "title": "Retries per request",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Retries for timeouts and HTTP errors.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Apify Proxy (datacenter / automatic) is on by default. Official USAspending and SAM APIs do not need residential IPs; this Actor will not switch to them.",
            "default": {
              "useApifyProxy": true
            }
          },
          "maxOpportunities": {
            "title": "Maximum results (alias)",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Alias of Max records. Accepted so fortuitous_pirate inputs run unchanged."
          },
          "setAsideType": {
            "title": "Set-aside type (alias)",
            "type": "string",
            "description": "Single set-aside code. Accepted so jungle_synthesizer inputs run unchanged."
          },
          "opportunityType": {
            "title": "Opportunity type (alias)",
            "type": "string",
            "description": "Single notice type. Accepted so jungle_synthesizer inputs run unchanged."
          },
          "agency": {
            "title": "Agency (alias)",
            "type": "string",
            "description": "Single agency name. Accepted so jungle_synthesizer inputs run unchanged."
          },
          "state": {
            "title": "State (alias)",
            "type": "string",
            "description": "Single state code. Accepted so jungle_synthesizer inputs run unchanged."
          },
          "naics": {
            "title": "NAICS (alias)",
            "type": "array",
            "description": "Alias of NAICS codes.",
            "items": {
              "type": "string"
            }
          },
          "limit": {
            "title": "Limit (alias)",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Alias of Max records."
          },
          "apiKey": {
            "title": "API key (alias)",
            "type": "string",
            "description": "Alias of SAM.gov API key. Stored as a secret; never logged."
          },
          "api_key": {
            "title": "API key (api_key alias)",
            "type": "string",
            "description": "Alias of SAM.gov API key. Stored as a secret; never logged."
          },
          "includeAttachments": {
            "title": "Include attachment URLs (alias)",
            "type": "boolean",
            "description": "Accepted for compatibility. Public attachment URLs from SAM are listed when true; files are never downloaded, and this Actor never charges extra for them."
          },
          "includeAttachmentUrls": {
            "title": "Include attachment URLs",
            "type": "boolean",
            "description": "List public SAM attachment URLs on opportunity rows. Default off, for slimmer LLM-ready output. Files are never downloaded.",
            "default": false
          },
          "downloadAttachments": {
            "title": "Download attachments (ignored)",
            "type": "boolean",
            "description": "Accepted so saved rival inputs validate. This Actor does not download files."
          },
          "fetchDetails": {
            "title": "Fetch full details (ignored)",
            "type": "boolean",
            "description": "Accepted for compatibility. Official APIs already return the structured fields we publish (minus personal contacts)."
          },
          "includeDescription": {
            "title": "Include description text",
            "type": "boolean",
            "description": "On (default): include the public description with emails and phone numbers redacted. Off: leave the description empty.",
            "default": true
          },
          "sortBy": {
            "title": "Sort by (alias)",
            "type": "string",
            "description": "Accepted for compatibility. Awards are returned by amount (highest first); SAM uses the official API order."
          },
          "dataType": {
            "title": "Data type (alias)",
            "type": "string",
            "description": "Accepted so jungle_synthesizer inputs validate. Only opportunities (joined with awards) are supported; exclusions, wage determinations and assistance listings are ignored."
          },
          "sp_intended_usage": {
            "title": "Intended usage (ignored)",
            "type": "string",
            "description": "Accepted so jungle_synthesizer inputs validate. Not stored or used."
          },
          "sp_improvement_suggestions": {
            "title": "Improvement suggestions (ignored)",
            "type": "string",
            "description": "Accepted so jungle_synthesizer inputs validate. Not stored or used."
          },
          "sp_contact": {
            "title": "Contact email (ignored)",
            "type": "string",
            "description": "Accepted so jungle_synthesizer inputs validate. Not stored or used."
          },
          "onlyNew": {
            "title": "Monitor mode (ignored)",
            "type": "boolean",
            "description": "Accepted so fortuitous_pirate inputs validate. Monitor state is not implemented in this version."
          },
          "monitorId": {
            "title": "Monitor ID (ignored)",
            "type": "string",
            "description": "Accepted so fortuitous_pirate inputs validate."
          },
          "firstRunMode": {
            "title": "First run mode (ignored)",
            "type": "string",
            "description": "Accepted so fortuitous_pirate inputs validate."
          },
          "webhookUrl": {
            "title": "Webhook URL (ignored)",
            "type": "string",
            "description": "Accepted so fortuitous_pirate inputs validate. This Actor does not POST to webhooks."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}