{
  "openapi": "3.0.1",
  "info": {
    "title": "California Contractor License Lookup & Export",
    "description": "Every CSLB-licensed contractor in California with phone on 99.8 % of rows, measured. Export a whole classification (roofing, electrical, plumbing, HVAC, solar) or verify a list of names or licence numbers. Status, expiry date, bond, address. Official register.",
    "version": "1.0",
    "x-build-id": "KxGSHoBGtL7Faq4rx"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/wellbuilt_zythem~california-contractor-license-lookup/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-wellbuilt_zythem-california-contractor-license-lookup",
        "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/wellbuilt_zythem~california-contractor-license-lookup/runs": {
      "post": {
        "operationId": "runs-sync-wellbuilt_zythem-california-contractor-license-lookup",
        "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/wellbuilt_zythem~california-contractor-license-lookup/run-sync": {
      "post": {
        "operationId": "run-sync-wellbuilt_zythem-california-contractor-license-lookup",
        "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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "lookup",
              "export",
              "detail"
            ],
            "type": "string",
            "description": "Lookup verifies a list of names or licence numbers. Export downloads a whole state and trade. Full detail reads the CSLB licence page for each California licence number you pass: bond, workers' compensation carrier and policy, classifications, entity type and today's status. It is the only mode that answers for a licence that is expired, inactive, cancelled or not in the register at all, because the bulk California file publishes active licences only.",
            "default": "lookup"
          },
          "queries": {
            "title": "Names or licence numbers to look up",
            "type": "array",
            "description": "One per line. A licence number matches exactly; a name matches any California licensee or business containing it.",
            "items": {
              "type": "string"
            }
          },
          "withDetail": {
            "title": "Add the full CSLB detail to each California row",
            "type": "boolean",
            "description": "For California rows, also read the licence page of each result: bond company, number, amount and effective date, workers' compensation carrier, policy number and expiry, all classifications, entity type and today's status. One request to the CSLB per licence, so it is capped by \"Max full details per run\". Enriched rows are charged as a full detail; the rest as a normal licence record. Never both for the same row.",
            "default": false
          },
          "maxDetails": {
            "title": "Max full details per run",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "How many licence pages to read in one run. Each one is a request to the CSLB, so the hard limit is 500 per run whatever you put here. For volume without the detail, use export mode.",
            "default": 100
          },
          "trades": {
            "title": "Trades",
            "type": "array",
            "description": "Leave empty for every trade the California board licenses.",
            "items": {
              "type": "string",
              "enum": [
                "construction-contractor",
                "electrical-contractor",
                "plumbing-contractor",
                "hvac-contractor",
                "roofing-contractor",
                "pool-spa-contractor",
                "asbestos-contractor",
                "elevator-contractor",
                "specialty-contractor"
              ],
              "enumTitles": [
                "General Building / Residential Remodeling",
                "Electrical",
                "Plumbing",
                "Warm-Air Heating, Ventilating, Air-Conditioning / Refrigeration",
                "Roofing",
                "Swimming Pool",
                "Asbestos Abatement",
                "Elevator",
                "Limited Specialty"
              ]
            },
            "default": []
          },
          "onlyActive": {
            "title": "Only active licences",
            "type": "boolean",
            "description": "Drop expired, suspended and out-of-business licences.",
            "default": false
          },
          "onlyWithPhone": {
            "title": "Only rows with a phone number",
            "type": "boolean",
            "description": "For calling lists.",
            "default": false
          },
          "onlyExpiringSoon": {
            "title": "Only licences expiring within 60 days",
            "type": "boolean",
            "description": "The renewal window. Who sells bonds, insurance or continuing education wants exactly these.",
            "default": false
          },
          "expiringWithinDays": {
            "title": "Expiring within N days",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Keep only licences that expire in the next N days (1 to 365). The renewal list: whoever sells bonds, insurance or continuing education calls these first. Leave empty for no window. Overrides the fixed 60-day \"expiring soon\" switch when set."
          },
          "issuedWithinDays": {
            "title": "Issued within N days",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Keep only licences first issued in the last N days (1 to 365): newly licensed contractors, which is a new business needing suppliers, software, a truck and insurance. Uses the board's issue date; boards that do not publish one return nothing here rather than a guess."
          },
          "maxResults": {
            "title": "Maximum rows",
            "minimum": 0,
            "type": "integer",
            "description": "0 for no limit.",
            "default": 0
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}