{
  "openapi": "3.0.1",
  "info": {
    "title": "US Tobacco, Vape & Smoke Shop Retailer Leads Scraper",
    "description": "Scrape US tobacco, vape & smoke-shop leads from official state & city license registries (TX, NY, NYC, PA, CO, MO): name, DBA, address, product types, vape/e-cig flag, distributor & wholesaler roles, license type, new-permit & expiration signals + lead score. Filter & monitor new licenses.",
    "version": "0.1",
    "x-build-id": "cvHA6GX3TGIjpwHhj"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapesage~us-tobacco-vape-retailer-leads/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapesage-us-tobacco-vape-retailer-leads",
        "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~us-tobacco-vape-retailer-leads/runs": {
      "post": {
        "operationId": "runs-sync-scrapesage-us-tobacco-vape-retailer-leads",
        "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~us-tobacco-vape-retailer-leads/run-sync": {
      "post": {
        "operationId": "run-sync-scrapesage-us-tobacco-vape-retailer-leads",
        "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": {
          "states": {
            "title": "Jurisdictions",
            "uniqueItems": true,
            "type": "array",
            "description": "License registries to scrape. Allowed values: TX (Texas), NY (New York State), NYC (New York City DCWP), PA (Pennsylvania), CO (Colorado), MO (Missouri). Leave empty to scrape all available jurisdictions.",
            "items": {
              "type": "string"
            }
          },
          "businessRoles": {
            "title": "Business roles",
            "uniqueItems": true,
            "type": "array",
            "description": "Keep only these supply-chain roles. Allowed values: retailer, distributor, wholesaler, manufacturer, importer, stamping_agent, vending, itinerant, delivery. Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "productTypes": {
            "title": "Product types",
            "uniqueItems": true,
            "type": "array",
            "description": "Keep only businesses authorized for these products. Allowed values: cigarette, vape (e-cigarette / vapor), otp (other tobacco products — cigars, pipe, smokeless). Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "vapeOnly": {
            "title": "Vape / e-cigarette only",
            "type": "boolean",
            "description": "Keep only vape / e-cigarette retailers and vapor-product dealers (explicitly flagged in TX and NY). Ideal for vape distributors and disposable-vape brands.",
            "default": false
          },
          "retailersOnly": {
            "title": "Retailers only",
            "type": "boolean",
            "description": "Keep only retail storefronts (drops distributors, wholesalers and manufacturers).",
            "default": false
          },
          "distributorsOnly": {
            "title": "Distributors / wholesalers only",
            "type": "boolean",
            "description": "Keep only the supply chain — distributors, wholesalers, manufacturers and importers (drops retailers). Ideal for brands looking for placement partners.",
            "default": false
          },
          "cities": {
            "title": "Cities",
            "uniqueItems": true,
            "type": "array",
            "description": "Keep only businesses in these cities (case-insensitive exact match). Optional.",
            "items": {
              "type": "string"
            }
          },
          "counties": {
            "title": "Counties",
            "uniqueItems": true,
            "type": "array",
            "description": "Keep only businesses in these counties (case-insensitive, e.g. \"Harris\", \"Allegheny\"). Applies to TX and PA, which publish a county. Optional.",
            "items": {
              "type": "string"
            }
          },
          "zipCodes": {
            "title": "ZIP codes",
            "uniqueItems": true,
            "type": "array",
            "description": "Keep only businesses whose ZIP starts with any of these values (full ZIP or prefix, e.g. \"770\" or \"77002\"). Optional.",
            "items": {
              "type": "string"
            }
          },
          "nameQuery": {
            "title": "Business name contains",
            "type": "string",
            "description": "Keep only businesses whose name or DBA contains this text (case-insensitive), e.g. \"smoke\", \"vape\" or \"7-eleven\". Optional."
          },
          "permittedAfter": {
            "title": "Permitted after (YYYY-MM-DD)",
            "type": "string",
            "description": "Keep only businesses whose permit/license was issued on or after this date — a fresh feed of newly-licensed tobacco & vape stores. Applies where an issue date is published (TX, NYC)."
          },
          "newlyPermittedOnly": {
            "title": "Newly permitted only",
            "type": "boolean",
            "description": "Keep only businesses permitted within the last 180 days (new-business GTM signal).",
            "default": false
          },
          "expiringBefore": {
            "title": "License expiring before (YYYY-MM-DD)",
            "type": "string",
            "description": "Keep only licenses that expire on or before this date — renewal-timing leads. Applies where an expiration date is published (PA, CO)."
          },
          "expiringWithinDays": {
            "title": "License expiring within N days",
            "minimum": 1,
            "type": "integer",
            "description": "Keep only licenses expiring within this many days from today (renewal-timing leads). Applies to PA and CO. Optional."
          },
          "expiringSoonOnly": {
            "title": "Expiring soon only",
            "type": "boolean",
            "description": "Keep only licenses expiring within the next 120 days.",
            "default": false
          },
          "withPhoneOnly": {
            "title": "With phone only",
            "type": "boolean",
            "description": "Keep only businesses that publish a phone number (NYC DCWP records carry a phone).",
            "default": false
          },
          "withGeoOnly": {
            "title": "With coordinates only",
            "type": "boolean",
            "description": "Keep only businesses that have latitude/longitude coordinates (NY, NYC and PA publish geo).",
            "default": false
          },
          "minLeadScore": {
            "title": "Minimum lead score",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Keep only businesses with a lead score at or above this value (0-100)."
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "leadScore",
              "newest",
              "expiringSoon",
              "name",
              "state",
              "source"
            ],
            "type": "string",
            "description": "Order of the output.",
            "default": "leadScore"
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of business records to return across all selected jurisdictions.",
            "default": 1000
          },
          "maxResultsPerState": {
            "title": "Max results per jurisdiction",
            "minimum": 1,
            "type": "integer",
            "description": "Optional cap on the number of records returned from each jurisdiction (useful for balanced multi-state pulls). Leave empty for no per-jurisdiction cap."
          },
          "deduplicateResults": {
            "title": "Deduplicate",
            "type": "boolean",
            "description": "Drop duplicate businesses that share the same license number / name / address within a jurisdiction.",
            "default": true
          },
          "includeRawFields": {
            "title": "Include raw source fields",
            "type": "boolean",
            "description": "Attach the raw source row under sourceFields on each record.",
            "default": true
          },
          "monitorMode": {
            "title": "Monitoring mode (only new / changed)",
            "type": "boolean",
            "description": "Only return businesses that are new or whose name, address, license type, license number or dates changed since the last run with the same monitor key. Ideal on a Schedule to capture newly-licensed tobacco & vape stores as fresh leads. Works alongside Apify Schedules — the schedule triggers the run, this flag controls what is emitted.",
            "default": false
          },
          "monitorKey": {
            "title": "Monitor key",
            "type": "string",
            "description": "Namespace for monitoring mode so independent monitors don't collide. Use a distinct key per saved configuration.",
            "default": "default"
          },
          "socrataAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Optional Socrata App Token to raise open-data rate limits on very large scheduled pulls. Not required — leave blank for normal use."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. These Socrata open-data APIs need no proxy, so leave this off for the fastest queries.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}