# US Contractor License, Bond & Workers' Comp Verifier (MCP) (`ramosdeluis/us-contractor-license-verifier`) Actor

Verify US contractor licenses across CA (CSLB, incl. surety bond & workers' comp), TX (TDLR), WA (L\&I), and FL (DBPR). Accepts 1-100 queries via batch API or Apify MCP Server, returning sanitized JSON with status enums (ACTIVE/EXPIRED/NOT_FOUND). Pay only for verified hits.

- **URL**: https://apify.com/ramosdeluis/us-contractor-license-verifier.md
- **Developed by:** [Luís Alberto Ramos](https://apify.com/ramosdeluis) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $15.00 / 1,000 contractor license verification

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

Learn more: https://docs.apify.com/actors/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

## US Multi-State Contractor License, Bond & Workers' Comp Verifier

Verify US contractor licenses across **California (CA CSLB)**, **Texas (TX TDLR)**, **Washington (WA L\&I)**, and **Florida (FL DBPR)**—including **surety bonds** and **workers' compensation** coverage/exemptions for California CSLB—in a single normalized, MCP-native JSON API.

Built for **AI Agents (Apify MCP Server)**, **InsurTech underwriting**, **commercial GC vendor onboarding**, and **home-improvement marketplaces**.

***

### Why Use This Actor?

- **4 Priority US States, 1 Canonical Schema:** Eliminates brittle per-state scrapers across ASP.NET WebForms (CA), Socrata Open Data APIs (TX, WA), and geo-restricted portals (FL).
- **MCP-Safe by Design:** Strict JSON Schema (`queries` required, zero `required`+`default` collisions, zero silent empty runs) so LLMs get deterministic tool validation and structured JSON responses.
- **Anti-Prompt-Injection Sanitized:** Every untrusted string scraped from state portals passes through NFKC normalization, Unicode homoglyph/bidi stripping, and fixed-point prompt-injection neutralization before leaving the Actor.
- **Sub-Second Cached Lookups:** Built-in Upstash Redis caching (24h TTL for verified records, 6h TTL for confirmed `NOT_FOUND`, never caching errors) with `bypass_cache` override.
- **Fair Pay-Per-Event (PPE) Billing:** You are charged **only** after a record passes strict Pydantic v2 validation (`ACTIVE`, `INACTIVE`, `EXPIRED`, `SUSPENDED`, `REVOKED`, or confirmed `NOT_FOUND`). **Zero charges** on timeouts, upstream 5xx errors, or anti-bot blocks.

***

### Supported Jurisdictions & Extracted Coverage

| State | Licensing Authority | Source Protocol | Extracted Fields |
| :--- | :--- | :--- | :--- |
| **CA** | Contractors State License Board (CSLB) | ASP.NET WebForms (`www.cslb.ca.gov`) | Status, classifications, issue/expiration dates, **Contractor's Bond** (surety, number, USD amount, effective date), **Workers' Comp** (carrier, policy #, exemption status) |
| **TX** | Dept. of Licensing & Regulation (TDLR) | Socrata Open Data (`data.texas.gov`) | License #, type/subtype, status, business name, owner/principal, county, expiration date |
| **WA** | Dept. of Labor & Industries (L\&I) | Socrata Open Data (`data.wa.gov`, dataset `m8qx-ubtq`) | Registration #, status (active/suspended), business name, primary principal, license type & specialty, effective/expiration dates *(bond/GL/WC not published in `m8qx-ubtq`)* |
| **FL** | Dept. of Business & Professional Regulation (DBPR) | Portal (`www.myfloridalicense.com` via US Residential Proxy) | License #, category, **primary & secondary status**, business/DBA name, **qualifying individual**, effective/expiration dates |

***

### Input Format

Pass `queries` (1 to 100 items per run). Every item requires `state` (`CA`, `TX`, `WA`, or `FL`) plus `license_number` (or `business_name` for TX/WA).

```json
{
  "queries": [
    { "state": "CA", "license_number": "1050000" },
    { "state": "TX", "license_number": "192" },
    { "state": "WA", "license_number": "ECOSTSC758NN" },
    { "state": "FL", "license_number": "CGC1529012" }
  ],
  "bypass_cache": false,
  "max_concurrency": 4
}
```

| Field | Type | Required | Default | Description |
| :--- | :--- | :---: | :---: | :--- |
| `queries` | `array<object>` | Yes | *(none)* | 1–100 contractor verification requests (`state` + `license_number` or `business_name`). |
| `bypass_cache` | `boolean` | No | `false` | Skip Redis cache and query official state portals directly. |
| `max_concurrency` | `integer` | No | `4` | Concurrent upstream lookups per batch (`1`–`10`). |

***

### Output Dataset Schema

100% aligned with `.actor/dataset_schema.json` and validated by Pydantic v2:

| Field | Type | Description |
| :--- | :--- | :--- |
| `state` | `"CA" \| "TX" \| "WA" \| "FL"` | Two-letter US state code. |
| `source` | `"CA_CSLB" \| "TX_TDLR" \| "WA_LNI" \| "FL_DBPR"` | Official state licensing authority queried. |
| `license_number` | `string` | Sanitized official license/registration number. |
| `normalized_license_id` | `string` | Deterministic uppercase alphanumeric ID (`v1:license:{STATE}:{ID}`). |
| `status` | `enum` | Canonical status: `ACTIVE`, `INACTIVE`, `EXPIRED`, `SUSPENDED`, `REVOKED`, `NOT_FOUND`, `UNKNOWN`. |
| `raw_status` | `string \| null` | Sanitized original primary status text from the state portal. |
| `secondary_status` | `string \| null` | Sanitized secondary/sub-status text (e.g., FL DBPR `Voluntary Inactive`). |
| `business_name` | `string \| null` | Sanitized contractor business or DBA name. |
| `principal_or_qualifier` | `string \| null` | Sanitized primary principal, owner, or qualifying agent name. |
| `license_type` | `string \| null` | Primary license category or registration type. |
| `classifications` | `array<string>` | Sanitized trade classifications or specialties (e.g., `B - General Building`). |
| `county` | `string \| null` | Business county reported by the authority (no residential street address). |
| `issue_date` | `string (date) \| null` | ISO-8601 license issue or effective date (`YYYY-MM-DD`). |
| `expiration_date` | `string (date) \| null` | ISO-8601 license expiration date (`YYYY-MM-DD`). |
| `bond` | `object \| null` | Surety bond details when published by the authority (CA CSLB: `bond_type`, `bond_number`, `surety_company`, `amount_usd`, `effective_date`, `expiration_date`, `status`). |
| `workers_comp` | `object \| null` | Workers' comp details when published by the authority (CA CSLB: `status`: `INSURED \| EXEMPT \| NOT_REQUIRED \| NONE \| UNKNOWN`, `is_exempt`, `exemption_reason`, `carrier_name`, `policy_number`, `effective_date`, `expiration_date`, `raw_status`). |
| `general_liability_insured` | `boolean \| null` | General liability insurance indicator when reported by the state authority (`null` when not published in the official open dataset). |
| `cache_hit` | `boolean` | `true` if served from Redis cache; `false` if fetched live. |
| `verified_at` | `string (date-time)` | UTC ISO-8601 verification timestamp. |

#### Example Output Item (California CSLB)

```json
{
  "state": "CA",
  "source": "CA_CSLB",
  "license_number": "1050000",
  "normalized_license_id": "1050000",
  "status": "ACTIVE",
  "raw_status": "This license is active.",
  "secondary_status": null,
  "business_name": "PACIFIC COAST BUILDERS INC",
  "principal_or_qualifier": null,
  "license_type": "B - General Building",
  "classifications": ["B - General Building", "C-10 - Electrical"],
  "county": null,
  "issue_date": "2019-01-15",
  "expiration_date": "2027-01-31",
  "bond": {
    "bond_type": "Contractor's Bond",
    "bond_number": "BND-CA-88912",
    "surety_company": "SURETEC INDEMNITY COMPANY",
    "amount_usd": "25000",
    "effective_date": "2023-01-01",
    "expiration_date": null,
    "status": null
  },
  "workers_comp": {
    "status": "INSURED",
    "is_exempt": false,
    "exemption_reason": null,
    "carrier_name": "STATE COMPENSATION INSURANCE FUND",
    "policy_number": "WC-9001122",
    "effective_date": "2025-01-01",
    "expiration_date": "2027-01-01",
    "raw_status": "This license has workers compensation insurance..."
  },
  "general_liability_insured": null,
  "cache_hit": false,
  "verified_at": "2026-11-27T02:00:00Z"
}
```

***

### Integrations (MCP, AI Agents & Automation)

#### 1. Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "us-contractor-verifier": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://mcp.apify.com/?actors=ramosdeluis/us-contractor-license-verifier",
        "--header",
        "Authorization: Bearer ${APIFY_TOKEN}"
      ],
      "env": {
        "APIFY_TOKEN": "<YOUR_APIFY_TOKEN>"
      }
    }
  }
}
```

#### 2. Cursor (`.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "us-contractor-verifier": {
      "url": "https://mcp.apify.com/?actors=ramosdeluis/us-contractor-license-verifier",
      "headers": {
        "Authorization": "Bearer <YOUR_APIFY_TOKEN>"
      }
    }
  }
}
```

#### 3. LangGraph / Python (`apify-client`)

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("ramosdeluis/us-contractor-license-verifier").call(
    run_input={
        "queries": [
            {"state": "CA", "license_number": "1050000"},
            {"state": "WA", "license_number": "ECOSTSC758NN"},
        ]
    }
)
records = list(client.dataset(run["defaultDatasetId"]).iterate_items())
```

