# Washington L\&I Contractor & Tradesperson License Scraper (`dataspryva/washington-l-and-i-contractor-and-tradesperson`) Actor

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.

- **URL**: https://apify.com/dataspryva/washington-l-and-i-contractor-and-tradesperson.md
- **Developed by:** [Dataspryva](https://apify.com/dataspryva) (community)
- **Categories:** Automation, Lead generation, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.49 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Washington L\&I Contractor & Tradesperson License Scraper

Scrape **Washington State Department of Labor & Industries (L\&I)** contractor, electrician, plumber, elevator, and asbestos-worker license records from the official "Verify a Contractor, Tradesperson or Business" public registry. Search by business/individual name, license or registration number, UBI (Unified Business Identifier), or workers' comp account ID. Optionally enrich every result with the full license detail record — address, surety bonds, liability insurance, business owners, associated licenses, and safety/contractor violations. No login, no API key, no proxy required.

### What this actor does

- **Four search modes:** by name, by license/registration/certificate number, by UBI number, by workers' comp account ID
- **20 license categories covered:** general/specialty construction contractors, electrical (contractor, administrator, electrician, master electrician, trainee), plumbing (contractor, plumber, plumber trainee, medical gas), asbestos (contractor, supervisor, worker), elevator (contractor, mechanic, primary contact), and manufactured home installers
- **Pagination:** fetches 100 results per request and keeps paging until `maxItems` or the result set is exhausted (up to 500 emitted records per run)
- **Filters:** license category, license status, city, zip code, and violations-only — category, active status, city and zip are applied by L\&I server-side as well as re-checked client-side
- **Sort:** L\&I relevance or business name, ascending or descending
- **Optional detail enrichment:** attach full business detail — surety bonds, liability insurance, business owners/officers, associated licenses, workers'-comp accounts, safety and license violations, DOSH inspections
- **Backward compatible:** input keys from older saved tasks (`query`, `maxResults`, `includeDetails`, …) are mapped in code, so existing tasks keep running
- **Empty fields are omitted** — every record only contains data L\&I actually returned for that license

### Data source

This actor reads Washington State L\&I's own public "Verify a Contractor, Tradesperson or Business" lookup tool — the same results the official website's search page shows. No login, API key, or proxy is required.

### Output per license record

- `licenseId` — the L\&I license, registration, or certificate number
- `ubi` — Washington Unified Business Identifier, when on file
- `businessName` — business or individual licensee name
- `contractorType` / `licenseType` — e.g. `Electrician`, `Asbestos Worker`, `General/Specialty Contractor`
- `contractorGroup` — top-level category (e.g. `Electrical`, `Plumber`, `Asbestos`)
- `asbestosGroup` — asbestos-program sub-classification, when the license is asbestos-related
- `status` — `Active`, `Inactive`, `Expired`, `Suspended`, `Out of Business`, `Re-Licensed`, `Superseded`, or `Retest`
- `statusDescription` — the raw L\&I status text (e.g. `EXPIRED`, `ACTIVE`, `SUPERCEDED`) — detail mode only
- `employerDisplayStatus` — L\&I's workers'-comp employer-account display status, when on file
- `city`, `state`, `zipCode`, `county`, `address1`, `address2`, `phoneNumber` — detail mode only for address/phone
- `businessType` — e.g. `Limited Liability Company`, `Individual`, `Corporation`
- `parentCompany` — parent/umbrella business, when on file
- `effectiveDate`, `expirationDate`, `suspendDate` — ISO `YYYY-MM-DD`
- `specialtyCode1`, `specialtyName1`, `specialtyText1` and `specialtyCode2`/`specialtyName2`/`specialtyText2` — construction contractor specialty classification
- `contractorTypeDescription` — plain-language description of the license type
- `licenseTypeCode` — L\&I's internal short code for the license type (e.g. `CC`) — detail mode only
- `relationType` — the licensee's relation type on the record (e.g. `Business`, `Individual`) — detail mode only
- `hasSafetyViolation`, `hasContractorViolation` — boolean flags
- `hasInactiveWorkersCompAccounts` — boolean
- `associatedLicenses[]` — other licenses/registrations tied to the same business or person
- `businessOwners[]` — owners/officers/partners, with role and start/end dates
- `bonds[]` — surety bond company, account number, amount, effective/expiration dates
- `insurances[]` — liability insurance firm, account ID, amount, effective/expiration dates
- `savingsAccounts[]` — savings account assignment in lieu of bond, when on file
- `violations[]`, `summons[]`, `warrants[]`, `debarments[]`, `strikes[]` — enforcement history, when on file
- `lapses[]` — license lapse/reinstatement history
- `courses[]`, `affidavits[]`, `codes[]` — continuing education and compliance records, when on file
- `doshInspections[]` — Washington DOSH workplace safety inspection history, when on file
- `workersCompAccounts[]` — workers'-comp account(s) on file: `accountId`, `legalName`, `dbaName`, `isCurrent`, `balanceCode`, `balanceMessage`, `estimatedWorkers`, `representative`, and `riskClasses[]` (class code, description, rate, effective date)
- `hasActiveWorkersCompAccount` — `true` when at least one linked workers'-comp account is current
- `governingPersons[]` — business governing persons on file
- `employerBusinessDetails` — workers'-comp employer business record (legal name, business ID, address), when on file
- `contractorTrackingUrl`, `contractorRegistrationUrl` — related L\&I portal links
- `sourceUrl` — canonical L\&I Verify detail page URL for the license (includes the UBI for business licenses so L\&I shows the full workers'-comp record)
- `recordType: "license"`, `scrapedAt`

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | string | `byName` | `byName` / `byLicenseId` / `byUbi` / `byAccountId` |
| `name` | string | `smith` | Business name or individual last name (mode=byName); min 2 characters |
| `licenseId` | string | – | License/registration/certificate number, exact or prefix (mode=byLicenseId) |
| `ubi` | string | – | 9-digit Washington UBI number (mode=byUbi) |
| `accountId` | string | – | Workers' comp account ID, e.g. `88160900` (mode=byAccountId); formatted values like `881,609-00` are normalized |
| `city` | string | – | Restrict results to a single Washington city (case-insensitive, applied server-side by L\&I and re-checked client-side) |
| `zipCode` | string | – | Restrict results to a single 5-digit Washington zip code (applied server-side by L\&I and re-checked client-side; ignored if `city` is also set) |
| `licenseCategory` | string | – | Restrict results to one of 20 license categories (applied server-side by L\&I) |
| `statusFilter` | string | – | `active` / `inactive` / `expired` / `suspended` / `out of business` / `re-licensed` / `superseded` / `retest` |
| `violationsOnly` | boolean | `false` | Only emit records with a safety and/or contractor violation flagged |
| `sortBy` | string | `relevance` | `relevance` (L\&I best match) / `name` (business name) |
| `sortOrder` | string | `desc` | `desc` / `asc`, applied to `sortBy` |
| `fetchDetails` | boolean | `true` | Enrich each result with the full detail record (bonds, insurance, owners, violations, workers'-comp accounts, etc.) |
| `maxItems` | integer | `10` | Hard cap on emitted license records (1–500) |

#### Example: search by business name with detail enrichment

```json
{
  "mode": "byName",
  "name": "smith",
  "fetchDetails": true,
  "maxItems": 20
}
```

#### Example: look up an exact license number

```json
{
  "mode": "byLicenseId",
  "licenseId": "ABCAR**824BB",
  "fetchDetails": true
}
```

#### Example: search by UBI number, active licenses only

```json
{
  "mode": "byUbi",
  "ubi": "604164913",
  "statusFilter": "active"
}
```

#### Example: browse all licensed electricians without detail hydration (faster)

```json
{
  "mode": "byName",
  "name": "construction",
  "licenseCategory": "Electrician",
  "fetchDetails": false,
  "maxItems": 100
}
```

#### Example: search by name restricted to one city

```json
{
  "mode": "byName",
  "name": "construction",
  "city": "Spokane",
  "maxItems": 25
}
```

#### Example: compliance check for licenses with flagged violations

```json
{
  "mode": "byName",
  "name": "construction",
  "violationsOnly": true,
  "maxItems": 25
}
```

### Use cases

- **Due diligence** — verify a contractor's license, bond, and insurance status before hiring
- **Compliance monitoring** — track license status and violation history for vendors and subcontractors
- **Lead generation** — build lists of licensed contractors/tradespeople by category or region
- **Insurance & surety underwriting** — cross-check bond and insurance coverage on file with L\&I
- **Legal & background research** — pull violation, debarment, and lapse history tied to a business or UBI

### Limitations

- **500 records per run** (`maxItems` ceiling). L\&I's search API returns at most 100 rows per page and has no cursor/export endpoint, so very broad queries are split by licence category, location or name prefix.
- **Scan ceiling:** to satisfy client-side filters (non-active statuses, violations-only), the actor scans up to 5,000 search matches per run. If a filter matches only records beyond that point, the run reports `scanned N of M matches` in its status message instead of pretending it saw everything.
- **Server-side filter scope:** category, active status, city and zip code are applied by L\&I; other statuses and `violationsOnly` are checked over the scanned rows.
- **Violation-only search rows** (a violation with no licence number) are not part of this licence dataset; they carry no licence record to enrich. Search by the business name or UBI to reach the related licence instead.
- **Detail enrichment is one request per record.** For large runs without bonds/insurance/workers'-comp data, set `fetchDetails` to `false`.

### FAQ

**Do my existing saved tasks keep working?**
Yes. Older input keys such as `query`/`searchQuery`, `maxResults`, `includeDetails`, `licenseNumber`, `ubiNumber`, `accountNumber` and `category` are mapped to the current fields in code. The legacy `statusFilter: "archived"` value is still honoured too.

**How many results can one run return?**
Up to 500 (`maxItems`). The actor pages 100 rows at a time and stops at `maxItems`, when L\&I has no more matches, or at the 5,000-row scan ceiling. The run's status message states how many matches were scanned.

**What is the data source?**
This actor uses Washington State Department of Labor & Industries' own public "Verify a Contractor, Tradesperson or Business" lookup tool at `secure.lni.wa.gov/verify`. It is a genuine public REST API with no authentication requirement — the same data the L\&I website itself displays.

**Is this affiliated with Washington State L\&I?**
No. This is an independent, third-party actor that reads L\&I's public verification data. It is not affiliated with or endorsed by the Washington State Department of Labor & Industries.

**Why does `fetchDetails` matter?**
Search results alone give you the license number, business name, category, and basic status. Turning on `fetchDetails` (the default) fetches the full record for each result — address, bonds, insurance, business owners, and violation history — at the cost of one extra request per record. Turn it off for faster, lighter-weight bulk name/category browsing.

**Why are some fields missing on certain licenses?**
L\&I only returns the fields it has on file for a given license. Bonds, insurance, and violation history are commonly empty for license types that don't require them (e.g. individual trade certifications like Electrician or Asbestos Worker don't carry bond/insurance records the way business contractor licenses do). Empty fields are always omitted rather than shown as blank or null.

**What's the difference between "Construction Contractor" and the electrical/plumbing/asbestos/elevator categories?**
"Construction Contractor" is L\&I's general contractor and specialty-trade contractor registration (bonded businesses). Electrical, plumbing, asbestos, and elevator categories are separate certification/licensing programs for individual tradespeople and specialty contractors in those disciplines, each with their own bonding/insurance rules.

**How fresh is the data?**
Every run queries the live L\&I API directly — there is no caching layer, so results reflect L\&I's registry at the moment the actor runs.

**Can I narrow results to a specific city or zip code?**
Yes. Set `city` (e.g. `Seattle`) or `zipCode` (e.g. `98121`) alongside any search `mode` — L\&I's own registry applies the location filter server-side on top of your name/license/UBI/account search, the same as the location dropdown on the official Verify tool's results page. If both are set, `city` takes priority.

**Can I search by partial name?**
Yes. `name` (mode=byName) and `licenseId` (mode=byLicenseId) both support partial/prefix matching, mirroring L\&I's own search behavior — the same as typing into the site's search box.

**Does this include Washington's professional licenses (real estate, cosmetology, etc.)?**
No — those are handled by a different Washington State agency (the Department of Licensing, DOL) with a separate lookup tool. This actor is scoped to L\&I's contractor, tradesperson, and workers'-comp registry only.

# Actor input Schema

## `mode` (type: `string`):

How to search the L\&I registry.

## `name` (type: `string`):

Business name or last name of an individual (e.g. `smith`, `abc construction`). Partial matches are supported, minimum 2 characters.

## `licenseId` (type: `string`):

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` (type: `string`):

Washington Unified Business Identifier — exactly 9 digits (e.g. `604164913`).

## `accountId` (type: `string`):

L\&I workers' compensation account ID, e.g. `88160900` (digits only). Formatted legacy values such as `881,609-00` are accepted and normalized.

## `city` (type: `string`):

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.

## `zipCode` (type: `string`):

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.

## `licenseCategory` (type: `string`):

Only emit records whose contractor/trade type matches this category. Leave unset for all categories.

## `statusFilter` (type: `string`):

Only emit records with this top-level license status. Leave unset for all statuses.

## `violationsOnly` (type: `boolean`):

Only emit records that have a safety violation and/or contractor violation flagged (`hasSafetyViolation` or `hasContractorViolation`). Useful for compliance monitoring and vendor due diligence.

## `sortBy` (type: `string`):

Order of results: L\&I's own relevance ranking, or business name.

## `sortOrder` (type: `string`):

Ascending or descending, applied to the selected Sort by field.

## `fetchDetails` (type: `boolean`):

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.

## `maxItems` (type: `integer`):

Hard cap on emitted license records (1-500). Results are fetched 100 at a time.

## Actor input object example

```json
{
  "mode": "byName",
  "name": "smith",
  "licenseId": "ABCAR**824BB",
  "ubi": "604164913",
  "accountId": "88160900",
  "city": "",
  "zipCode": "",
  "licenseCategory": "",
  "statusFilter": "",
  "violationsOnly": false,
  "sortBy": "relevance",
  "sortOrder": "desc",
  "fetchDetails": true,
  "maxItems": 10
}
```

# Actor output Schema

## `licenses` (type: `string`):

Dataset containing all scraped Washington L\&I license records.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "mode": "byName",
    "name": "smith",
    "licenseId": "ABCAR**824BB",
    "ubi": "604164913",
    "accountId": "88160900",
    "city": "",
    "zipCode": "",
    "licenseCategory": "",
    "statusFilter": "",
    "violationsOnly": false,
    "sortBy": "relevance",
    "sortOrder": "desc",
    "fetchDetails": true,
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("dataspryva/washington-l-and-i-contractor-and-tradesperson").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "mode": "byName",
    "name": "smith",
    "licenseId": "ABCAR**824BB",
    "ubi": "604164913",
    "accountId": "88160900",
    "city": "",
    "zipCode": "",
    "licenseCategory": "",
    "statusFilter": "",
    "violationsOnly": False,
    "sortBy": "relevance",
    "sortOrder": "desc",
    "fetchDetails": True,
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("dataspryva/washington-l-and-i-contractor-and-tradesperson").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "mode": "byName",
  "name": "smith",
  "licenseId": "ABCAR**824BB",
  "ubi": "604164913",
  "accountId": "88160900",
  "city": "",
  "zipCode": "",
  "licenseCategory": "",
  "statusFilter": "",
  "violationsOnly": false,
  "sortBy": "relevance",
  "sortOrder": "desc",
  "fetchDetails": true,
  "maxItems": 10
}' |
apify call dataspryva/washington-l-and-i-contractor-and-tradesperson --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,dataspryva/washington-l-and-i-contractor-and-tradesperson"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/j1sWA3CfWr5xsbY9V/builds/VCcndTW7GlfsHQbGV/openapi.json
