{
  "openapi": "3.0.1",
  "info": {
    "title": "California CSLB Contractor License Scraper",
    "description": "Scrape California Contractors State License Board (CSLB) public records. Search by license number, business name, personnel name, or ZIP/city. Returns full license details: status, classifications, bonds, workers comp, disciplinary actions, personnel, address, phone.",
    "version": "1.0",
    "x-build-id": "TZcblSdWa4ee2ob3X"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/muhammadafzal~cslb-california-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-muhammadafzal-cslb-california-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/muhammadafzal~cslb-california-scraper/runs": {
      "post": {
        "operationId": "runs-sync-muhammadafzal-cslb-california-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/muhammadafzal~cslb-california-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-muhammadafzal-cslb-california-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": {
          "licenseNumbers": {
            "title": "License Numbers",
            "type": "array",
            "description": "Look up specific CSLB license numbers (e.g. '1000001', '812345'). Fastest search method — direct single-record lookup, no pagination. Use this field when the user provides exact license numbers or a list of licenses to verify. Do NOT use this when the user describes a trade, region, or company name — use businessName, personnelLastName, or zipCodes instead.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "businessName": {
            "title": "Business / Owner Name",
            "type": "string",
            "description": "Full or partial contractor business name. CSLB matches case-insensitively against the legal business name AND associated personnel/owner names — so 'Smith' returns both 'Smith Construction Co' (business) and 'Johnie Cement Work' (owned by John Smith). Use this when the user gives a company name. Returns up to 50 names per search; pagination is handled automatically. Do NOT use this for license-number lookups — use licenseNumbers instead."
          },
          "personnelLastName": {
            "title": "Personnel Last Name",
            "type": "string",
            "description": "Last name of an individual on a contractor license (owner, officer, or qualifier). Use this field together with personnelFirstName to search by person. Returns up to 100 names per search; pagination is handled automatically. Use this when the user provides a person's name rather than a company name. Do NOT use this for business-name searches — use businessName instead."
          },
          "personnelFirstName": {
            "title": "Personnel First Name",
            "type": "string",
            "description": "Optional first name to narrow a personnel-name search. Only applies when personnelLastName is set. Leave blank to search by last name only (returns more results)."
          },
          "zipCodes": {
            "title": "ZIP Codes",
            "type": "array",
            "description": "List of 5-digit California ZIP codes (e.g. '92101', '90012') to find licensed contractors in each area. Use this when the user wants contractors by region or for building territory-based lead lists. The CSLB ZIP search returns contractors registered in that ZIP. Combine with classification and status filters to narrow results. Do NOT use this for a single license lookup — use licenseNumbers instead.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "city": {
            "title": "City",
            "type": "string",
            "description": "Filter results to a specific California city (e.g. 'San Diego', 'Los Angeles'). Applied as a client-side filter on the business address city. Use this to narrow ZIP-code or business-name searches to one city. Not a standalone search mode — combine with zipCodes or businessName."
          },
          "classification": {
            "title": "License Classification",
            "type": "string",
            "description": "Filter results to a specific CSLB classification code. Common codes: 'A' (General Engineering), 'B' (General Building), 'C-10' (Electrical), 'C-36' (Plumbing), 'C-20' (HVAC), 'C-33' (Painting), 'C-39' (Roofing), 'C-27' (Landscaping). Leave blank for all classifications. See cslb.ca.gov for the full classification list."
          },
          "status": {
            "title": "License Status",
            "enum": [
              "any",
              "active",
              "expired",
              "suspended",
              "revoked",
              "canceled",
              "inactive"
            ],
            "type": "string",
            "description": "Filter results by current license status. 'Active' is the common choice for lead-generation and insurance use cases. 'Any' returns all records regardless of status.",
            "default": "any"
          },
          "maxResults": {
            "title": "Max Results",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Hard cap on records pushed to the dataset. Protects against accidental large runs — billing is per record pushed. Start low (10-50) to validate output quality before scaling up. Free users are limited to 100 results; paid users can request up to 1,000,000.",
            "default": 100
          },
          "customProxyUrl": {
            "title": "Custom Proxy URL",
            "type": "string",
            "description": "Optional premium residential proxy URL (e.g. 'http://user:pass@proxy.decodo.com:10000'). CSLB's edge (F5 BIG-IP) blocklists Apify's shared datacenter IPs and may throttle shared residential. For production runs, provide your own premium residential proxy (Decodo/Bright Data/IPRoyal) for maximum reliability. If left blank, the actor uses Apify residential proxy automatically."
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Apify proxy settings. Residential proxy is recommended — CSLB's F5 BIG-IP WAF blocklists datacenter IP pools, causing the search to silently return the empty form instead of results. Residential adds a fraction of a cent per record in proxy traffic, well within billing margin."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}