# Contractor License Verify (`fidelem/license-verify`) Actor

The only MCP-native, agent-payable contractor license check that returns OFFICIAL bond + insurance, not just status. WA live (official L\&I) · CA beta (CSLB). Pay-per-success $0.03, no charge on a miss. Normalized JSON for vetting, booking & onboarding agents.

- **URL**: https://apify.com/fidelem/license-verify.md
- **Developed by:** [fidele maniraruta](https://apify.com/fidelem) (community)
- **Categories:** Agents, Developer tools, Lead generation
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $30.00 / 1,000 license verifications

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## license-verify-mcp

Verify contractor license status mid-task. Returns normalized JSON with `active|expired|suspended|revoked` status, bond details, and insurance. Two delivery modes: **MCP server** (stdio, for Claude/agent use) and **Apify Actor** (pay-per-event, agentic-payments eligible).

---

### Jurisdictions

| State | Status | Source | Bond + Insurance |
|---|---|---|---|
| **WA** | ✅ Live | WA L&I open data (data.wa.gov) | ✅ Real data (bzff-4fmt + ciwg-agsx datasets) |
| **CA** | ⚠️ Beta | CSLB HTML (cslb.ca.gov) | ✅ Parsed when CSLB is up |

**Washington is the reliable, production-ready jurisdiction.** Official WA L&I open data is served via Socrata JSON — no scraping, no rate limits, bond and insurance data included from dedicated datasets.

**California is beta.** CSLB does not publish an open API; the provider fetches the HTML detail page directly. CSLB rate-limits or 503s automated requests intermittently. When unavailable, `verify_license` returns a clean `SESSION_ERROR` — **you are never charged on source failures.** Do not rely on CA for production workflows until a stable server-side CSLB run is confirmed.

---

### Apify Actor

**Agentic-payments eligible** — pay-per-event pricing + limited permissions + no Standby mode.

#### Pricing

| Event | Price |
|---|---|
| `license-verification` | **$0.03 per lookup** |

Charged **only on `found: true`**. Validation errors, not-found results, and source failures are not charged.

#### Input

```json
{
  "jurisdiction": "WA",
  "license_number": "ECOSTSC758NN"
}
````

| Field | Type | Required | Notes |
|---|---|---|---|
| `jurisdiction` | `"WA" \| "CA"` | ✅ | WA = live; CA = beta |
| `license_number` | string | one of ↓ | WA: alphanumeric. CA: numeric, ≤8 digits |
| `business_name` | string | one of ↑ | WA only. Partial match, may return `matches[]` |

#### Output (default dataset)

```json
{
  "found": true,
  "jurisdiction": "WA",
  "query": { "license_number": "ECOSTSC758NN" },
  "result": {
    "license_number": "ECOSTSC758NN",
    "business_name": "!ECO STAR C G CONSTRUCTION LLC",
    "status": "active",
    "license_type": "CONSTRUCTION CONTRACTOR",
    "bonded": {
      "is_bonded": true,
      "details": "Surety: NORTH RIVER INSURANCE COMPANY THE; Bond #: 46CF842686; Amount: $30,000; Effective: 2025-08-05; Expires: Until Canceled"
    },
    "insured": {
      "has_insurance": true,
      "details": "Carrier: State National Ins Co Inc; Policy: NXT9PTHTLT-01-GL; Coverage: $1,000,000; Agency: Next Insurance Inc; Effective: 2026-06-12; Expires: 2027-06-12"
    },
    "effective_date": "2025-08-15",
    "expiration_date": "2027-08-15"
  },
  "source_url": "https://data.wa.gov/resource/m8qx-ubtq",
  "retrieved_at": "2026-06-26T01:34:37.598Z",
  "raw": { ... }
}
```

`status` is always one of: `active` | `expired` | `suspended` | `revoked` | `unknown`.

On failure: `{ "found": false, "error": "SESSION_ERROR|NETWORK_ERROR|...", "message": "..." }` — never a crash, never a charge.

#### Local test

```bash
npm install
npm run build
echo '{"jurisdiction":"WA","license_number":"ECOSTSC758NN"}' \
  > storage/key_value_stores/default/INPUT.json
npx apify run
```

***

### MCP Server (stdio)

For use with Claude Desktop, Smithery, or any MCP-compatible agent.

#### Tools

**`verify_license`** — verify a contractor's license status.

- `jurisdiction` (required): `"WA"` or `"CA"`
- `license_number` and/or `business_name` (at least one required)

**`list_supported_jurisdictions`** — list all states with their status and data source.

#### Config (Claude Desktop)

```json
{
  "mcpServers": {
    "license-verify": {
      "command": "node",
      "args": ["/absolute/path/to/license-verify-mcp/dist/index.js"]
    }
  }
}
```

#### Run

```bash
npm install && npm run build
npm run start:mcp   # stdio MCP server
npm run smoke       # hit real WA + CA endpoints, must be 8/8 PASS
```

***

### Adding a State

1. Create `src/providers/<CODE>.ts` implementing the `Provider` interface (`{ info, verify() }`)
2. Register it in `src/providers/index.ts`

No other changes needed in server or Actor.

### License

MIT

# Actor input Schema

## `jurisdiction` (type: `string`):

Two-letter US state code. WA is fully live and reliable. CA is beta — returns a clean SESSION\_ERROR if CSLB is unavailable; you are never charged on source failures.

## `license_number` (type: `string`):

Contractor license or registration number. WA: alphanumeric (e.g. ECOSTSC758NN). CA: numeric only, up to 8 digits (e.g. 1100000). Exact match, case-insensitive. Preferred over business\_name for precision.

## `business_name` (type: `string`):

Business name or partial name for WA lookups. Case-insensitive partial match — may return multiple results. CA requires license\_number instead.

## Actor input object example

```json
{
  "jurisdiction": "WA",
  "license_number": "ECOSTSC758NN"
}
```

# 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 = {
    "jurisdiction": "WA",
    "license_number": "ECOSTSC758NN"
};

// Run the Actor and wait for it to finish
const run = await client.actor("fidelem/license-verify").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 = {
    "jurisdiction": "WA",
    "license_number": "ECOSTSC758NN",
}

# Run the Actor and wait for it to finish
run = client.actor("fidelem/license-verify").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "jurisdiction": "WA",
  "license_number": "ECOSTSC758NN"
}' |
apify call fidelem/license-verify --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=fidelem/license-verify",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Contractor License Verify",
        "description": "The only MCP-native, agent-payable contractor license check that returns OFFICIAL bond + insurance, not just status. WA live (official L&I) · CA beta (CSLB). Pay-per-success $0.03, no charge on a miss. Normalized JSON for vetting, booking & onboarding agents.",
        "version": "0.1",
        "x-build-id": "c5S2dM9r2QqvOB2m5"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/fidelem~license-verify/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-fidelem-license-verify",
                "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/fidelem~license-verify/runs": {
            "post": {
                "operationId": "runs-sync-fidelem-license-verify",
                "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/fidelem~license-verify/run-sync": {
            "post": {
                "operationId": "run-sync-fidelem-license-verify",
                "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": [
                    "jurisdiction"
                ],
                "properties": {
                    "jurisdiction": {
                        "title": "Jurisdiction (State)",
                        "enum": [
                            "WA",
                            "CA"
                        ],
                        "type": "string",
                        "description": "Two-letter US state code. WA is fully live and reliable. CA is beta — returns a clean SESSION_ERROR if CSLB is unavailable; you are never charged on source failures.",
                        "default": "WA"
                    },
                    "license_number": {
                        "title": "License / Registration Number",
                        "type": "string",
                        "description": "Contractor license or registration number. WA: alphanumeric (e.g. ECOSTSC758NN). CA: numeric only, up to 8 digits (e.g. 1100000). Exact match, case-insensitive. Preferred over business_name for precision."
                    },
                    "business_name": {
                        "title": "Business Name (WA only)",
                        "type": "string",
                        "description": "Business name or partial name for WA lookups. Case-insensitive partial match — may return multiple results. CA requires license_number instead."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
