# Contractor License Roster and Status Feed: 8 US States (`overlookdata/multistate-contractor-roster`) Actor

Contractor and trade licenses from the rosters of WA, OR, NY, CA, MN, ME, NJ and VA, one row per license, normalized: names, address, phone and email where the state publishes them, status, expiry, and bond, insurance and workers' comp where published. Change events between runs.

- **URL**: https://apify.com/overlookdata/multistate-contractor-roster.md
- **Developed by:** [Aaron Melton](https://apify.com/overlookdata) (community)
- **Features:** Limited permissions
- **Stats:** 5 total users, 5 monthly users, 86.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## Contractor License Roster and Status Feed: WA, OR, NY, CA, MN, ME, NJ and VA

**Every contractor and trade license eight states publish, in one schema, with
its status, and the changes between runs.** This actor reads the whole
contractor rosters of Washington, Oregon, New York, California, Minnesota,
Maine, New Jersey and Virginia straight from each state agency's own open data
or download page and returns one row per license: business and person names,
mailing address, phone and email where the state publishes them, license type
and level, the state's own status and a normalized one, issue and expiry dates,
and the bond, liability insurance and workers' comp details the state
publishes.

Run it three ways:

- **roster**: active licenses with their contact details.
- **status**: every license the source publishes, active or not, each with a
  normalized status.
- **changes**: events since the previous run: licenses added, removed or
  reinstated, status and expiry changes, and bond, insurance and workers' comp
  changes, each dated as precisely as the source allows.

Every whole-state run is checked before it counts: against the state's own
published count where one exists (WA, OR, NY and Maine), and otherwise for a
complete, well-formed download that is not much smaller than the last stored
snapshot. The result is written to a `VERIFICATION` record per state (see
[Data quality and reconciliation](#data-quality-and-reconciliation)).

### What you get

One row per license. A row built by the actor from Washington L\&I's open data
for license ECOSTSC758NN (captured 2026-11-10):

```json
{
  "record_type": "license",
  "record_key": "WA:lni:ECOSTSC758NN",
  "state": "WA",
  "license_number": "ECOSTSC758NN",
  "license_type": "CC",
  "license_type_description": "CONSTRUCTION CONTRACTOR",
  "trade_or_classification": "GENERAL",
  "license_level": "contractor",
  "holder_type": "business",
  "business_name": "!ECO STAR C G CONSTRUCTION LLC",
  "person_name": "GUERRERO MARTINEZ, CARLOS I.",
  "dba_name": null,
  "street_address": "2420 COLUMBIA HOUSE BLVD #311",
  "street_address_2": null,
  "city": "VANCOUVER",
  "state_code": "WA",
  "zip": "98661",
  "county": null,
  "phone": "5039573452",
  "phone_e164": "+15039573452",
  "email": null,
  "license_status": "ACTIVE",
  "license_status_secondary": null,
  "status_normalized": "active",
  "is_active": true,
  "status_basis": "source_status",
  "status_date": null,
  "issue_date": "2025-08-15",
  "expiration_date": "2027-08-15",
  "bond": {
    "surety_company": "Merchants Bonding Co (Mutual)",
    "bond_number": "101977514",
    "amount": "30000.0000",
    "effective_date": "2026-08-20",
    "expiration_date": "Until Canceled",
    "cancellation_date": null,
    "impaired": false,
    "impaired_date": null
  },
  "liability_insurance": {
    "carrier": "State National Ins Co Inc",
    "policy_number": "NXT9PTHTLT-01-GL",
    "amount": "1000000.0000",
    "effective_date": "2026-06-12",
    "expiration_date": "2027-06-12",
    "cancellation_date": null,
    "last_updated": "2026-06-11"
  },
  "workers_comp": null,
  "additional_bonds": null,
  "enforcement_action": null,
  "renewal_in_progress": null,
  "source": "Washington State Department of Labor and Industries, contractor license data",
  "source_url": "https://data.wa.gov/resource/m8qx-ubtq.json",
  "source_as_of": "2026-11-10T15:38:17+00:00",
  "fetched_at": "2026-11-10T16:04:31+00:00",
  "attribution": null
}
```

In `changes` mode the rows are events instead. An illustrative event (the
license is made up; the keys and value shapes are exactly what the actor
writes):

```json
{
  "record_type": "event",
  "event_type": "bond_changed",
  "record_key": "CA:cslb:1000101",
  "state": "CA",
  "license_number": "1000101",
  "business_name": "VALLEY FRAMING INC",
  "person_name": null,
  "license_type": null,
  "field": "bond.cancellation_date",
  "previous_value": null,
  "current_value": "2026-11-02",
  "previous_status_normalized": "active",
  "current_status_normalized": "suspended",
  "event_date": "2026-11-02",
  "event_date_basis": "source_field",
  "previous_snapshot_as_of": "2026-11-06",
  "current_snapshot_as_of": "2026-11-10",
  "detected_at": "2026-11-10T12:41:07+00:00",
  "source": "California Contractors State License Board, License Master file",
  "source_url": "https://www.cslb.ca.gov/onlineservices/dataportal/ContractorList"
}
```

Every row of a kind has the same keys. A field the state leaves blank is
`null`, never missing. Text is kept as the state publishes it, without
re-casing or cleaning; dates become `YYYY-MM-DD` where the source's format is
known, and anything else (such as Washington's "Until Canceled") is kept as
written. `phone_e164` is filled only when the phone is a ten-digit North
American number.

`status_normalized` is one of `active`, `expired`, `suspended`, `revoked`,
`inactive`, `cancelled`, `closed` (the holder ended the license, retired,
dissolved or died) or `unknown`. The mapping is literal, one source value to
one normalized value; a value the actor has not seen before becomes `unknown`
and is listed in the `VERIFICATION` record. Application rows (pending, denied,
withdrawn applications and exam states) are left out of every mode.

### Input

| Field | Default | What it does |
|---|---|---|
| `mode` | `roster` | `roster`, `status` or `changes` (see below). |
| `states` | all eight | Which rosters to read. Empty means all. They run one after the other. |
| `licenseTypes` | none | Keep licenses whose type, type description or trade contains any of these words. |
| `licenseLevels` | all | `contractor`, `master`, `journeyman`, `trainee`, `other`. |
| `holderTypes` | both | `business`, `individual`. Oregon does not say, so its licenses pass only when this is empty. |
| `counties`, `cities` | none | Exact names, case does not matter. |
| `zipPrefixes` | none | ZIP code starts with any of these. |
| `businessNameContains` | none | Text in the business, trade or person name. |
| `hasPhone`, `hasEmail` | false | Keep only licenses with a phone, or with an email. |
| `maxItems` | none | Stop after this many rows in all. Not allowed in `changes`. |
| `watchList` | none | `status` and `changes` only: record keys (`WA:lni:ECOSTSC758NN`) or state and license number (`WA:ECOSTSC758NN`). |
| `takedownRecordKeys` | none | Record keys to leave out of every row and event. |
| `requestDelayMs` | 250 | Minimum gap between two requests to one host. |
| `acceptShrinkStates` | none | `changes` only, for one run: states whose drop of more than 2 percent against the stored snapshot is real (see the size check below). Remove them again afterwards. |

On WA, OR and NY the filters are sent to the state's open data API, so a
narrow run downloads only the matching licenses. The file states are read
whole and filtered as they stream.

### The three modes

- **roster** returns active licenses only. A Washington or New York roster run
  asks the API for active licenses only.
- **status** returns every license the source publishes, with
  `status_normalized`, `is_active` and `status_basis`. A whole-state `status`
  run (no filter, no watch list, no `maxItems`) stores the state's first
  snapshot (a baseline) for `changes` when none is stored yet. It never
  replaces a stored snapshot.
- **changes** reads the whole state, compares it with the snapshot stored by
  the previous whole-state `status` or `changes` run in your account, and
  returns one row per change. **The first `changes` run for a state stores a
  baseline and returns nothing**; events start with the second run. Before
  downloading, it checks the source's own refresh signal and, when that has not
  moved since the stored snapshot, returns nothing for the state and downloads
  nothing else (Maine and New Jersey have no such signal and are read every
  run). Filters and the watch list narrow the events, never the download, so
  the snapshot always covers the whole state and still advances on a watch-list
  run.

#### Snapshots

Snapshots live in a key-value store named `contractor-roster-snapshots` in your
account. Named stores are kept until you delete them. Only `changes` replaces a
stored snapshot, so `status` runs can be mixed in without hiding any change
from the next `changes` run.

**Run one `changes` run at a time per account.** Every run in the account shares
that one store, and two `changes` runs over the same state at once would
overwrite each other's snapshots.

What the store holds, per state: one record per license with its record key,
state, license number, license type, business and person name, license type
description, trade, level, holder type, trading name, city, ZIP, county,
whether a phone and whether an email exists (true or false, not the phone or
email itself), the status fields, status date, expiry date and the bond,
liability insurance and workers' comp objects; plus a manifest with the as-of
times, the record count and the record keys of removed licenses with the date
they left. Licenses on the takedown list are not stored. Each new snapshot is
written beside the old one. Before writing, it stores a
`SNAPSHOT_<STATE>_PENDING` record naming its own records and the old
snapshot's. Once the new snapshot is in place, the old one's records are
deleted and the pending record is removed. If the write stops part way, or the
store refuses a delete (of the old records, or of the new ones after a failed
run), the pending record stays, and the next write for that
state first deletes every record it names that the snapshot in place does not
use. If those deletes are refused too, the records are left in the store and
the run log says which. A pending record naming more than 1,000 records per
snapshot, or anything but that state's snapshot records, is logged and not
acted on.

In `changes` the new snapshot's records are written first, then the events are
written to the dataset, then the manifest record that puts the new snapshot in
place. When a `changes` run stops for a state, the stored snapshot stays as it
was:

- **The stored snapshot cannot be read** (a record missing or damaged): the
  state fails with a message saying so and emits nothing. It does not start a
  new baseline over it, because that would lose every event since. To start
  again from a baseline, delete the record `SNAPSHOT_<STATE>_MANIFEST` (for
  example `SNAPSHOT_CA_MANIFEST`) from the store. That also loses the list of
  removed licenses, so a license that comes back later is reported as added,
  not reinstated, and the old snapshot's other records
  (`SNAPSHOT_<STATE>_<write id>_<0000>`) are no longer listed anywhere, so
  delete those by hand too.
- **The pull is much smaller than the snapshot:** see the size check below.
- **The new snapshot's records cannot be written:** the state fails and no
  events are written.
- **The run's maximum charge does not cover the state:** before any event is
  written, the state's whole cost is worked out (each event as a dataset item
  and a change event, plus the state's change check) and compared with what
  is left of the maximum charge you set for the run. When it does not fit,
  the state fails with a message giving the number of events, the cost and
  the amount left. Nothing is written or charged for that state, and the same
  events come on the next `changes` run with a higher maximum. This also
  applies to a first run (a baseline) and to a state whose source has not
  changed, which cost the change check alone. States earlier in the run that
  did fit are complete and charged.
- **The events cannot all be written to the dataset:** events go to the
  dataset in batches of 500. The state fails and the new snapshot's records
  are deleted, but the batches already written stay in the dataset. The next
  `changes` run compares against the same snapshot and writes those events
  again. The failure message gives how many were written before the failure.
  That number is a minimum: the batch that failed may have been stored as
  well, and the message gives its size.
- **The manifest record cannot be written** after all the events were written:
  the state fails, and the next `changes` run compares against the same
  snapshot and writes all of that run's events again. If the store kept the
  manifest record despite reporting an error, the new snapshot is in place and
  nothing repeats; the failure message names both outcomes.

A run that is aborted, times out, runs out of memory or is restarted while it
is writing events, or after the events and before the manifest record, repeats
events in the same way. A repeated event has the same
`record_key`, `event_type`, `field` and `previous_snapshot_as_of` as the one
written before; its `detected_at` is later, and its `current_snapshot_as_of`
and `current_value` can differ when the source moved on in between.

#### Event types

| Event | When |
|---|---|
| `license_added` | A license that was in neither the previous snapshot nor its list of removed licenses. |
| `license_removed` | A license in the previous snapshot that is gone now. Names come from the previous snapshot. |
| `reinstated` | A removed license that came back, or a status that went from not active to active. Emitted instead of `license_added` or `status_changed`. |
| `status_changed` | The source status, the secondary status or the normalized status changed. One event; `field` names the first that differs. |
| `expiration_changed` | The expiry date changed (usually a renewal). |
| `bond_changed`, `liability_insurance_changed`, `workers_comp_changed` | One event per changed sub-field, `field` as `bond.cancellation_date`; a bond, policy or cover that appears or disappears is one event with `field` the object name. |

`event_date_basis` says how far the date can be trusted:

- `source_field`: the state dated the change itself, and `event_date` is that
  date. This applies to a Washington suspension (the suspend date), a change to
  California's "Work Comp Susp" (the workers' comp suspend date), and any change
  to a bond, insurance or workers' comp cancellation date, the workers' comp
  suspend date, a bond impairment date or an insurance "last updated" date.
- `snapshot_diff`: the state gives no date for the change. `event_date` is
  null, and the change is only known to have happened between
  `previous_snapshot_as_of` and `current_snapshot_as_of`.

### What each state can and cannot report

| State | Source | Refresh signal | Statuses published | Bond | Liability insurance | Workers' comp | Events it can produce | Date basis |
|---|---|---|---|---|---|---|---|---|
| WA | Department of Labor and Industries, data.wa.gov (General, Bond and Insurance datasets) | each dataset's update time; stated three times a day | all, back to about 2019: active, expired, suspended, inactive, closed, and four values mapped `unknown` | surety, number, amount, effective, expiry (a date or "Until Canceled"), cancellation, impaired | carrier, policy, amount, effective, expiry, cancellation, last updated | none | all eight | `source_field` for suspensions, bond and insurance dates; else `snapshot_diff` |
| OR | Construction Contractors Board, data.oregon.gov | dataset update time; daily | active only (the list holds licenses that can work today) | surety, amount, expiry | carrier, amount, expiry | exempt or not | added, removed, reinstated, expiry, bond, liability, workers' comp flag | `snapshot_diff` |
| NY | Department of Labor Contractor Registry, data.ny.gov | dataset update time; daily | `Active` only so far; the first expiries fall at the end of November 2026, and any new value is mapped `unknown` until reviewed | none | none | has cover, exempt | added, removed, reinstated, expiry, workers' comp flags, and status once other values appear | `snapshot_diff` |
| CA | Contractors State License Board, License Master file | none used; read every run (the workbook is rebuilt nightly, and the "Updated as of" date on the page lags it) | active (CLEAR) and 20 kinds of suspension | contractor's bond: surety, number, amount, effective, cancellation | none | coverage type, carrier, policy, effective, expiry, cancellation, suspend date | status, reinstated, expiry, bond, workers' comp, added, removed | `source_field` for bond and workers' comp dates and a change to Work Comp Susp; else `snapshot_diff` |
| MN | Department of Labor and Industry, four license exports | the files' Last-Modified time; "updated nightly" | active (Issued), expired, suspended, revoked, closed (voluntary termination), and legacy `LICENSED` rows mapped `unknown` | none | none | none | status, reinstated, expiry, added, removed | `snapshot_diff` |
| ME | Professional and Financial Regulation, licensing system (electricians and plumbers) | none; read every run | active, expired (including failed to renew), revoked, cancelled, closed, and two values mapped `unknown` | none | none | none | status, reinstated, expiry, added, removed | `snapshot_diff` |
| NJ | Division of Consumer Affairs, home improvement contractor bulk download | none; read every run | active, expired, suspended, revoked, inactive, closed, and Barred or a lone Reinstatement Pending mapped `unknown` | none | none | none | status, reinstated, expiry, added, removed | `snapshot_diff` |
| VA | DPOR Board for Contractors regulant lists 2701, 2705a, 2705b, 2705c | the files' Last-Modified time; not stated | active only (current regulants) | none | none | none | added, removed, reinstated, expiry | `snapshot_diff` |

- **Oregon, New York, California and Virginia list only current licenses** (or,
  for California, current and suspended ones). When a license leaves the file
  the actor emits `license_removed`, but these sources do not say why: it may
  have expired, lapsed, been revoked or been cancelled.
- In Washington, a license that is suspended or expires drops out of the bond
  and insurance datasets, so its `bond` and `liability_insurance` become null
  and a `bond_changed` and a `liability_insurance_changed` event with `field`
  `bond` or `liability_insurance` come beside the status change.
- Oregon publishes one row per license number per license type, so a license
  with two endorsements is two rows with different record keys
  (`OR:ccb:<number>:<type>`). Virginia's record key is the ten-digit DPOR
  number, because the certificate number alone repeats between lists.
- California's additional bond groups (`additional_bonds`) and Minnesota's
  `enforcement_action` and `renewal_in_progress` are in the rows but produce no
  events in this release, and no contact field change produces an event.

### Data quality and reconciliation

- **What each whole-state run is checked against.** Not every state publishes
  a count of its own, so the check differs by state:

  | State | Checked against |
  |---|---|
  | WA | The open data API's own `count(*)` for the same query on the General dataset, and a `count(*)` for each of the Bond and Insurance datasets against the rows read from them. A gap of up to 0.5 percent is allowed, because the datasets update during the day. |
  | OR, NY | The open data API's own `count(*)` for the same query, within 0.5 percent. |
  | ME | Each of the eight pulls must hold exactly as many rows as the search page's "N records found". |
  | CA | A complete download: the stream ends cleanly and the last row is as wide as the header (see below). |
  | MN, NJ, VA | A complete download: the stream ends without a break and at most 0.1 percent of rows are malformed. |

  For every state the rows written must also match the rows the actor kept
  from the source, less application, duplicate and malformed rows (exactly,
  status by status, for the file states). For CA, MN, NJ and VA that tally is
  the actor's own, so it catches a lost row but not a short file; the size
  check below covers a short file. A gap beyond the tolerance fails the state;
  the log and `VERIFICATION` state both numbers. A `status` run on 2026-11-10
  passed in every state it covered: WA 161,614 rows, OR 56,625, NY 15,186,
  VA 53,861, MN 228,366 (after dropping 96 application rows), NJ 143,403 (after
  dropping 1,767 application rows and folding 867 reinstatement rows) and ME
  69,011 (after dropping 1,799 application rows). California's file held
  245,059 licenses on 2026-11-11.
- **Size check against the stored snapshot.** In a whole-state `changes` run,
  when a snapshot is stored for the state and this pull holds fewer than 98
  percent as many licenses (licenses on the takedown list are allowed for), the
  state fails with both numbers, emits no events and leaves the stored snapshot
  untouched. This stops a header-only or half-written file from being read as
  thousands of removals. A whole-state `status` run makes the same comparison
  but only logs a warning and adds a note to the state's `VERIFICATION` entry,
  because `status` never replaces a stored snapshot; the state succeeds.
- **When a state really did lose more than 2 percent of its licenses at
  once,** every `changes` run for it fails until you accept the drop. Check the
  source first, then run `changes` once with that state in
  `acceptShrinkStates` (for example `["CA"]`). That run emits the
  `license_removed` events, keeps the removed licenses on the snapshot's list
  of removed licenses (so a return is reported as `reinstated`) and replaces
  the snapshot. It is a one-run override: remove the state from
  `acceptShrinkStates` afterwards, or a later short or half-written file would
  be read as removals too. It never lets an empty pull through. Deleting
  `SNAPSHOT_<STATE>_MANIFEST` by hand instead would lose those removal events
  and the whole list of removed licenses, and would leave the old snapshot's
  records in the store with nothing pointing at them.
- **An empty pull fails.** A whole-state run that finds no licenses at all
  fails the state in every mode.
- **`VERIFICATION` per state:** mode, result and any failure message, rows read
  and written, the source count and the reconciliation, counts by normalized
  status, application, duplicate, reinstatement and malformed rows, status
  values not in the mapping, the source's as-of time, download attempts,
  whether a snapshot was stored (or why not), events by type, and notes (such
  as a `status` pull below 98 percent of the stored snapshot, or a drop
  accepted with `acceptShrinkStates`).
- **California is read from the CSLB's Excel workbook.** The CSLB offers its
  License Master file as an Excel workbook, rebuilt every night, and as a CSV.
  The actor reads only the workbook (56 MB). The CSV is an older cut of the
  data: on 2026-11-11 it held 244,571 licenses against the workbook's 245,059,
  and comparing one with the other would have reported more than 13,000
  changes that never happened.
- **California's download can be cut short.** The CSLB server ends every
  download at 150 seconds whether or not it is complete, with a success
  status, and it does not honor range requests, so a cut download cannot be
  resumed. Its speed swings widely: on 2026-11-11 the workbook arrived in 12
  seconds at one moment and was cut short minutes later. The actor reads a
  workbook only after checking that the archive is whole. Otherwise it starts
  again from the form, up to eight attempts three minutes apart (about 45
  minutes at worst). If no attempt completes, the California state fails with
  a message naming the truncation and writes no rows, no events and no
  snapshot. The other states are not affected. Run California again later,
  alone if you like.
- **California's date.** The download page shows an "Updated as of" date, but
  it is not the workbook's: on 2026-11-11 it said November 6 while the workbook held
  about 5,200 licenses updated on November 9 to 11. The actor therefore reads
  California on every run and gives the time of the read as `source_as_of`.
- **Malformed rows:** a file row of the wrong width is skipped and counted; more
  than 0.1 percent malformed rows fails the state.
- **A failed state** keeps the rows it already wrote, is marked failed in
  `VERIFICATION`, stores no snapshot, and does not stop the other states. This
  includes a failure to write rows or events to the dataset: that state fails,
  the others still run, and `VERIFICATION` is still written.
- **How a run ends when a state fails.** If at least one state succeeded, the
  run ends as succeeded, because its rows are complete for those states. The
  run's status message and a warning in the log name the failed states, and
  `VERIFICATION` has `failed: true` and lists them in `failed_states`. A state
  that failed part way (for example one that did not reconcile) may have left
  rows or events in the dataset. If you load the output automatically, read
  `failed_states` first and drop the output of those states; the next run
  brings it again. There is one exception in `changes` mode: if the failed
  state's message says "writing the snapshot manifest failed", its events may
  not come again, so keep them and remove duplicates on `record_key`,
  `event_type`, `field` and `current_snapshot_as_of`. If a state failed and
  none succeeded, the run ends with a failed status.
- **New Jersey** publishes a second "Reinstatement Pending" row for some
  licenses. The actor keeps one row and puts that text in
  `license_status_secondary`.
- **Run times** measured on Apify on 2026-11-11 at 1024 MB for a whole-state
  `status` run, including the first snapshot where one was stored: NY 20 s,
  VA 1 minute, OR 1.5 minutes, NJ 2.5 minutes, MN 4 minutes, ME 4.5 minutes,
  WA 5.5 minutes, CA 18 minutes (245,059 rows, first download complete). The
  eight states together are about 973,000 rows in about 40 minutes. A
  `changes` run over all eight states the same day took 28 minutes and
  returned 258 events; states whose source had not moved took a second each.
  When California's downloads are cut short it can take up to about 45 minutes
  longer. Set the run timeout to two hours for a run that includes California.
- **Memory:** run with at least 1024 MB (the default and the minimum). The
  highest use measured on Apify was 617 MiB, in the eight-state `changes` run,
  where California holds the previous and the current snapshot.

### Politeness

- One request at a time, at least 250 ms apart per host by default.
- A descriptive User-Agent that names this actor on the open data APIs and the
  Minnesota and Virginia files. The California, New Jersey and Maine pages run
  on ASP.NET, which serves a page without its form script to an agent it does
  not recognize, so those three get a standard browser User-Agent.
- An HTTP 403 or 429, or a page with a captcha, stops that state at once with a
  clear message and no retry. Server errors and timeouts get three attempts
  with growing waits.
- `changes` checks each source's refresh signal first and skips the download
  when nothing has changed.
- No login, no browser, no proxies.

### Source and non-affiliation

The data comes from the Washington State Department of Labor and Industries
(data.wa.gov), the Oregon Construction Contractors Board (data.oregon.gov), the
New York State Department of Labor (data.ny.gov), the California Contractors
State License Board (cslb.ca.gov), the Minnesota Department of Labor and
Industry (secure.doli.state.mn.us), the Maine Department of Professional and Financial
Regulation (pfr.maine.gov), the New Jersey Division of Consumer Affairs
(newjersey.mylicense.com) and the Virginia Department of Professional and
Occupational Regulation (dpor.virginia.gov). This actor reads what each agency
publishes for download. It is not affiliated with, endorsed by or sponsored by
any of them.

Minnesota rows carry `attribution`: "Minnesota Department of Labor and
Industry".

### Personal data

This dataset contains personal data. Many licenses belong to sole proprietors
and individual tradespeople listed under their own names: Washington
individuals, California sole owners, Minnesota personal licenses, and every
Maine license (the Maine export lists individuals only). Mailing addresses may
be home addresses. Minnesota
and Maine include trainee-level licenses (Minnesota "Registered Unlicensed"
registrations; Maine helpers, apprentices and trainees). Phones and emails
appear in the rows as the states publish them; the actor adds nothing to them
and does not check whether they still work. The snapshot store keeps only
whether a phone or an email exists, not the values.

A license can be left out of every row and event with `takedownRecordKeys`;
the actor also ships its own takedown list. A taken-down license is never
stored and never added to the snapshot's list of removed licenses. That list
keeps only record keys, so a name on the takedown list can clear a license
already on it only when the license appears in the source again under that
name; a `takedownRecordKeys` entry for its record key always clears it.

# Changelog

This Actor's version history is a separate document: https://apify.com/overlookdata/multistate-contractor-roster/changelog.md

# Actor input Schema

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

roster: active licenses with their contact details. status: every license the source publishes, active or not, with a normalized status. changes: events (added, removed, reinstated, status, expiry, bond, insurance and workers' comp changes) since the previous whole-state status or changes run in this account. The first changes run for a state stores a baseline and returns nothing; events start with the second.

## `states` (type: `array`):

Which state rosters to read. Leave empty for all eight. States run one after the other.

## `licenseTypes` (type: `array`):

Keep licenses whose license type, type description or trade contains any of these words (case does not matter), for example electric or plumb. In changes mode this narrows the events, not the download.

## `licenseLevels` (type: `array`):

Keep only these levels. Every WA, OR, NY, CA, NJ and VA license is contractor level; MN and ME also have master, journeyman, trainee (helpers, apprentices, registered unlicensed) and other. Empty means all.

## `holderTypes` (type: `array`):

Keep businesses, individuals or both. Oregon does not say which a license is, so Oregon licenses pass only when this is empty.

## `counties` (type: `array`):

Keep licenses in these counties (exact name, case does not matter). Only OR, CA and NJ publish a county.

## `cities` (type: `array`):

Keep licenses in these cities (exact name, case does not matter).

## `zipPrefixes` (type: `array`):

Keep licenses whose ZIP code starts with any of these, for example 981 or 10467.

## `businessNameContains` (type: `string`):

Keep licenses whose business, trade (DBA) or person name contains this text (case does not matter).

## `hasPhone` (type: `boolean`):

Keep only licenses that list a phone number. NJ and VA publish none.

## `hasEmail` (type: `boolean`):

Keep only licenses that list an email address. NJ and VA fill emails; the MN export has an email column that was empty when measured.

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

Stop after this many rows in all, across states. Leave empty for every row. A limited run is not compared with the source's count and stores no snapshot. Not allowed in changes mode.

## `watchList` (type: `array`):

Status and changes modes: only these licenses, as record keys (WA:lni:ECOSTSC758NN) or state and license number (WA:ECOSTSC758NN). In changes mode the whole state is still read and the snapshot still advances; only the events are narrowed. Ignored in roster mode.

## `takedownRecordKeys` (type: `array`):

Record keys to leave out of every row and event, in addition to the list shipped with the actor.

## `requestDelayMs` (type: `integer`):

Minimum time between two requests to one host.

## `acceptShrinkStates` (type: `array`):

Changes mode only. When a state's pull holds fewer than 98 out of every 100 licenses in its stored snapshot, changes fails that state, because a short or half-written source file looks the same. If you have checked that the drop is real, name the state here for one run: the removals are emitted, the removed licenses are kept as removed, and the snapshot is replaced. Remove the state again afterwards. An empty pull still fails.

## Actor input object example

```json
{
  "mode": "roster",
  "states": [
    "NY"
  ],
  "licenseTypes": [],
  "licenseLevels": [],
  "holderTypes": [],
  "counties": [],
  "cities": [],
  "zipPrefixes": [],
  "hasPhone": false,
  "hasEmail": false,
  "maxItems": 200,
  "watchList": [],
  "takedownRecordKeys": [],
  "requestDelayMs": 250,
  "acceptShrinkStates": []
}
```

# Actor output Schema

## `records` (type: `string`):

No description

## `verification` (type: `string`):

No description

# 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 = {
    "states": [
        "NY"
    ],
    "maxItems": 200
};

// Run the Actor and wait for it to finish
const run = await client.actor("overlookdata/multistate-contractor-roster").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 = {
    "states": ["NY"],
    "maxItems": 200,
}

# Run the Actor and wait for it to finish
run = client.actor("overlookdata/multistate-contractor-roster").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 '{
  "states": [
    "NY"
  ],
  "maxItems": 200
}' |
apify call overlookdata/multistate-contractor-roster --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,overlookdata/multistate-contractor-roster"
        }
    }
}
```

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/x9hKJstOF61wLmt7S/builds/hVULsmO0Fd3LW26Zp/openapi.json