#### 4. n8n Workflow Automation

Import the ready-to-use workflow from `marketing/n8n_workflow_template.json` or call the synchronous endpoint from an **HTTP Request** node:

- **Method:** `POST`
- **URL:** `https://api.apify.com/v2/acts/ramosdeluis~us-contractor-license-verifier/run-sync-get-dataset-items`
- **Headers:** `Authorization: Bearer {{$env.APIFY_TOKEN}}`, `Content-Type: application/json`

#### 5. Autonomous Agent Payments (`x402`)

Autonomous AI agents supporting the **x402** HTTP payment protocol can gate per-verification calls via an x402-compatible Apify/MCP gateway, settling micro-payments (USDC) directly per `license-verification-hit` event without pre-provisioned enterprise contracts.

***

### Pay-Per-Event (PPE) Pricing

Simple per-verification pricing via `license-verification-hit` (no monthly platform minimums beyond your Apify plan):

| Apify Tier | Event Name | Price per Verified License | Unbilled Scenarios |
| :--- | :--- | :---: | :--- |
| **Bronze** (Free / Starter) | `license-verification-hit` | **$0.05** | Timeouts, HTTP 5xx, WAF/anti-bot blocks, invalid inputs |
| **Silver** (Scale) | `license-verification-hit` | **$0.035** | Timeouts, HTTP 5xx, WAF/anti-bot blocks, invalid inputs |
| **Gold** (Business / Enterprise) | `license-verification-hit` | **$0.02** | Timeouts, HTTP 5xx, WAF/anti-bot blocks, invalid inputs |

