{
  "openapi": "3.0.1",
  "info": {
    "title": "SAM.gov Federal Contract Opportunities & Attachments",
    "description": "Scrape public U.S. federal contract opportunities from SAM.gov: solicitations, awards, sources sought, agency and contact details, the full solicitation text, and the solicitation documents themselves. No API key, no login, no session cookies.",
    "version": "0.1",
    "x-build-id": "Sfi2tWG5TNMqvN2XO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/oswaldocarabano~sam-gov-data-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-oswaldocarabano-sam-gov-data-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/oswaldocarabano~sam-gov-data-scraper/runs": {
      "post": {
        "operationId": "runs-sync-oswaldocarabano-sam-gov-data-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/oswaldocarabano~sam-gov-data-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-oswaldocarabano-sam-gov-data-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": {
          "maxResults": {
            "title": "Maximum notices",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "How many contract notices to return. You are charged per notice delivered, never for duplicates and never for error rows. Hard cap: 50,000 per run.",
            "default": 100
          },
          "activeOnly": {
            "title": "Only active notices",
            "type": "boolean",
            "description": "Active notices are the ones still open or recently awarded: about 49,700 of them. Turn this off to reach the full archive of 5.6 million notices going back to 2000.",
            "default": true
          },
          "publishedWithinDays": {
            "title": "Published within the last N days",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "How far back to sweep, counting from today. Ignored if you set explicit dates below. About 2,500 notices are published per calendar day.",
            "default": 7
          },
          "publishedFrom": {
            "title": "Published from (YYYY-MM-DD)",
            "type": "string",
            "description": "Start of the publication date range, inclusive. Leave empty to use the day count above.",
            "default": ""
          },
          "publishedTo": {
            "title": "Published to (YYYY-MM-DD)",
            "type": "string",
            "description": "End of the publication date range, exclusive. Leave empty to use today.",
            "default": ""
          },
          "keywords": {
            "title": "Keywords",
            "type": "string",
            "description": "Free-text search across the notice title and description. Wrap a phrase in double quotes to match it exactly.",
            "default": ""
          },
          "noticeTypes": {
            "title": "Notice types",
            "type": "array",
            "description": "Which kinds of notice to return. Solicitations and combined synopsis/solicitations are the ones that carry the solicitation documents; award notices almost never do.",
            "items": {
              "type": "string",
              "enum": [
                "k",
                "o",
                "p",
                "r",
                "a",
                "s",
                "u",
                "g",
                "i"
              ],
              "enumTitles": [
                "k — Combined Synopsis/Solicitation",
                "o — Solicitation",
                "p — Presolicitation",
                "r — Sources Sought",
                "a — Award Notice",
                "s — Special Notice",
                "u — Justification",
                "g — Sale of Surplus Property",
                "i — Consolidate/Bundle"
              ]
            },
            "default": []
          },
          "naicsCodes": {
            "title": "NAICS codes",
            "type": "array",
            "description": "Limit to these NAICS industry codes, for example 541511 for custom computer programming. Present on 96% of notices.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "pscCodes": {
            "title": "PSC codes",
            "type": "array",
            "description": "Limit to these Product Service Codes, for example R425. Present on 98% of notices.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "setAsideCodes": {
            "title": "Set-aside codes",
            "type": "array",
            "description": "Limit to notices reserved for a small business category, for example SBA, 8A, WOSB, SDVOSBC or HZC. A set-aside code is present on 46% of notices.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "agencyIds": {
            "title": "Agency IDs",
            "type": "array",
            "description": "Limit to these agencies by SAM.gov organization ID. Useful ones: 100000000 Department of Defense, 100006688 General Services Administration, 100006568 Veterans Affairs, 100011942 Homeland Security.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "placeOfPerformanceStates": {
            "title": "Place of performance states",
            "type": "array",
            "description": "Two-letter U.S. state codes for where the work is performed. Note that only about a third of notices state a place of performance.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "officeStates": {
            "title": "Contracting office states",
            "type": "array",
            "description": "Two-letter U.S. state codes for the contracting office that issued the notice. Better filled in than place of performance.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "scrapeAttachments": {
            "title": "Also fetch solicitation documents",
            "type": "boolean",
            "description": "Adds the attachment list to every notice: file name, size, MIME type and a stable download URL. This costs one extra request per notice, so a run takes noticeably longer. Measured on a stratified sample: 37% of active notices carry at least one downloadable file — 49% of solicitations, 39% of combined synopsis/solicitations, 14% of award notices. It also varies by agency: near 100% for Veterans Affairs, about 28% for the Department of Defense, which posts many documents on its own portals. Those come back as a link instead, clearly marked.",
            "default": false
          },
          "maxExclusions": {
            "title": "Maximum exclusion records",
            "minimum": 0,
            "maximum": 50000,
            "type": "integer",
            "description": "Also fetch the federal exclusion list (debarment records) into a separate dataset. Set to 0 to skip. Note that 63% of the list is individuals and only a fifth of those carry a UEI, so records cannot be reliably matched to a vendor by name alone.",
            "default": 0
          },
          "maxCacheAgeDays": {
            "title": "Maximum cache age (days)",
            "minimum": 0,
            "maximum": 365,
            "type": "integer",
            "description": "Accept cached notices up to this many days old. SAM.gov notices are immutable once published, so a cached row stays correct; set to 0 to force a fresh fetch anyway. Every row tells you which it was through from_cache and data_age_hours.",
            "default": 90
          },
          "maxConcurrency": {
            "title": "Maximum concurrency",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "How many requests to run in parallel. The default of 4 is deliberately polite: SAM.gov is public infrastructure paid for by taxpayers.",
            "default": 4
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}