{
  "openapi": "3.0.1",
  "info": {
    "title": "US Cannabis License Leads Scraper (Official State Data)",
    "description": "Scrape US cannabis license leads from official state regulators (CA, NY, CT, WA): license type & status, owner, email, phone, website, social-equity designation, license dates, geo & lead score. Full supply chain + monitor mode.",
    "version": "0.1",
    "x-build-id": "Afm0L6P3GlrZWuoEq"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapesage~us-cannabis-license-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapesage-us-cannabis-license-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~us-cannabis-license-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapesage-us-cannabis-license-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~us-cannabis-license-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapesage-us-cannabis-license-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": {
          "states": {
            "title": "States",
            "type": "array",
            "description": "Two-letter state codes to include. Available official-registry states: <code>CA</code> (DCC), <code>NY</code> (OCM), <code>CT</code> (DCP), <code>WA</code> (LCB). Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "licenseCategories": {
            "title": "License categories (supply-chain stage)",
            "type": "array",
            "description": "Filter by normalized supply-chain stage: <code>Retail</code>, <code>Retail - Non-Storefront / Delivery</code>, <code>Cultivation</code>, <code>Manufacturing</code>, <code>Distribution</code>, <code>Testing Laboratory</code>, <code>Microbusiness</code>, <code>Event Organizer</code>, <code>Vertically Integrated</code>, <code>Other</code>. Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "licenseTypes": {
            "title": "License types (exact, contains-match)",
            "type": "array",
            "description": "Optional native license-type filter (case-insensitive contains), e.g. <code>Retailer</code>, <code>Cultivation</code>, <code>Manufacturer</code>, <code>Distributor</code>, <code>Microbusiness</code>, <code>Processor</code>.",
            "items": {
              "type": "string"
            }
          },
          "designations": {
            "title": "Designation (market)",
            "type": "array",
            "description": "Filter by market designation where the source provides it: <code>Adult-Use</code>, <code>Medicinal</code>. Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "activeOnly": {
            "title": "Active licenses only",
            "type": "boolean",
            "description": "Only include licenses with an active status (recommended for lead generation). Turn off to also see expired/surrendered/revoked/in-process licenses.",
            "default": true
          },
          "statuses": {
            "title": "License statuses (override)",
            "type": "array",
            "description": "Optional exact status filter (case-insensitive contains), e.g. <code>Active</code>, <code>Expired</code>, <code>Surrendered</code>, <code>Revoked</code>, <code>Suspended</code>, <code>In-Process</code>. Overrides \"Active licenses only\".",
            "items": {
              "type": "string"
            }
          },
          "socialEquityOnly": {
            "title": "Social-equity / diverse-owned only",
            "type": "boolean",
            "description": "Only include licenses flagged as social-equity, minority-owned, women-owned, veteran-owned, distressed-farmer or disproportionately-impacted (where the source provides it, e.g. NY).",
            "default": false
          },
          "hasEmail": {
            "title": "Has email",
            "type": "boolean",
            "description": "Only include licenses that have a business email (mainly CA).",
            "default": false
          },
          "hasPhone": {
            "title": "Has phone number",
            "type": "boolean",
            "description": "Only include licenses that have a phone number (CA, WA).",
            "default": false
          },
          "hasWebsite": {
            "title": "Has website",
            "type": "boolean",
            "description": "Only include licenses that have a website (CT).",
            "default": false
          },
          "hasNamedContact": {
            "title": "Has owner / named contact",
            "type": "boolean",
            "description": "Only include licenses with an owner or contact person name (CA, NY, WA).",
            "default": false
          },
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "Only include licenses whose city contains one of these (case-insensitive).",
            "items": {
              "type": "string"
            }
          },
          "counties": {
            "title": "Counties",
            "type": "array",
            "description": "Only include licenses whose county contains one of these (case-insensitive).",
            "items": {
              "type": "string"
            }
          },
          "zipCodes": {
            "title": "ZIP code prefixes",
            "type": "array",
            "description": "Only include licenses whose ZIP starts with one of these prefixes (e.g. <code>900</code>, <code>112</code>).",
            "items": {
              "type": "string"
            }
          },
          "nameQuery": {
            "title": "Name contains",
            "type": "string",
            "description": "Only include licenses whose business name, DBA or owner contains this text (case-insensitive). Great for tracking a specific operator/chain."
          },
          "issuedAfter": {
            "title": "Issued/effective on or after",
            "type": "string",
            "description": "Only include licenses issued/effective on or after this date (YYYY-MM-DD). Surfaces newly-licensed cannabis businesses."
          },
          "newLicenseWithinDays": {
            "title": "New license within (days)",
            "minimum": 1,
            "type": "integer",
            "description": "Only include licenses issued within this many days — a fresh-business / first-mover signal."
          },
          "expiringWithinDays": {
            "title": "License expiring within (days)",
            "minimum": 1,
            "type": "integer",
            "description": "Only include licenses expiring within this many days — a renewal / decision-window signal (where the source provides expiration dates: CA, NY)."
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "leadScore",
              "recency",
              "expiringSoon",
              "name"
            ],
            "type": "string",
            "description": "Order of the output records.",
            "default": "leadScore"
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of cannabis license lead records to output.",
            "default": 1000
          },
          "maxResultsPerState": {
            "title": "Max results per state",
            "minimum": 1,
            "type": "integer",
            "description": "Optional cap on records per state (useful to balance a multi-state pull)."
          },
          "includeRawFields": {
            "title": "Include raw source fields",
            "type": "boolean",
            "description": "Attach the full original registry row to each record under <code>sourceFields</code> (richest possible dataset).",
            "default": true
          },
          "monitorMode": {
            "title": "Monitor mode (only new / changed)",
            "type": "boolean",
            "description": "Only output licenses that are NEW or CHANGED since the last run with the same Monitor key. Pairs perfectly with Apify Schedules to build a fresh-leads feed.",
            "default": false
          },
          "monitorKey": {
            "title": "Monitor key",
            "type": "string",
            "description": "Names the saved monitor state. Use one key per saved search so different schedules don't overwrite each other.",
            "default": "default"
          },
          "deduplicateResults": {
            "title": "Deduplicate results",
            "type": "boolean",
            "description": "Drop duplicate licenses within a run (recommended).",
            "default": true
          },
          "socrataAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Optional Socrata app token to raise rate limits on the NY/CT/WA registries. Not required — the registries are keyless."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings. Not needed — these government registries and the CA DCC API are reachable directly. Leave proxy off for the cheapest, fastest runs.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}