> **Budget Guardrail:** Respects Apify's `maxTotalChargeUsd` (`event_charge_limit_reached`), halting remaining batch items immediately when your budget ceiling is reached.

***

### Privacy, Security & Compliance Notice

- **Public Records Only:** Retrieves exclusively publicly available licensing, surety bond, and workers' compensation status records published by US state licensing boards (`cslb.ca.gov`, `data.texas.gov`, `data.wa.gov`, `myfloridalicense.com`).
- **PII Minimization:** Intentionally excludes personal residential street addresses, SSNs/EINs, personal emails, and personal phone numbers from output schemas, logs, and telemetry.
- **Not Legal or Underwriting Advice:** Official state databases may experience agency-side processing delays. Always confirm final legal or insurance binding decisions directly with the issuing state licensing board or carrier.

# Actor input Schema

## `queries` (type: `array`):

List of 1 to 100 contractor verification queries. Each item requires a US state (CA, TX, WA, or FL) and a license_number (or business_name for TX/WA).

## `bypass_cache` (type: `boolean`):

When enabled, skips the Redis cache and queries official state licensing portals directly.

## `max_concurrency` (type: `integer`):

Maximum number of concurrent state portal lookups per batch (1 to 10).

## Actor input object example

```json
{
  "queries": [
    {
      "state": "CA",
      "license_number": "1050000"
    },
    {
      "state": "TX",
      "license_number": "192"
    },
    {
      "state": "WA",
      "license_number": "ECOSTSC758NN"
    }
  ],
  "bypass_cache": false,
  "max_concurrency": 4
}
```

# Actor output Schema

## `results` (type: `string`):

Normalized, sanitized contractor license, surety bond, and workers' compensation verification records across CA, TX, WA, and FL.

# 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 = {
    "queries": [
        {
            "state": "CA",
            "license_number": "1050000"
        },
        {
            "state": "TX",
            "license_number": "192"
        },
        {
            "state": "WA",
            "license_number": "ECOSTSC758NN"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ramosdeluis/us-contractor-license-verifier").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 = { "queries": [
        {
            "state": "CA",
            "license_number": "1050000",
        },
        {
            "state": "TX",
            "license_number": "192",
        },
        {
            "state": "WA",
            "license_number": "ECOSTSC758NN",
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("ramosdeluis/us-contractor-license-verifier").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 '{
  "queries": [
    {
      "state": "CA",
      "license_number": "1050000"
    },
    {
      "state": "TX",
      "license_number": "192"
    },
    {
      "state": "WA",
      "license_number": "ECOSTSC758NN"
    }
  ]
}' |
apify call ramosdeluis/us-contractor-license-verifier --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ramosdeluis/us-contractor-license-verifier"
        }
    }
}
```

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/IhhoJzqBnbjLxbntQ/builds/Zh2FCuLKYsb3p00bg/openapi.json
