# Minnesota Contractor Licenses - DLI Trades Register (`j0401/mn-dli-contractors`) Actor

Minnesota DLI construction trades license register (259k rows, public data): electricians, plumbers, boiler and high-pressure-piping engineers, residential contractors and more. Search by name, type, subtype, status or city, look up a license, screen enforcement actions.

- **URL**: https://apify.com/j0401/mn-dli-contractors.md
- **Developed by:** [Wenhao Yang](https://apify.com/j0401) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.03 / 1,000 minnesota construction trades 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Minnesota Contractor Licenses - DLI Construction Trades Register

The Minnesota Department of Labor and Industry (DLI) publishes its **entire current construction trades license register** as public data - every electrician, plumber, boiler and high-pressure-piping engineer, residential contractor and more - refreshed continuously. This actor turns that register into a **charged-per-record lookup and screening tool**.

**Built for:** contractor and tradesman due diligence - verifying that an electrician, plumber or builder actually holds a current Minnesota license, screening **enforcement actions**, checking license expiration and status, and statewide trade-market sizing.

### What it covers

**259,243 license records** (current register):

| License type | Rows |
|---|---|
| Electrical | 109,837 |
| Residential Contractors | 59,290 |
| Plumbing | 36,923 |
| Boiler | 34,973 |
| High Pressure Piping | 7,493 |
| Mechanical Contractor Bond | 5,362 |
| Elevator | 1,946 |
| Building Officials | 1,113 |
| Water Conditioning | 1,061 |
| Continuing Education | 1,005 |
| Manufactured Structures | 240 |

Across **78 license subtypes** - master and journeyworker electricians and plumbers, registered (unlicensed) electricians, power-limited technicians, special engineers, qualifying builders and remodelers, building officials, backflow-prevention testers, elevator constructors and more.

Every row carries the licensee or business name, **doing-business-as** name, license number, **license type and subtype**, mailing address, city, state, ZIP, phone, **status**, original and expiration dates, an **enforcement-action flag**, and a renewal-in-progress marker. Dates come through as clean ISO (`YYYY-MM-DD`).

> **Two things this actor fixes from the raw file.** First, DLI ships each status in **mixed case** - `Expired` *and* `EXPIRED`, `Issued` *and* `ISSUED`, `Suspended` *and* `SUSPENDED` - so a naive filter silently splits a facet. This actor ships a **normalized** status (`Issued`, `Expired`, `Licensed`, `Revoked`, `Suspended`, `Voluntary Termination`, `Denied`, `Withdrawn`) and filters and aggregates on that. Second, `Enforcement_Action` is a genuine public flag - **3,759 records (~1.5%)** carry a DLI enforcement action.

### Typical questions

- "Is this electrician's or plumber's license **current** - and has DLI taken an **enforcement action**?"
- "Show every **Class A Master Electrician in Minneapolis**."
- "Which **residential building contractors in Minnesota** hold a current license?"
- "Look up license **PJ064542**."
- "Find every trade license with an **enforcement action** on record."
- "How are Minnesota trades licenses **distributed by type and status**?"

### Inputs

| Input | What it does |
|---|---|
| `licenseNumber` | exact license number -> that licensee's row, e.g. `PJ064542` |
| `name` | licensee or DBA name substring, case-insensitive |
| `licenseType` | the trade (Electrical, Plumbing, Boiler, Residential Contractors ) |
| `licenseSubtype` | exact credential, e.g. `Class A Master Electrician`, `Journeyworker Plumber` |
| `busPers` | Personal (individual) or Business (entity) |
| `status` | canonical status - Issued / Expired / Licensed / Revoked / Suspended /  |
| `enforcementAction` | true = only records with a DLI enforcement action |
| `city` / `state` / `zipCode` | location filters (out-of-state licensees carry their home state) |
| `aggregate` / `groupBy` | one summary row per group with a count - type / subtype / status / business-or-personal / state |
| `maxResults` | cap records (default 200) |

**Default run = a tiny aggregate** (license-type mix) - fast and safe for the daily auto-test, never a surprise full dump. For records, add a `name` / `licenseType` / `city` filter or a `licenseNumber`.

### Example inputs

**Look up one license number** - a bare number returns that licensee's row.

```json
{ "licenseNumber": "PJ064542" }
```

**Master electricians in Minneapolis** -

```json
{ "licenseSubtype": "Class A Master Electrician", "city": "Minneapolis", "maxResults": 10 }
```

**Screen enforcement actions** - `enforcementAction=true` returns every license carrying a DLI action.

```json
{ "enforcementAction": true, "maxResults": 10 }
```

**The license-type mix** - one summary row per trade, across the register.

```json
{ "aggregate": true, "groupBy": "licenseType", "maxResults": 10 }
```

### Low cost

**From $0.00005 per record, down to $0.00003 at Gold** - billed only for the rows you use, and each record is metered individually.

Minnesota's register is a **51 MB flat CSV** with no query server behind it - there is no way to ask the state for "just Minneapolis master electricians". Rather than make every lookup pay for a full-register download, the register is **mirrored**, and each run queries the mirror in a single pass. That mirror is what lets a 259,243-row register behave like a live lookup at per-record pricing. Every pull is integrity-checked against the register's known shape (total count, type floors, the closed type vocabulary, the status vocabulary, license-number uniqueness, key-column coverage), so a degraded or schema-changed source **fails loudly** instead of returning bad rows.

### Example output

**`licenseNumber=PJ064542`** - a journeyworker plumber:

```json
{
 "platform": "mn-dli",
 "source": "mn-dli-licenses",
 "jurisdiction": "MN",
 "licenseNumber": "PJ064542",
 "busPers": "Personal",
 "licenseType": "Plumbing",
 "licenseSubtype": "Journeyworker Plumber",
 "name": "ADAM J OTIS",
 "dbaName": "",
 "address1": "120 MINNESOTA ST WEST",
 "address2": "",
 "city": "Cannon Falls",
 "state": "MN",
 "zipCode": "55009",
 "phone": "701230998_",
 "status": "Issued",
 "statusNormalized": "Issued",
 "originalDate": "2021-09-15",
 "expirationDate": "2027-12-31",
 "enforcementAction": "0",
 "renewalInProgress": "",
 "refreshed": "2026-10-07",
 "mode": "record",
 "groupKey": "",
 "groupCount": ""
}
```

**`aggregate=true`, `groupBy=licenseType`** - the register's trade mix:

```
Electrical                    109,837
Residential Contractors        59,290
Plumbing                       36,923
Boiler                         34,973
High Pressure Piping            7,493
```

### Source

- [Minnesota DLI Construction Codes and Licensing data](https://secure.doli.state.mn.us/ccld/) - the official public license register this actor reads.
- License data is DLI's own published register; it reflects the state's record as of the refresh.

# Actor input Schema

## `mode` (type: `string`):

lookup = one license number's row. aggregate = one row per group. Leave blank to auto-route: a bare licenseNumber -> lookup, otherwise search (or aggregate when aggregate=true).

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

Exact DLI license number, e.g. "PJ064542" (plumber), "AM008817" (master electrician), "RT808147". Case-insensitive.

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

Licensee or doing-business-as name, substring, case-insensitive. E.g. "JOHNSON" or "BENJAMIN FRANKLIN PLUMBING".

## `licenseType` (type: `string`):

The trade. Blank = all. Electrical is the largest; Residential Contractors covers builders and remodelers.

## `licenseSubtype` (type: `string`):

Exact subtype, e.g. "Class A Master Electrician", "Journeyworker Plumber", "Residential Building Contractor", "Qualifying Builder", "Master Plumber", "Special Engineer". Exact match (78 subtypes in the register).

## `busPers` (type: `string`):

Whether the record is an individual (Personal) or a business entity (Business). Blank = both.

## `status` (type: `string`):

Canonical status. The source ships each value in mixed case (Expired / EXPIRED); this actor normalizes them so filtering is exact. Blank = all.

## `enforcementAction` (type: `boolean`):

true = only records carrying a DLI enforcement action flag (~1.5% of the register); false = only records without one; leave unset for all.

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

City name, substring, case-insensitive (e.g. "Minneapolis").

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

Two-letter mailing state, exact match (e.g. "MN"). Out-of-state licensees carry their home state.

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

Mailing ZIP prefix, digits only (e.g. "554").

## `aggregate` (type: `boolean`):

When on, returns one summary record per group (with a count) instead of individual license rows.

## `groupBy` (type: `string`):

licenseType -> the trade mix; licenseSubtype -> the 78 credential types; status -> issued / expired / revoked; state -> geographic distribution.

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

Cap the number of records pushed (0 = a reasonable ceiling of 200).

## Actor input object example

```json
{
  "aggregate": false,
  "groupBy": "licenseType",
  "maxResults": 200
}
```

# Actor output Schema

## `recordsUrl` (type: `string`):

Minnesota DLI construction trades license records - as JSON

## `datasetUrl` (type: `string`):

No description

## `runUrl` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("j0401/mn-dli-contractors").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("j0401/mn-dli-contractors").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 '{}' |
apify call j0401/mn-dli-contractors --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,j0401/mn-dli-contractors"
        }
    }
}
```

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/aJ5InCknPp3c7rclG/builds/9YAo0MIAopkCZdDdM/openapi.json
