{
  "openapi": "3.0.1",
  "info": {
    "title": "Washington L&I Contractor & Tradesperson License Scraper",
    "description": "Search Washington L&I contractor, electrician, plumber, and asbestos-worker licenses by name, license number, UBI, or workers' comp account ID. Optional detail enrichment with bonds, insurance, violations. No login required.",
    "version": "1.0",
    "x-build-id": "dKVeBKTvlfXVShQre"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlerbros~washington-lni-contractor-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlerbros-washington-lni-contractor-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/crawlerbros~washington-lni-contractor-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawlerbros-washington-lni-contractor-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/crawlerbros~washington-lni-contractor-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawlerbros-washington-lni-contractor-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "byName",
              "byLicenseId",
              "byUbi",
              "byAccountId"
            ],
            "type": "string",
            "description": "How to search the L&I registry.",
            "default": "byName"
          },
          "name": {
            "title": "Name (mode=byName)",
            "type": "string",
            "description": "Business name or last name of an individual (e.g. `smith`, `abc construction`). Partial matches are supported, minimum 2 characters.",
            "default": "smith"
          },
          "licenseId": {
            "title": "License / registration / certificate number (mode=byLicenseId)",
            "type": "string",
            "description": "The contractor license, electrician/plumber certificate, or registration number (e.g. `ABCAR**824BB`, asterisks included where L&I's own record has them). Partial prefixes are supported."
          },
          "ubi": {
            "title": "UBI number (mode=byUbi)",
            "type": "string",
            "description": "Washington Unified Business Identifier — exactly 9 digits (e.g. `604164913`)."
          },
          "accountId": {
            "title": "Workers' comp account ID (mode=byAccountId)",
            "type": "string",
            "description": "L&I workers' compensation account ID, formatted like `123,456-01`."
          },
          "city": {
            "title": "Filter by city",
            "type": "string",
            "description": "Only emit results located in this Washington city (case-insensitive exact match, e.g. `Seattle`). Applied server-side alongside `mode`. Leave blank for all cities.",
            "default": ""
          },
          "zipCode": {
            "title": "Filter by zip code",
            "type": "string",
            "description": "Only emit results in this 5-digit Washington zip code (e.g. `98121`). Applied server-side alongside `mode`. Ignored if `city` is also set. Leave blank for all zip codes.",
            "default": ""
          },
          "licenseCategory": {
            "title": "Filter by license category",
            "enum": [
              "",
              "Construction Contractor",
              "Electrical Contractor",
              "Electrical Administrator",
              "Electrical Trainee",
              "Electrician",
              "Master Electrician",
              "Modified Trainee",
              "Asbestos Contractor",
              "Asbestos Supervisor",
              "Asbestos Worker",
              "Plumbing Contractor",
              "Medical Gas",
              "Plumber",
              "Plumber Trainee",
              "Modified Plumber Trainee",
              "Elevator Primary Contact",
              "Elevator Contractor",
              "Elevator Mechanic",
              "Elevator Mechanic Temporary",
              "Manufactured Home Installer"
            ],
            "type": "string",
            "description": "Only emit records whose contractor/trade type matches this category. Leave unset for all categories.",
            "default": ""
          },
          "statusFilter": {
            "title": "Filter by license status",
            "enum": [
              "",
              "active",
              "inactive",
              "expired",
              "suspended",
              "out of business",
              "re-licensed",
              "archived"
            ],
            "type": "string",
            "description": "Only emit records with this status. Leave unset for all statuses.",
            "default": ""
          },
          "violationsOnly": {
            "title": "Only show licenses with violations",
            "type": "boolean",
            "description": "Only emit records that have a safety violation and/or contractor violation flagged (`hasSafetyViolation` or `hasContractorViolation`). Useful for compliance monitoring and vendor due diligence.",
            "default": false
          },
          "sortOrder": {
            "title": "Sort order",
            "enum": [
              "desc",
              "asc"
            ],
            "type": "string",
            "description": "Sort direction for search results, as ranked by L&I's own relevance ranking.",
            "default": "desc"
          },
          "fetchDetails": {
            "title": "Fetch full license details",
            "type": "boolean",
            "description": "Enrich each result with the full detail record: address, bonds, insurance, business owners, violations, associated licenses, and DOSH inspections. Adds one extra request per record, so it is capped by Max items.",
            "default": true
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Hard cap on emitted license records.",
            "default": 10
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}