# Minnesota Contractor Registration Leads (`yanairon/minnesota-contractor-registration-leads`) Actor

Minnesota contractor registrations from the state DLI open-data file: business name, phone, address, licence status and expiry. Business records only; sole proprietors removed.

- **URL**: https://apify.com/yanairon/minnesota-contractor-registration-leads.md
- **Developed by:** [Yanai Ron](https://apify.com/yanairon) (community)
- **Security:** 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 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?

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 Registration Leads

Clean contractor leads from the **official Minnesota Department of Labor and Industry (DLI) contractor registration export**. Business name, phone number, address, status and expiry date for registered Minnesota construction contractors.

- **Source:** [MN DLI construction contractor registration open data](https://www.dli.mn.gov/business/construction-contractor-registration) (public CSV, no login, no scraping of web pages).
- **Who it's for:** insurance agents, warranty providers, material and tool suppliers, software vendors and service businesses that sell to licensed contractors.

### What you get

At the last check, the state file held about 21.5k registrations. After removing sole proprietors, about 14,000 are active business records, and nearly all of them (14,047 of 14,048) have a phone number. Counts change as the state updates the file.

### What you do not get

The official file has **no email addresses**. This Actor does not look them up or guess them. Phone is the lead field.

### Privacy

Business records only. Registrations of individuals and sole proprietors have their personal name, address and phone removed, and they are excluded by default (`businessOnly`).

### Input

| Field | Default | Notes |
| --- | --- | --- |
| `statuses` | Issued | Issued, Expired, Suspended, Revoked, Voluntary Termination |
| `businessOnly` | `true` | Exclude individuals and sole proprietors |
| `expiringWithinDays` | - | Only registrations expiring within N days |
| `city`, `zip` | - | City exact match (case-insensitive), ZIP prefix |
| `mode` | `full` | `delta` is experimental: change tracking needs persistent storage and currently treats every record as new |
| `deltaDays` | `30` | Expiry window used in delta mode |
| `maxRecords` | `25` | Prefilled so a first test is quick. Set `0` for the full list |

### Output

One item per registration: `licenceNumber`, `businessName`, `dbaName`, `status`, `expirationDate`, `daysUntilExpiration`, `phone`, `address`, `city`, `state`, `zip`, `recordType`, `enforcementAction`, `isNewSinceLastRun`, `sourceDataset`. Export as JSON, CSV or Excel from the dataset tab or the API.

### Pricing

Pay per result: $5.00 per 1,000 records ($0.005 each).

### Notes

The Actor checks the source layout on every run and fails with a clear error if the state changes it. Data is public record published by the State of Minnesota; check your own rules for outreach (for example do-not-call lists) before contacting businesses.

# Actor input Schema

## `statuses` (type: `array`):

Statuses to include. Default is Issued (active) only.

## `businessOnly` (type: `boolean`):

Keep only business entities. Sole-proprietor registrations are excluded. Recommended for lead generation.

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

Keep only records expiring within this many days from today. Leave empty for all.

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

Filter by city (case-insensitive exact match). Optional.

## `zip` (type: `string`):

Filter by ZIP prefix (e.g. 553 or 55401). Optional.

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

Experimental: change tracking needs persistent storage and currently treats all records as new.

## `deltaDays` (type: `integer`):

Experimental: change tracking needs persistent storage and currently treats all records as new. Expiry window used in delta mode.

## `maxRecords` (type: `integer`):

Cap the number of output records. 0 = no cap. The example input is 25 so a first test run is quick; set 0 for the full list.

## Actor input object example

```json
{
  "statuses": [
    "Issued"
  ],
  "businessOnly": true,
  "expiringWithinDays": null,
  "city": "",
  "zip": "",
  "mode": "full",
  "deltaDays": 30,
  "maxRecords": 25
}
```

# Actor output Schema

## `records` (type: `string`):

Cleaned records matching the input filters.

# 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 = {
    "maxRecords": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("yanairon/minnesota-contractor-registration-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 = { "maxRecords": 25 }

# Run the Actor and wait for it to finish
run = client.actor("yanairon/minnesota-contractor-registration-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 '{
  "maxRecords": 25
}' |
apify call yanairon/minnesota-contractor-registration-leads --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,yanairon/minnesota-contractor-registration-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/R7guVmTh7SLwjJgKF/builds/vVExQ2Si09824DgpO/openapi.json
