{
  "openapi": "3.0.1",
  "info": {
    "title": "California Pest Control Dca License Scraper",
    "version": "0.0",
    "x-build-id": "PH07H9NPOB12w7Oii"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/unique_dev~california-pest-control-dca-license-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-unique_dev-california-pest-control-dca-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/unique_dev~california-pest-control-dca-license-scraper/runs": {
      "post": {
        "operationId": "runs-sync-unique_dev-california-pest-control-dca-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/unique_dev~california-pest-control-dca-license-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-unique_dev-california-pest-control-dca-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": {
          "entity_scope": {
            "title": "Entity Scope (Companies vs. Individuals)",
            "enum": [
              "companies",
              "individuals",
              "both"
            ],
            "type": "string",
            "description": "Filter by DCA license entity type: 'companies' (Company Registrations PR & Branch Offices BR), 'individuals' (Licensed Operators OPR, Field Representatives FR, Registered Applicators RA), or 'both'.",
            "default": "companies"
          },
          "cities": {
            "title": "California Cities Filter",
            "type": "array",
            "description": "Optional list of California cities to filter licenses by (case-insensitive, e.g., ['Los Angeles', 'San Diego', 'Sacramento', 'San Jose']). Leave empty for all California cities.",
            "default": [
              "Los Angeles",
              "San Diego",
              "Sacramento",
              "San Jose"
            ],
            "items": {
              "type": "string"
            }
          },
          "counties": {
            "title": "California Counties Filter (Optional)",
            "type": "array",
            "description": "Optional list of California counties to filter licenses by (case-insensitive, e.g., ['Los Angeles', 'San Diego', 'Orange', 'Sacramento', 'Santa Clara']). Leave empty for all counties.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "statuses": {
            "title": "License Statuses Filter",
            "type": "array",
            "description": "License statuses to include (e.g., ['Clear', 'Active'], or include 'Inactive', 'Delinquent', 'Cancelled'). Note: DCA Public Information files report 'Clear'/'Active' licenses as 'Active', so selecting either matches active registrations.",
            "default": [
              "Clear",
              "Active"
            ],
            "items": {
              "type": "string"
            }
          },
          "minYearsInBusiness": {
            "title": "Minimum Years in Business (M&A / Established Filter)",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Minimum years since original DCA license issue date (0 for no minimum). Ideal for M&A, private equity, and business brokers targeting established pest control operators (e.g., 10+ or 20+ years in business).",
            "default": 0
          },
          "business_name_contains": {
            "title": "Business or Licensee Name Contains (Optional)",
            "type": "string",
            "description": "Optional case-insensitive substring filter matching company name (organization_name), DBA, or individual licensee name.",
            "default": ""
          },
          "enrichWebsiteAndEmails": {
            "title": "Enrich Website, Phone, Business Emails & Social Profiles (12 Workers)",
            "type": "boolean",
            "description": "When enabled (default), runs our 12-worker multi-engine discovery pipeline (Clearbit + Yahoo Search + live homepage/contact crawl with 4.0s timeout) to resolve each pest control company's official website, phone number, verified business emails, and social profiles (Facebook, Yelp, LinkedIn, Instagram).",
            "default": true
          },
          "mode": {
            "title": "Extraction Mode (Snapshot vs. Stateful Changes)",
            "enum": [
              "snapshot",
              "changes"
            ],
            "type": "string",
            "description": "Select 'snapshot' to emit all matching records, or 'changes' to compare against prior runs stored in the named Key-Value Store (state_key) and emit only new or updated licenses.",
            "default": "snapshot"
          },
          "state_key": {
            "title": "Key-Value Store State Key",
            "type": "string",
            "description": "Named Apify Key-Value Store used to persist license hashes keyed by source_id for stateful change tracking across runs.",
            "default": "CA-PEST-STATE"
          },
          "max_results": {
            "title": "Maximum Results",
            "minimum": 1,
            "maximum": 30000,
            "type": "integer",
            "description": "Maximum number of normalized California Structural Pest Control Board license records to output in a single run (up to 30,000).",
            "default": 20
          },
          "exclude_national_chains": {
            "title": "Exclude National Chains & PE Roll-Ups (Independent Businesses Only)",
            "type": "boolean",
            "description": "When enabled, excludes national pest control chains and private equity roll-ups (Orkin, Terminix, Rentokil, Western Exterminator, Rollins, Anticimex, Truly Nolen, Ecolab, Clark Pest Control, Dewey, HomeTeam, Aptive, Massey) so M&A brokers and B2B agencies only get independent founder-owned businesses.",
            "default": false
          },
          "min_licensed_technicians": {
            "title": "Minimum Licensed Technicians (OPR + FR + RA Headcount)",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Minimum number of active SPCB licensed technicians (Operators, Field Representatives, and Registered Applicators) linked to the company (0 for no minimum).",
            "default": 0
          },
          "expiring_within_days": {
            "title": "Expiring Within N Days (Optional Renewal / Compliance Filter)",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Optional filter to return only licenses expiring within the specified number of days from today (e.g., 90 or 180 days for insurance, bonding, and CE providers). Leave empty for all expiration dates."
          },
          "only_with_verified_email": {
            "title": "Only Output Records with Verified Email Address",
            "type": "boolean",
            "description": "When enabled, filters final output so only records with at least one verified email address are emitted.",
            "default": false
          },
          "webhook_url": {
            "title": "CRM / Automation Webhook URL (Clay, Make, n8n, GoHighLevel)",
            "type": "string",
            "description": "Optional HTTP(S) webhook URL. When provided, the Actor automatically POSTs the enriched dataset JSON payload to your Clay, Make, n8n, Zapier, or GoHighLevel webhook at the conclusion of the run.",
            "default": ""
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}