{
  "openapi": "3.0.1",
  "info": {
    "title": "SAM.gov Contracts Scraper",
    "description": "Scrape government contract opportunities, entity registrations, and award data from SAM.gov. Search by keyword, NAICS code, set-aside type, agency, date range, and more. Uses the official SAM.gov public API.",
    "version": "1.0",
    "x-build-id": "Tjf07aoV4bT8cEKGB"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/magicfingers~sam-gov-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-magicfingers-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/magicfingers~sam-gov-scraper/runs": {
      "post": {
        "operationId": "runs-sync-magicfingers-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/magicfingers~sam-gov-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-magicfingers-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": {
          "scrapeMode": {
            "title": "Scrape Mode",
            "enum": [
              "opportunities",
              "entities",
              "awards"
            ],
            "type": "string",
            "description": "Choose what type of data to scrape from SAM.gov.",
            "default": "opportunities"
          },
          "apiKey": {
            "title": "SAM.gov API Key",
            "type": "string",
            "description": "Your SAM.gov public API key. Get one free at https://sam.gov/content/entity-information. Required for entity searches; optional for opportunities (falls back to web scraping)."
          },
          "keyword": {
            "title": "Search Keyword",
            "type": "string",
            "description": "Search term to find in opportunity titles, descriptions, or entity names. Examples: 'cybersecurity', 'construction services', 'IT support'."
          },
          "solicitationNumber": {
            "title": "Solicitation Number",
            "type": "string",
            "description": "Specific solicitation number to search for. Example: 'W911NF-23-R-0001'."
          },
          "naicsCode": {
            "title": "NAICS Code",
            "type": "string",
            "description": "North American Industry Classification System code to filter by. Examples: '541512' (Computer Systems Design), '236220' (Commercial Building Construction), '541330' (Engineering Services)."
          },
          "setAsideType": {
            "title": "Set-Aside Type",
            "enum": [
              "",
              "SBA",
              "8A",
              "8AN",
              "HZC",
              "HZS",
              "SDVOSBC",
              "SDVOSBS",
              "WOSB",
              "EDWOSB",
              "VSA",
              "VSB",
              "LAS",
              "IEE",
              "BI",
              "SBP"
            ],
            "type": "string",
            "description": "Filter by small business set-aside category.",
            "default": ""
          },
          "noticeType": {
            "title": "Notice Type",
            "enum": [
              "",
              "o",
              "p",
              "k",
              "r",
              "g",
              "s",
              "i",
              "a",
              "u"
            ],
            "type": "string",
            "description": "Filter by type of notice (opportunities mode only).",
            "default": ""
          },
          "postedFrom": {
            "title": "Posted Date From",
            "type": "string",
            "description": "Start of posting date range. Format: MM/DD/YYYY. Example: '01/01/2024'."
          },
          "postedTo": {
            "title": "Posted Date To",
            "type": "string",
            "description": "End of posting date range. Format: MM/DD/YYYY. Example: '12/31/2024'."
          },
          "responseDeadlineFrom": {
            "title": "Response Deadline From",
            "type": "string",
            "description": "Filter opportunities with response deadline after this date. Format: MM/DD/YYYY."
          },
          "responseDeadlineTo": {
            "title": "Response Deadline To",
            "type": "string",
            "description": "Filter opportunities with response deadline before this date. Format: MM/DD/YYYY."
          },
          "agency": {
            "title": "Agency / Organization ID",
            "type": "string",
            "description": "Filter by federal agency. Use the agency's organization ID or AAC code. Example: '100006688' (Department of Defense)."
          },
          "placeOfPerformanceState": {
            "title": "Place of Performance (State)",
            "type": "string",
            "description": "Two-letter state code for place of performance. Example: 'VA' for Virginia."
          },
          "placeOfPerformanceZip": {
            "title": "Place of Performance (ZIP)",
            "type": "string",
            "description": "ZIP code for place of performance filtering."
          },
          "classificationCode": {
            "title": "Product/Service Code (PSC)",
            "type": "string",
            "description": "Filter by product/service classification code. Example: 'D306' (IT and Telecom Systems Development)."
          },
          "entityRegistrationStatus": {
            "title": "Entity Registration Status",
            "enum": [
              "A",
              "E"
            ],
            "type": "string",
            "description": "Filter entity registrations by status (entities mode only).",
            "default": "A"
          },
          "entityBusinessType": {
            "title": "Entity Business Type Code",
            "type": "string",
            "description": "Filter entities by business type code (entities mode only). Examples: '2X' (For-Profit), '23' (Minority Owned), 'A2' (Woman Owned)."
          },
          "maxResults": {
            "title": "Maximum Results",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum number of results to return. Set to 0 for unlimited. The scraper handles pagination automatically.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Proxy settings for web scraping fallback. Not needed for API requests.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}