# Maryland Contractor License Search (MHIC) (`lulzasaur/md-contractor-license-scraper`) Actor

Verify Maryland home improvement contractor & salesperson licenses from the official MHIC database. Search by trade name, personal name, city/zip, or license number. Returns contractor name, trade name, address, expiration date, category & registration number. B2B compliance & lead gen.

- **URL**: https://apify.com/lulzasaur/md-contractor-license-scraper.md
- **Developed by:** [lulz bot](https://apify.com/lulzasaur) (community)
- **Categories:** Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 results

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

## Maryland Contractor License Search (MHIC)

Search and verify **Maryland home improvement contractor and salesperson licenses** directly from the official Maryland Home Improvement Commission (MHIC) public database, maintained by the Maryland Department of Labor.

Maryland requires every home improvement contractor and salesperson to hold an active MHIC license. This actor turns the state's clunky CGI search into clean, structured JSON — perfect for compliance checks, insurance underwriting, sub-contractor vetting, and lead generation.

### What it does

- ✅ Searches the **official state database** (dllr.state.md.us) — not a third-party copy
- 🔍 Five search modes: contractor trade name, contractor personal name, salesperson name, location (city or zip), or license registration number
- 📄 Automatic pagination — pulls every result page (50 records per page) up to your `maxResults`
- 🧾 Returns structured records: contractor name, trade name, street address, city, state, zip, license expiration date, license category, registration number, and suffix

### Use cases

- **Compliance & risk**: verify a contractor's license is active before contract award or claim payout
- **Insurance underwriting**: batch-verify MHIC registration numbers
- **Sub-contractor vetting**: general contractors confirming subs are licensed
- **Lead generation**: pull every licensed contractor in a city or zip code with expiration dates for renewal-timed outreach
- **Market research**: contractor density by city/zip across Maryland

### Input

| Field | Type | Description |
|-------|------|-------------|
| `searchType` | select | `businessName`, `personalName`, `salespersonName`, `location`, or `licenseNumber` |
| `query` | string | Trade name, last name, or registration number (depending on search type) |
| `city` | string | Optional city filter for name searches; required (or `zip`) for location searches |
| `zip` | string | 5-digit zip — location searches only |
| `maxResults` | integer | Max records to return (0 = unlimited) |

#### Example input

```json
{
    "searchType": "location",
    "city": "Baltimore",
    "maxResults": 500
}
```

### Output

```json
{
    "name": "JEREMY BRYANT",
    "tradeName": "A & B HOME IMPROVEMENT",
    "address": "111 RIVERSIDE DRIVE",
    "city": "BALTIMORE",
    "state": "MD",
    "zip": "21221",
    "expirationDate": "2027-11-30",
    "category": "CONTRACTOR/SALESMAN",
    "licenseNumber": "80398",
    "suffix": "N/A",
    "searchType": "businessName",
    "searchTotal": 2671,
    "source": "Maryland Home Improvement Commission (MHIC)",
    "scrapedAt": "2026-08-14T12:00:00.000Z"
}
```

### Notes

- Results include **active licensees only** — the state search excludes inactive licenses.
- The address field occasionally includes legacy license references from the state system; these are preserved in `addressExtra`.
- No proxy needed for normal volumes. The actor rate-limits itself between pages to be polite to the state server.

### Related actors

Building a multi-state license verification stack? Check out our other license scrapers: California CSLB, contractor licenses (CA/TX/FL/NY), nurse licenses (FL/NY), and realtor licenses (FL/CA/TX/NY).

# Actor input Schema

## `searchType` (type: `string`):

How to search the MHIC license database.

## `query` (type: `string`):

Trade name, last name, or license registration number — depending on Search Type. Not used for Location searches.

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

Maryland city name. Optional filter for name searches; required (or zip) for Location searches.

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

5-digit Maryland zip code. Only used for Location searches.

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

Maximum number of license records to return. Set to 0 for unlimited (server paginates 50 per page).

## Actor input object example

```json
{
  "searchType": "businessName",
  "query": "home",
  "city": "",
  "zip": "",
  "maxResults": 200
}
```

# Actor output Schema

## `results` (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 = {
    "searchType": "businessName",
    "query": "home"
};

// Run the Actor and wait for it to finish
const run = await client.actor("lulzasaur/md-contractor-license-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 = {
    "searchType": "businessName",
    "query": "home",
}

# Run the Actor and wait for it to finish
run = client.actor("lulzasaur/md-contractor-license-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 '{
  "searchType": "businessName",
  "query": "home"
}' |
apify call lulzasaur/md-contractor-license-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,lulzasaur/md-contractor-license-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/gjVd9EVjvfAHY0QDR/builds/Ph5nyuWgA55BnjP9b/openapi.json
