{
  "openapi": "3.0.1",
  "info": {
    "title": "SAM.gov & USAspending Contracts Scraper",
    "description": "SAM.gov and government contracts data in one place: search federal opportunities by keyword, NAICS, set-aside and agency, look up USAspending award history, and run a daily monitor with Slack or webhook alerts. From $1 per 1,000 opportunities.",
    "version": "0.1",
    "x-build-id": "hJh5lQHUSoSgHMrCp"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tiger19935~sam-gov-usaspending-contracts/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tiger19935-sam-gov-usaspending-contracts",
        "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/tiger19935~sam-gov-usaspending-contracts/runs": {
      "post": {
        "operationId": "runs-sync-tiger19935-sam-gov-usaspending-contracts",
        "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/tiger19935~sam-gov-usaspending-contracts/run-sync": {
      "post": {
        "operationId": "run-sync-tiger19935-sam-gov-usaspending-contracts",
        "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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "awards",
              "opportunities",
              "monitor"
            ],
            "type": "string",
            "description": "awards = USAspending award history (no key needed). opportunities = SAM.gov notices (needs a SAM.gov API key). monitor = SAM.gov notices that were not seen in earlier runs of the same monitor.",
            "default": "awards"
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Opportunities/monitor: matched against the notice title, one API request per keyword. Awards: matched against award text on USAspending. Leave empty to use only the other filters.",
            "items": {
              "type": "string"
            }
          },
          "naicsCodes": {
            "title": "NAICS codes",
            "type": "array",
            "description": "6-digit NAICS codes, for example 541511. Used by all modes.",
            "items": {
              "type": "string"
            }
          },
          "agencies": {
            "title": "Agencies",
            "type": "array",
            "description": "Opportunities/monitor: agency or department name fragment as SAM.gov writes it (for example DEPT OF DEFENSE). Awards: exact top-tier awarding agency name as on USAspending (for example Department of Defense).",
            "items": {
              "type": "string"
            }
          },
          "setAsides": {
            "title": "Set-aside codes",
            "type": "array",
            "description": "Opportunities/monitor only. SAM.gov set-aside codes such as SBA, 8A, HZC, SDVOSBC, WOSB, EDWOSB, VSA. One API request per code. Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "noticeTypes": {
            "title": "Notice types",
            "type": "array",
            "description": "Opportunities/monitor only. SAM.gov notice type codes: o solicitation, k combined synopsis/solicitation, p presolicitation, r sources sought, s special notice, a award notice, u justification, g surplus sale, i intent to bundle.",
            "default": [
              "o",
              "k",
              "p",
              "r",
              "s"
            ],
            "items": {
              "type": "string"
            }
          },
          "state": {
            "title": "Place of performance state",
            "type": "string",
            "description": "Opportunities/monitor only. Two-letter US state code, for example TX. Optional."
          },
          "recipientNames": {
            "title": "Recipient names (awards)",
            "type": "array",
            "description": "Awards only. Company names to look up on USAspending, for example Booz Allen Hamilton. Matches partial names.",
            "items": {
              "type": "string"
            }
          },
          "postedFrom": {
            "title": "Date from (YYYY-MM-DD)",
            "type": "string",
            "description": "Opportunities: posted from. Awards: action date from. Leave empty to use 'Days back'. SAM.gov allows a window of at most 1 year, longer windows are cut with a warning."
          },
          "postedTo": {
            "title": "Date to (YYYY-MM-DD)",
            "type": "string",
            "description": "Opportunities: posted to. Awards: action date to. Leave empty for today."
          },
          "daysBack": {
            "title": "Days back",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Used when 'Date from' is empty. Opportunities default 7 days, awards default 90 days. In monitor mode this is the look-back of the first run only."
          },
          "responseDeadlineFrom": {
            "title": "Response deadline from (YYYY-MM-DD)",
            "type": "string",
            "description": "Opportunities/monitor only. Keep notices that are due on or after this date."
          },
          "responseDeadlineTo": {
            "title": "Response deadline to (YYYY-MM-DD)",
            "type": "string",
            "description": "Opportunities/monitor only. Keep notices that are due on or before this date."
          },
          "minAwardAmount": {
            "title": "Minimum award amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Awards only. Skip awards below this value."
          },
          "maxAwardAmount": {
            "title": "Maximum award amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Awards only. Skip awards above this value."
          },
          "includeIncumbentAwards": {
            "title": "Add incumbent award history to opportunities",
            "type": "boolean",
            "description": "Opportunities/monitor only. For each opportunity NAICS code, attach the largest recent USAspending awards (who won before) into the field incumbentAwards. Matched by NAICS and, when the agency is recognised, by top-tier agency. Not billed separately.",
            "default": false
          },
          "incumbentYears": {
            "title": "Incumbent look-back (years)",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many years of USAspending history to search for incumbent awards.",
            "default": 3
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after this many billed records (opportunities and awards together). Free Apify plans are capped at 25 results.",
            "default": 20
          },
          "samApiKey": {
            "title": "SAM.gov API key",
            "type": "string",
            "description": "Free key from sam.gov (Account Details > Public API Key). Needed for opportunities and monitor modes. Not needed for awards. Free non-federal keys have a small daily request quota (about 10 per day without a role, 1,000 with one)."
          },
          "stateStoreName": {
            "title": "Monitor state store name",
            "type": "string",
            "description": "Monitor mode: name of the named key-value store that remembers already seen notices. Keep it the same between scheduled runs.",
            "default": "sam-gov-monitor-state"
          },
          "monitorName": {
            "title": "Monitor name",
            "type": "string",
            "description": "Monitor mode: state key. Use a different name for each saved Task so alerts do not mix.",
            "default": "default"
          },
          "notifyWebhookUrl": {
            "title": "Alert webhook URL",
            "type": "string",
            "description": "Monitor mode: POST new notices to this URL (Slack incoming webhook, Make, Zapier, n8n). Leave empty to skip."
          },
          "notifyFormat": {
            "title": "Alert format",
            "enum": [
              "slack",
              "json"
            ],
            "type": "string",
            "description": "slack = {\"text\": ...} message. json = full list of new notices as JSON.",
            "default": "slack"
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Both sources are official public APIs and do not block normal use, so the proxy is off by default. Turn on Apify Proxy only if you see repeated 403 or 429 errors.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}