# Connecticut Contractor Directory & Leads Scraper (`muhammadafzal/connecticut-contractor-directory-leads-scraper`) Actor

Search Connecticut DCP contractor licenses by trade, status, name, license number, city, ZIP, dates, and public address. Free runs deliver at most 5 records.

- **URL**: https://apify.com/muhammadafzal/connecticut-contractor-directory-leads-scraper.md
- **Developed by:** [Muhammad Afzal](https://apify.com/muhammadafzal) (community)
- **Categories:** Lead generation, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 contractor license records

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## Connecticut Contractor Directory & Leads Scraper

Search and export Connecticut contractor credentials from the official eLicense open dataset for lead research, license verification, compliance checks, and market analysis.

Verified Apify free-plan users receive a maximum of **5 delivered contractor records per run**. The Actor applies this ceiling before querying and before every dataset write; paid and agentic runs can use the requested `maxResults` up to 10,000.

The Actor queries Connecticut Open Data's daily updated copy of the eLicense system. It returns public credential and mailing-address data; it does **not** invent or enrich email addresses, phone numbers, websites, complaint records, or private contact details.

### What it extracts

| Field | Meaning |
|---|---|
| `licenseeName`, `businessName`, `dba` | License holder and available business/trade names |
| `contractorType` | Official contractor credential title |
| `fullCredentialCode`, `credentialNumber` | Connecticut license identifiers |
| `status`, `statusReason`, `isActive` | Current source status and active flag |
| `issueDate`, `effectiveDate`, `expirationDate` | Credential lifecycle dates |
| `address`, `city`, `state`, `zipCode` | Public mailing address from eLicense |
| `recordRefreshedOn` | Date Connecticut refreshed the source row |
| `sourceUrl`, `scrapedAt` | Provenance and extraction timestamp |

### When to use it

Use this Actor to build a Connecticut contractor prospect list by trade and city, verify credentials in bulk, find recently issued licenses, locate licenses nearing expiration, or analyze the licensed-contractor market. Supported trades include home improvement, new-home construction, major contractors, electrical, plumbing, HVAC, fire protection, sheet metal, glass, elevator, mechanical, solar thermal, water/well, demolition, asbestos, and lead work.

Do not use it as a substitute for legal due diligence or as a complaint-history source. Connecticut advises checking the live eLicense portal and contacting DCP for complaint information before hiring. A mailing address may belong to an individual licensee; handle and use public-record data responsibly.

### Input

| Input | Default | Description |
|---|---:|---|
| `contractorTypes` | Home Improvement | One or more supported trades, or `ALL` by itself |
| `licenseStatus` | `ACTIVE_ONLY` | Active flag, exact status, or every status |
| `name` | — | Partial licensee, business, or DBA name |
| `licenseNumber` | — | Exact number or full credential code |
| `city`, `state`, `zipCode` | — | Exact city/state and five-digit ZIP prefix |
| `issuedFrom` | — | Earliest issue date (`YYYY-MM-DD`) |
| `expiresThrough` | — | Latest expiration date (`YYYY-MM-DD`) |
| `maxResults` | 25 | Result and cost cap, 1–10,000 (free users: maximum 5 delivered records) |

Example: active electrical contractors in New Haven:

```json
{
  "contractorTypes": ["ELECTRICAL"],
  "licenseStatus": "ACTIVE_ONLY",
  "city": "NEW HAVEN",
  "maxResults": 100
}
```

Example: recently issued home-improvement contractors statewide:

```json
{
  "contractorTypes": ["HOME_IMPROVEMENT"],
  "licenseStatus": "ACTIVE_ONLY",
  "issuedFrom": "2026-01-01",
  "maxResults": 250
}
```

Run with the Apify API:

```bash
curl -X POST "https://api.apify.com/v2/acts/YOUR_ACTOR_ID/runs" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"contractorTypes":["PLUMBING"],"city":"HARTFORD","maxResults":50}'
```

### Output example

```json
{
  "credentialId": "123456",
  "licenseeName": "ACME BUILDERS LLC",
  "entityType": "LIMITED LIABILITY COMPANY",
  "businessName": "ACME BUILDERS LLC",
  "dba": "ACME REMODELING",
  "fullCredentialCode": "HIC.0123456",
  "credentialType": "HIC",
  "credentialNumber": "123456",
  "credentialSubcategory": null,
  "contractorType": "HOME IMPROVEMENT CONTRACTOR",
  "status": "ACTIVE",
  "statusReason": "CURRENT",
  "isActive": true,
  "issueDate": "2024-01-15",
  "effectiveDate": "2026-01-01",
  "expirationDate": "2027-03-31",
  "address": "123 MAIN ST",
  "city": "HARTFORD",
  "state": "CT",
  "zipCode": "06103",
  "recordRefreshedOn": "2026-09-10",
  "sourceDatasetId": "ngch-56tr",
  "sourceUrl": "https://data.ct.gov/d/ngch-56tr",
  "scrapedAt": "2026-09-12T12:00:00.000Z"
}
```

Records are written to the default dataset. `SUMMARY` in the default key-value store records whether the outcome was `DATA`, `EMPTY`, `REJECTED`, or `FAILED`, plus source freshness, pages, counts, and warnings.

### Pricing

This Actor uses pay per event:

| Event | Price |
|---|---:|
| Actor start | $0.00005 per run |
| Contractor record | $0.0005 per delivered row |

A 25-result run costs about **$0.01255** in event charges; 100 results cost about **$0.05005**. `maxResults` bounds the number of paid record events. Platform pricing settings are the final authority.

Free-plan runs are capped at five delivered records, so a request for `maxResults: 25` is billed for no more than five records plus the start event. The run status and `SUMMARY` record state when this cap was applied and explain that upgrading to an Apify paid plan removes this per-run ceiling.

### Reliability and limits

The Actor uses the official Connecticut Open Data API rather than automating the slower eLicense search form. Requests use deterministic server-side filters, stable credential-ID pagination, bounded retries, deduplication, schema validation before delivery, and a 10,000-record run limit. The default 25-result input is designed to complete well inside Apify's automated health-test window.

The source is described by Connecticut as updated daily, but individual fields can be blank and updates are controlled by the state. `ACTIVE_ONLY` follows the source's `active` flag; use the exact status filters if your workflow depends on the displayed status text. When no rows match, the Actor returns an empty dataset and a truthful `EMPTY` summary without record charges.

### Data source and responsible use

Source: Connecticut Open Data, **State Licenses and Credentials** (`ngch-56tr`), attributed to the Department of Administrative Services and Department of Consumer Protection and published as public-domain data. The eLicense portal remains the primary verification interface.

Comply with applicable privacy, outreach, anti-spam, and consumer-protection laws. Do not infer endorsement, complaint history, service quality, or availability from the presence of a credential. Verify time-sensitive decisions with Connecticut DCP.

# Actor input Schema

## `contractorTypes` (type: `array`):

Use this to select one or more contractor trades. Leave empty for every credential whose official title contains Contractor. Example: Home Improvement and Electrical.

## `licenseStatus` (type: `string`):

Use this to filter the official status. ACTIVE\_ONLY uses the source's active flag; APPROVED, ACTIVE, INACTIVE, or PENDING match exact status text. Default ACTIVE\_ONLY.

## `name` (type: `string`):

Use this for a case-insensitive partial match across licensee name, legal business name, and DBA. Example: `ACME`. Maximum 100 characters.

## `licenseNumber` (type: `string`):

Use this for an exact credential number or full credential code. Examples: `123456` or `HIC.0123456`. Punctuation is accepted; maximum 40 characters.

## `city` (type: `string`):

Use this for an exact mailing city, such as `HARTFORD`. Matching is case-insensitive. Leave empty for all cities.

## `state` (type: `string`):

Use this for a two-letter mailing-state code, such as `CT`. This is the licensee address and may be outside Connecticut.

## `zipCode` (type: `string`):

Use this for a 5-digit ZIP prefix, such as `06103`. ZIP+4 values in the source are included. Leave empty for all ZIP codes.

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

Use this for credentials first issued on or after an ISO date, such as `2024-01-01`. This is not the effective or expiration date.

## `expiresThrough` (type: `string`):

Use this for credentials expiring on or before an ISO date, such as `2027-12-31`. Records with no expiration date are excluded.

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

Use this to cap delivered records and pay-per-event cost. Default 25; minimum 1 and maximum 10,000 per run. Verified free-plan users are capped at 5 delivered records even when a higher value is requested; paid/agentic runs are not capped by this rule.

## Actor input object example

```json
{
  "contractorTypes": [
    "HOME_IMPROVEMENT"
  ],
  "licenseStatus": "ACTIVE_ONLY",
  "maxResults": 25
}
```

# Actor output Schema

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

Contractor licenses written to the default dataset.

## `dataset` (type: `string`):

Default dataset in Apify Console.

## `summary` (type: `string`):

Outcome, source freshness, counts, and warnings.

# 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 = {
    "contractorTypes": [
        "HOME_IMPROVEMENT"
    ],
    "licenseStatus": "ACTIVE_ONLY",
    "maxResults": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("muhammadafzal/connecticut-contractor-directory-leads-scraper").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 = {
    "contractorTypes": ["HOME_IMPROVEMENT"],
    "licenseStatus": "ACTIVE_ONLY",
    "maxResults": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("muhammadafzal/connecticut-contractor-directory-leads-scraper").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 '{
  "contractorTypes": [
    "HOME_IMPROVEMENT"
  ],
  "licenseStatus": "ACTIVE_ONLY",
  "maxResults": 25
}' |
apify call muhammadafzal/connecticut-contractor-directory-leads-scraper --silent --output-dataset

```

## MCP server setup

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

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/PLyehY3ISz0WxV35q/builds/20EsdL687h2k6dGTG/openapi.json
