DEV Community

DataForge
DataForge

Posted on

Check a contractor's license, bond and insurance in Python (Washington State open data)

If you hire subcontractors, insure them or sell to them, the same three questions come up: is the license active, is there a bond, is there insurance in force. In Washington State the answers are public. The Department of Labor & Industries (L&I) publishes contractor licenses, bonds and insurance as separate open datasets on data.wa.gov. They are not joined, so checking one contractor means looking in three places.

Disclosure: I built the Actor used below. It reads those official datasets and joins them by license number. It is a lookup helper, not a certificate of compliance. Confirm with L&I before any legal or contractual decision.

Run it

from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("dataforge_api/wa-lni-contractors-bond-ppe").call(run_input={
    "queries": ["roofing"],
    "licenseStatuses": ["ACTIVE"],
    "cities": ["SEATTLE"],
    "licenseTypeCodes": ["CC"],   # construction contractor
    "maxResults": 5,
})
for r in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(r["business_legal_name"], "|", r["bond_company"], r["bond_or_valuation_usd"],
          "|", r["insurance_company"], r["insurance_amount_usd"], r["insurance_expiration_date"])
Enter fullscreen mode Exit fullscreen mode

Real output from this run (trimmed):

ARMANDO ROOF SERVICE LLC      Wesco Insurance Co      15000  Concert Specialty Insurance Co  1000000  2027-01-18
BARDALES CORPORATION ROOFING  Lexon Ins Co            30000  Homesite Insurance Company of   1000000  2027-03-18
B & B ROOFING                 Western Surety Co       15000  Atlantic Casualty Ins Co        1000000  2027-07-07
A BETTER ROOFING COMPANY INC  None                    None   Crum & Forster Specialty Insur  2000000  2027-04-11
BLUE CASTLE ROOFING & EXT LLC Nationwide Mutual Ins Co 30000 TRISURA SPECIALTY INSURANCE CO  1000000  2027-08-24
Enter fullscreen mode Exit fullscreen mode

Two things worth noticing, because they are what a real check has to handle:

  • One contractor (A BETTER ROOFING COMPANY INC) has an active license and insurance but no bond record in the datasets. The Actor leaves the bond fields empty instead of inventing values. Whether that is a data gap or a real missing bond is something you verify with L&I.
  • Bond expiration is often the text "Until Canc" (until cancelled) rather than a date, so do not parse it as a date without a fallback.

Useful filters

  • licenseStatuses: ACTIVE by default. Pass an empty list to include expired, suspended and closed licenses.
  • licenseTypeCodes: for example CC (construction) or EC (electrical).
  • queries: matched against business name, principal, specialty, a UBI number or an exact license number.
  • A free Socrata app token (socrataAppToken) raises the rate limit.

What it does not do

  • Washington State only.
  • No email addresses. Phone is returned where L&I publishes it.
  • Bond and insurance fields are filled only when the contractor has those records in the L&I feeds.
  • Data is as fresh as the L&I open-data updates.

Other states

The same approach works where a state publishes an open dataset. I built Actors for Texas TDLR (electricians and HVAC), Florida DBPR (contractor licenses) and Illinois IDFPR (professional licenses), plus NYC building permits. Their fields differ: for example Texas has no bond data and Illinois publishes only city, state and ZIP. Each Actor's README lists what the source does and does not contain.

Pricing

Pay per record: $0.008 per saved record for Washington (about $8 per 1,000). Empty searches are not charged.

Feedback on missing fields or states is welcome in the Actor's Issues tab. Actor page: https://apify.com/dataforge_api/wa-lni-contractors-bond-ppe

Top comments (0)