{
  "openapi": "3.0.1",
  "info": {
    "title": "California Construction Trades Directory & Leads (CSLB)",
    "description": "Sweep every construction trade across every California county you pick, in one run. Deduplicated licensed-contractor leads from the official CSLB register — name, address, phone, licence, bond and workers' comp.",
    "version": "0.1",
    "x-build-id": "kMPVktRPKN4FDpZCR"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapebench~california-construction-trades-directory/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapebench-california-construction-trades-directory",
        "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/scrapebench~california-construction-trades-directory/runs": {
      "post": {
        "operationId": "runs-sync-scrapebench-california-construction-trades-directory",
        "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/scrapebench~california-construction-trades-directory/run-sync": {
      "post": {
        "operationId": "run-sync-scrapebench-california-construction-trades-directory",
        "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": {
          "licenseClasses": {
            "title": "Construction trades",
            "type": "array",
            "description": "The CSLB trades to sweep. Defaults to the 13 building trades most lead lists want — general building plus framing, concrete, drywall, electrical, flooring, HVAC, landscaping, painting, plastering, plumbing, roofing and sheet metal. Add or remove any code you like: A, B, B-2, C-2 … C-60, and the C-61/D-xx limited specialties (e.g. 'C-46' solar, 'C-53' swimming pool, 'C-61/D-49' tree service). Each trade is one request; a contractor holding two of your trades is returned — and billed — once.",
            "default": [
              "B",
              "C-5",
              "C-8",
              "C-9",
              "C-10",
              "C-15",
              "C-20",
              "C-27",
              "C-33",
              "C-35",
              "C-36",
              "C-39",
              "C-43"
            ],
            "items": {
              "type": "string"
            }
          },
          "licenseClass": {
            "title": "Single trade (optional)",
            "type": "string",
            "description": "One CSLB classification code, added to whatever is in 'Construction trades'. Here so a saved task built around a single trade keeps working; most runs should use the list above."
          },
          "counties": {
            "title": "Counties",
            "type": "array",
            "description": "California counties to sweep, e.g. Sonoma and Napa and Solano. ALL of them are fetched in a single request per trade, so adding counties costs no extra requests. Case, spacing and a trailing 'County' do not matter. Turn on Discovery Mode to list every valid name.",
            "default": [
              "Sonoma",
              "Napa",
              "Solano",
              "Contra Costa"
            ],
            "items": {
              "type": "string"
            }
          },
          "county": {
            "title": "Single county (optional)",
            "type": "string",
            "description": "One California county, added to whatever is in 'Counties'. Here so a saved task built around a single county keeps working."
          },
          "maxResults": {
            "title": "Maximum results per trade",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Cap on records returned PER TRADE (each trade is one download covering all your counties), not per run — so adding trades can never silently truncate the ones later in the list. Leave empty to return everything. A wide trade list across large counties can return tens of thousands of rows; set this if you want a bounded bill."
          },
          "listCountiesOnly": {
            "title": "Discovery Mode: list counties only",
            "type": "boolean",
            "description": "If true, skip the sweep and return every valid California county name from the live CSLB form. Free — not charged. Use it to check spellings before a real run.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional, and off by default. CSLB answers Apify's platform IPs directly — measured 2026-08-19 — so a proxy is not needed and only adds latency. Enable one only if a run returns no data and the log shows CSLB refusing the request.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}