{
  "openapi": "3.0.1",
  "info": {
    "title": "GSA eLibrary Scraper - Government Contractors & B2B Leads",
    "description": "Scrape GSA eLibrary Schedule contractors by SIN, category or keyword: name, phone, email, website, address, SAM UEI, NAICS, set-aside status, contracts & a lead score. Filter by state & set-aside type. Monitor mode returns only new contractors. No login, no browser.",
    "version": "1.0",
    "x-build-id": "T5GobCFu3ATutUGnN"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapesage~gsa-elibrary-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapesage-gsa-elibrary-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/scrapesage~gsa-elibrary-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapesage-gsa-elibrary-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/scrapesage~gsa-elibrary-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapesage-gsa-elibrary-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": {
          "searchQueries": {
            "title": "Search queries (keywords)",
            "type": "array",
            "description": "Keywords to search GSA eLibrary (e.g. \"cybersecurity\", \"janitorial\", \"office furniture\"). The actor finds the matching categories (SINs) and pulls the contractors awarded under them, plus any contractor whose name matches the keyword.",
            "items": {
              "type": "string"
            }
          },
          "sins": {
            "title": "SINs / category codes",
            "type": "array",
            "description": "Exact GSA Special Item Numbers (SINs) to browse, e.g. \"54151S\" (IT Professional Services), \"561210FAC\" (Facilities Maintenance), \"518210C\" (Cloud). Returns every contractor awarded under each SIN. Find SIN codes on a category page or via a keyword search.",
            "items": {
              "type": "string"
            }
          },
          "schedule": {
            "title": "Schedule number (for SINs)",
            "type": "string",
            "description": "The GSA Schedule the SINs belong to. Almost everything lives under the consolidated Multiple Award Schedule (MAS). Only change this for legacy/special programs (e.g. OASIS+, 8ASTARS3).",
            "default": "MAS"
          },
          "contractNumbers": {
            "title": "Contract numbers (direct)",
            "type": "array",
            "description": "Look up specific contractors by contract number. Best results: use the format \"CONTRACT#|Exact Contractor Name\" (e.g. \"47QTCA19D00AQ|1 SOURCE CONSULTING, INC.\"). A bare contract number will be resolved via search when possible.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Paste GSA eLibrary URLs directly — contractor pages (contractorInfo.do), category/SIN pages (sinDetails.do), schedule pages (scheduleSummary.do) or search results (searchResults.do). Auto-routed by type.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "states": {
            "title": "Filter by state",
            "type": "array",
            "description": "Keep only contractors located in these US states/territories (2-letter codes, e.g. TX, CA, VA, DC). Leave empty for all states.",
            "items": {
              "type": "string"
            }
          },
          "socioEconomic": {
            "title": "Filter by set-aside / socio-economic type",
            "type": "array",
            "description": "Keep only contractors with these set-aside / socio-economic designations. Most accurate with \"Include contractor details\" on (default).",
            "items": {
              "type": "string",
              "enum": [
                "smallBusiness",
                "womenOwned",
                "veteranOwned",
                "serviceDisabledVeteranOwned",
                "eightA",
                "hubZone",
                "disadvantaged",
                "tribalNativeOwned"
              ],
              "enumTitles": [
                "Small Business",
                "Women-Owned",
                "Veteran-Owned",
                "Service-Disabled Veteran-Owned (SDVOSB)",
                "8(a) Firm",
                "HUBZone",
                "Small Disadvantaged Business",
                "Tribal / Native-Owned"
              ]
            }
          },
          "includeContractorDetails": {
            "title": "Include contractor details",
            "type": "boolean",
            "description": "Open each contractor's profile to add business email, website, full address, SAM UEI, NAICS codes, spelled-out set-aside certifications, every contract with SINs and end dates, GSA Advantage catalog links and the government POC. Turn off for a faster, cheaper list (name, contract #, phone, city/state, set-aside codes only).",
            "default": true
          },
          "enrichContactEmails": {
            "title": "Enrich contacts from contractor website",
            "type": "boolean",
            "description": "Visit each contractor's own website (home + contact/about, max 3 pages) and extract additional contact emails, phone numbers and social profiles. Only runs for contractors that publish a website.",
            "default": false
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of contractor records to output across the whole run. Defaults to 100. Set 0 for no limit (the run still self-terminates safely before the run timeout — raise the timeout and/or narrow scope with SINs/filters for very large pulls).",
            "default": 100
          },
          "maxContractorsPerSin": {
            "title": "Max contractors per SIN/query",
            "minimum": 1,
            "type": "integer",
            "description": "Cap how many contractors to take from each SIN or search query (large IT/services SINs can list thousands).",
            "default": 500
          },
          "maxSinsPerQuery": {
            "title": "Max SINs per keyword query",
            "minimum": 1,
            "type": "integer",
            "description": "For keyword searches, how many of the matching categories (SINs) to expand into contractors.",
            "default": 5
          },
          "searchType": {
            "title": "Keyword match type",
            "enum": [
              "allWords",
              "anyWords",
              "exactPhrase"
            ],
            "type": "string",
            "description": "How keyword searches are matched against the GSA catalog.",
            "default": "allWords"
          },
          "deduplicateContractors": {
            "title": "Deduplicate contractors",
            "type": "boolean",
            "description": "Output each contractor only once per run, even if they appear under multiple SINs or searches (deduplicated by contract number / SAM UEI).",
            "default": true
          },
          "monitorMode": {
            "title": "Monitor mode (only new contractors)",
            "type": "boolean",
            "description": "Remember contractors seen in previous runs and output only NEW ones — a fresh feed of newly awarded GSA Schedule holders. Works alongside Apify Schedules; it does not replace them.",
            "default": false
          },
          "monitorKey": {
            "title": "Monitor key",
            "type": "string",
            "description": "Namespace for monitor mode memory. Use a distinct key per saved search (e.g. \"cyber-tx\") so different monitors don't share state.",
            "default": "default"
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify Proxy. Datacenter (default) is fast and reliable for GSA eLibrary; the actor automatically rotates sessions and falls back to residential if a request is blocked.",
            "default": {
              "useApifyProxy": true
            }
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Maximum parallel requests. Lower it if you hit timeouts.",
            "default": 6
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}