{
  "openapi": "3.0.1",
  "info": {
    "title": "CSLB California Contractor License Search – New License Leads",
    "description": "California contractor licences from the official CSLB Data Portal lists: business name, type, address, county, phone, classifications, issue and expiry dates, optional bond and workers' comp. New-licence leads by issue date, county and ZIP filters. $1 per 1,000 licences.",
    "version": "0.1",
    "x-build-id": "Akdwl4MLDeuGNAcG7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gazidev~california-contractor-leads/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gazidev-california-contractor-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/gazidev~california-contractor-leads/runs": {
      "post": {
        "operationId": "runs-sync-gazidev-california-contractor-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/gazidev~california-contractor-leads/run-sync": {
      "post": {
        "operationId": "run-sync-gazidev-california-contractor-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": {
          "classifications": {
            "title": "CSLB classifications",
            "type": "array",
            "description": "Licence classifications to download from the CSLB Data Portal (one official list file each). A licence with several classes is returned once. `ALL` downloads all 78 lists (statewide, several minutes, needs 1-2 GB memory without a max-items cap).",
            "items": {
              "type": "string",
              "enum": [
                "ALL",
                "A",
                "B",
                "B-2",
                "C-2",
                "C-4",
                "C-5",
                "C-6",
                "C-7",
                "C-8",
                "C-9",
                "C-10",
                "C-11",
                "C-12",
                "C-13",
                "C-15",
                "C-16",
                "C-17",
                "C-20",
                "C-21",
                "C-22",
                "C-23",
                "C-27",
                "C-28",
                "C-29",
                "C-31",
                "C-32",
                "C-33",
                "C-34",
                "C-35",
                "C-36",
                "C-38",
                "C-39",
                "C-42",
                "C-43",
                "C-45",
                "C-46",
                "C-47",
                "C-49",
                "C-50",
                "C-51",
                "C-53",
                "C-54",
                "C-55",
                "C-57",
                "C-60",
                "C-61",
                "C-61/D-3",
                "C-61/D-4",
                "C-61/D-6",
                "C-61/D-9",
                "C-61/D-10",
                "C-61/D-12",
                "C-61/D-16",
                "C-61/D-21",
                "C-61/D-24",
                "C-61/D-28",
                "C-61/D-29",
                "C-61/D-30",
                "C-61/D-31",
                "C-61/D-34",
                "C-61/D-35",
                "C-61/D-38",
                "C-61/D-39",
                "C-61/D-40",
                "C-61/D-41",
                "C-61/D-42",
                "C-61/D-49",
                "C-61/D-50",
                "C-61/D-52",
                "C-61/D-53",
                "C-61/D-56",
                "C-61/D-59",
                "C-61/D-62",
                "C-61/D-63",
                "C-61/D-64",
                "C-61/D-65",
                "ASB",
                "HAZ"
              ],
              "enumTitles": [
                "ALL - every classification (78 downloads)",
                "A - General Engineering Contractor",
                "B - General Building Contractor",
                "B-2 - Residential Remodeling Contractor",
                "C-2 - Insulation and Acoustical",
                "C-4 - Boiler, Hot Water Heating and Steam Fitting",
                "C-5 - Framing and Rough Carpentry",
                "C-6 - Cabinet, Millwork and Finish Carpentry",
                "C-7 - Low Voltage Systems",
                "C-8 - Concrete",
                "C-9 - Drywall",
                "C-10 - Electrical",
                "C-11 - Elevator",
                "C-12 - Earthwork and Paving",
                "C-13 - Fencing",
                "C-15 - Flooring and Floor Covering",
                "C-16 - Fire Protection",
                "C-17 - Glazing",
                "C-20 - Warm-Air Heating, Ventilating and Air-Conditioning (HVAC)",
                "C-21 - Building Moving/Demolition",
                "C-22 - Asbestos Abatement",
                "C-23 - Ornamental Metal",
                "C-27 - Landscaping",
                "C-28 - Lock and Security Equipment",
                "C-29 - Masonry",
                "C-31 - Construction Zone Traffic Control",
                "C-32 - Parking and Highway Improvement",
                "C-33 - Painting and Decorating",
                "C-34 - Pipeline",
                "C-35 - Lathing and Plastering",
                "C-36 - Plumbing",
                "C-38 - Refrigeration",
                "C-39 - Roofing",
                "C-42 - Sanitation System",
                "C-43 - Sheet Metal",
                "C-45 - Sign",
                "C-46 - Solar",
                "C-47 - General Manufactured Housing",
                "C-49 - Tree and Palm",
                "C-50 - Reinforcing Steel",
                "C-51 - Structural Steel",
                "C-53 - Swimming Pool",
                "C-54 - Ceramic and Mosaic Tile",
                "C-55 - Water Conditioning",
                "C-57 - Well Drilling",
                "C-60 - Welding",
                "C-61 - Limited Specialty",
                "C-61/D-3 - Awnings",
                "C-61/D-4 - Central Vacuum Systems",
                "C-61/D-6 - Concrete-Related Services",
                "C-61/D-9 - Drilling, Blasting and Oil Field Work",
                "C-61/D-10 - Elevated Floors",
                "C-61/D-12 - Synthetic Products",
                "C-61/D-16 - Hardware, Locks and Safes",
                "C-61/D-21 - Machinery and Pumps",
                "C-61/D-24 - Metal Products",
                "C-61/D-28 - Doors, Gates and Activating Devices",
                "C-61/D-29 - Paperhanging",
                "C-61/D-30 - Pile Driving and Pressure Foundation Jacking",
                "C-61/D-31 - Pole Installation and Maintenance",
                "C-61/D-34 - Prefabricated Equipment",
                "C-61/D-35 - Pool and Spa Maintenance",
                "C-61/D-38 - Sand and Water Blasting",
                "C-61/D-39 - Scaffolding",
                "C-61/D-40 - Service Station Equipment and Maintenance",
                "C-61/D-41 - Siding and Decking",
                "C-61/D-42 - Non-Electrical Sign Installation",
                "C-61/D-49 - Tree Service",
                "C-61/D-50 - Suspended Ceilings",
                "C-61/D-52 - Window Coverings",
                "C-61/D-53 - Wood Tanks",
                "C-61/D-56 - Trenching Only",
                "C-61/D-59 - Hydroseed Spraying",
                "C-61/D-62 - Air and Water Balancing",
                "C-61/D-63 - Construction Clean-up",
                "C-61/D-64 - Non-specialized",
                "C-61/D-65 - Weatherization and Energy Conservation",
                "ASB - Asbestos Certification",
                "HAZ - Hazardous Substance Removal Certification"
              ]
            },
            "default": [
              "C-12"
            ]
          },
          "issuedWithinDays": {
            "title": "Issued within the last N days (new-licence leads)",
            "minimum": 0,
            "type": "integer",
            "description": "Only licences whose CSLB issue date is within the last N days, e.g. 30. 0 = no limit."
          },
          "issuedAfter": {
            "title": "Issued on or after (YYYY-MM-DD)",
            "type": "string",
            "description": "Alternative to the field above. Overrides it when set."
          },
          "counties": {
            "title": "Counties",
            "type": "array",
            "description": "California counties to keep, e.g. Los Angeles, San Diego (\"County\" is optional). Empty = statewide.",
            "items": {
              "type": "string"
            }
          },
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "Cities to keep (exact name, case-insensitive).",
            "items": {
              "type": "string"
            }
          },
          "zipCodes": {
            "title": "ZIP codes or prefixes",
            "type": "array",
            "description": "Keep licences whose ZIP starts with any of these, e.g. 92 or 94103.",
            "items": {
              "type": "string"
            }
          },
          "businessTypes": {
            "title": "Business types",
            "type": "array",
            "description": "Empty = all.",
            "items": {
              "type": "string",
              "enum": [
                "Corporation",
                "Sole Owner",
                "Limited Liability",
                "Partnership",
                "JointVenture"
              ],
              "enumTitles": [
                "Corporation",
                "Sole owner",
                "Limited liability (LLC)",
                "Partnership",
                "Joint venture"
              ]
            }
          },
          "nameContains": {
            "title": "Business name contains",
            "type": "string",
            "description": "Case-insensitive text filter on the business name."
          },
          "onlyWithPhone": {
            "title": "Only licences with a phone number",
            "type": "boolean",
            "description": "Skip rows without a valid 10-digit phone (free).",
            "default": false
          },
          "expiringWithinDays": {
            "title": "Licence expires within N days",
            "minimum": 0,
            "type": "integer",
            "description": "Renewal leads: only licences expiring between today and today + N days. 0 = off."
          },
          "licenseNumbers": {
            "title": "Licence numbers (verify)",
            "type": "array",
            "description": "Return only these licence numbers. Numbers not found in the chosen lists get a free `found: false` row with the official lookup link. Pick ALL classifications if you do not know the class.",
            "items": {
              "type": "string"
            }
          },
          "statuses": {
            "title": "Statuses",
            "type": "array",
            "description": "Optional status filter on CSLB's Status column (the lists contain active licences, normally `CLEAR`).",
            "items": {
              "type": "string"
            }
          },
          "includeBondInfo": {
            "title": "Include bond and workers' comp details",
            "type": "boolean",
            "description": "CSLB's 'bond information' option: surety company, bond number and dates, workers' comp coverage type, insurer, policy number and dates.",
            "default": false
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "issueDateDesc",
              "issueDateAsc",
              "expirationDateAsc",
              "licenseNumberDesc"
            ],
            "type": "string",
            "description": "Order of the output. With a max-items cap you get the top N in this order.",
            "default": "issueDateDesc"
          },
          "maxItems": {
            "title": "Max licences",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum licences to return (and pay for). 0 = no limit.",
            "default": 10
          },
          "onlyNew": {
            "title": "Only licences not returned before (for schedules)",
            "type": "boolean",
            "description": "Remembers returned licence numbers in a named key-value store, so a scheduled run gives only new ones.",
            "default": false
          },
          "stateKey": {
            "title": "Memory key for 'only new'",
            "type": "string",
            "description": "Use different keys for different saved searches.",
            "default": "default"
          },
          "useCache": {
            "title": "Reuse today's downloaded lists",
            "type": "boolean",
            "description": "Keeps each CSLB file for 20 hours in a named key-value store (cslb-contractor-lists) so repeated runs do not download it again. CSLB updates the lists daily.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}