# Contractor License Leads (New Licenses and Insurance Renewals) (`benenjoyscoding/contractor-license-leads`) Actor

Newly licensed contractors in Washington, Oregon, Connecticut and New York City, plus Washington and Oregon contractors whose insurance ends soon, with the insurer on file. Read from official state and city open data APIs. Phone numbers where published, one clean schema, only-new mode for schedules.

- **URL**: https://apify.com/benenjoyscoding/contractor-license-leads.md
- **Developed by:** [Ben Becker](https://apify.com/benenjoyscoding) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 contractor delivereds

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 Leads

Get contractors who were just licensed, and contractors whose insurance ends soon, in one clean table, straight from state and city licensing APIs.

A newly licensed contractor needs insurance, a bond, a supplier account, equipment, software, a website and work. A contractor whose policy is about to end is shopping for a new one right now. Insurance agents, surety and bond agents, building supply houses, equipment dealers, lenders and marketing agencies use these lists to reach contractors at the moment they are buying.

### What you get

Each contractor comes back with:

- **Who:** business name, entity type (LLC, corporation and so on), license number, license classes and specialty
- **When:** the date the license was issued, when it expires, and for insurance leads the date the policy ends
- **Insurance and bond:** the insurer, the agency that placed it (Washington), the coverage amount and the end date; the surety company, bond amount and end date (Oregon)
- **Where:** street address, city, state, ZIP, county (Oregon) or borough (New York City), and map coordinates (New York City)
- **How to reach them:** the business phone where the licensing office publishes one (Washington, Oregon, New York City)
- **Source:** the agency, the lead type and a link to the official dataset

Names of owners, principals, responsible managing individuals and other people are never included. Licenses held by a person rather than a company are skipped.

### Lead types

**New licenses.** Contractors licensed in the date range you pick. The default is the last 7 days.

**Insurance ending soon.** Licensed contractors whose insurance on file with the state ends between today and the number of days you pick. The default is 30 days. In Washington, contractors that already filed a newer policy are left out, so the list holds only policies that have not been replaced yet.

### Sources covered

| Source | New licenses | Insurance ending | Phone | Extras |
|---|---|---|---|---|
| Washington Department of Labor & Industries | yes | yes | yes | specialty, insurer and agency |
| Oregon Construction Contractors Board | yes | yes | yes | county, insurer, bond |
| Connecticut Department of Consumer Protection | yes | | | home improvement, new home and trade contractors |
| New York City Department of Consumer and Worker Protection | yes | | yes | home improvement contractors, coordinates |

Each agency updates its data on its own schedule, usually daily. Every run saves a `COVERAGE` record that shows, per source, the date window, how many leads were read, how many matched your filters and how many were delivered.

### How to use it

1. Pick the sources, or leave the list empty for all of them.
2. Pick the lead types: new licenses, insurance ending soon, or both.
3. Set the window: days back for new licenses, days ahead for insurance.
4. Add filters if you want: keywords (roofing, electrical, plumbing), cities, ZIP codes, counties, only with a phone.
5. Run it, then export to CSV, Excel or JSON, or connect it to Google Sheets, Zapier, Make or your CRM.

#### Fresh leads on a schedule

Turn on **Only new leads** and schedule the actor to run every morning. It remembers which leads it already delivered and skips them, so each run gives you only new contractors and you never pay twice for the same lead. An insurance lead counts as new again when the same contractor's next policy comes up for renewal.

If you run several schedules with different filters, give each one its own **Memory name**.

### Example inputs

New roofing contractors in Washington and Oregon this week:

```json
{
  "sources": ["washington", "oregon"],
  "keywords": ["roof"],
  "daysBack": 7
}
```

Contractors whose insurance ends in the next 45 days, with a phone, delivered daily:

```json
{
  "sources": ["washington", "oregon"],
  "leadTypes": ["insurance-expiring"],
  "expiringWithinDays": 45,
  "requirePhone": true,
  "onlyNew": true
}
```

Every new home improvement contractor in Connecticut and New York City last month:

```json
{
  "sources": ["connecticut", "new-york-city"],
  "daysBack": 30
}
```

### Pricing

You pay per contractor delivered. Filters run before you are charged, so contractors you filter out cost nothing. Set **Max leads per run** to cap the cost of any run.

### How it works

Every source is an official government open data portal running the Socrata API, which is built for this kind of automated access. The actor asks each portal only for records in your window, reads them in pages of 1,000, and waits between requests so it stays well inside the portals' public rate limits. No website pages are scraped and no logins are used.

### Notes

- Insurance dates are the ones on file with the state. A contractor may have renewed with its insurer before the state record caught up.
- Oregon lists one row per license endorsement; the actor folds them into one contractor with all its endorsements.
- Connecticut does not publish phone numbers.
- Want another state or city? Ask in the Issues tab.

# Actor input Schema

## `sources` (type: `array`):

Which state and city licensing offices to read. Leave empty for all of them.

## `leadTypes` (type: `array`):

New licenses: contractors licensed in the date range. Insurance ending soon: licensed contractors whose insurance on file ends in the next days you choose (Washington and Oregon). Leave empty for new licenses only.

## `daysBack` (type: `integer`):

Contractors licensed in the last this many days, counting today. Ignored when you set an issued-from date.

## `issuedFrom` (type: `string`):

Optional. Start of a fixed date range, inclusive.

## `issuedTo` (type: `string`):

Optional. End of a fixed date range, inclusive. Defaults to today.

## `expiringWithinDays` (type: `integer`):

For insurance leads: insurance that ends between today and this many days from now.

## `keywords` (type: `array`):

Keep contractors whose name, license class or specialty contains any of these words, for example roofing, electrical or plumbing.

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

Keep contractors in these cities only.

## `zipCodes` (type: `array`):

Keep contractors in these 5-digit ZIP codes only.

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

Oregon counties and New York City boroughs. Other sources do not publish a county.

## `requirePhone` (type: `boolean`):

Washington, Oregon and New York City publish phones. Connecticut will return nothing when this is on.

## `onlyNew` (type: `boolean`):

Remember which leads earlier runs delivered and skip them. Turn this on for a daily or weekly schedule so you only pay for fresh leads.

## `stateStoreName` (type: `string`):

Use a different name per saved task if you run several schedules with different filters.

## `maxResults` (type: `integer`):

Stop after this many leads in total. You pay per lead.

## `maxResultsPerSource` (type: `integer`):

Stop reading a source after this many leads.

## `socrataAppToken` (type: `string`):

A free app token from any Socrata open data portal raises the request rate. Not needed for normal runs.

## Actor input object example

```json
{
  "sources": [
    "washington",
    "oregon"
  ],
  "leadTypes": [
    "new-license"
  ],
  "daysBack": 7,
  "expiringWithinDays": 30,
  "requirePhone": false,
  "onlyNew": false,
  "stateStoreName": "contractor-license-leads-state",
  "maxResults": 100,
  "maxResultsPerSource": 2000
}
```

# Actor output Schema

## `contractors` (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 = {
    "sources": [
        "washington",
        "oregon"
    ],
    "leadTypes": [
        "new-license"
    ],
    "daysBack": 7,
    "maxResults": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("benenjoyscoding/contractor-license-leads").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 = {
    "sources": [
        "washington",
        "oregon",
    ],
    "leadTypes": ["new-license"],
    "daysBack": 7,
    "maxResults": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("benenjoyscoding/contractor-license-leads").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 '{
  "sources": [
    "washington",
    "oregon"
  ],
  "leadTypes": [
    "new-license"
  ],
  "daysBack": 7,
  "maxResults": 100
}' |
apify call benenjoyscoding/contractor-license-leads --silent --output-dataset

```

## MCP server setup

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

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/XIfc4C3YJLXn3gmQo/builds/bGOvAG00NPbkha77S/openapi.json
