# Pennsylvania Contractor Registration Lookup & Leads Scraper (`scrapebench/pennsylvania-contractor-license-lookup`) Actor

Active Pennsylvania home improvement contractor registrations from the Attorney General: phone, address, expiry and type of work, by county, city or registration number.

- **URL**: https://apify.com/scrapebench/pennsylvania-contractor-license-lookup.md
- **Developed by:** [ScrapeBench](https://apify.com/scrapebench) (community)
- **Categories:** Lead generation
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.004 / contractor registration

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

## Pennsylvania Contractor Registration Lookup & Leads Scraper

### Pain points

- Pennsylvania's Attorney General registry answers one county at a time: a search with no county and no name returns nothing, so a statewide list means 68 searches (67 counties plus out-of-state firms).
- Every search on the registry first passes a Cloudflare "verify you are human" check.
- The registry's Excel download covers one search's results, so a county-by-county list has to be stitched and de-duplicated by hand: a contractor can appear under more than one county.

### What we solve

- Returns every active home improvement contractor registration in Pennsylvania in one run: 52,330 registrations read on 2026-10-28, filterable by county, city and status.
- Each row carries what the registry shows a visitor: company, registration number, expiry date, phone (every row on 2026-10-28), street address and the types of work the contractor declared.
- Checks one registration number, or a batch of them (e.g. PA178376), and returns its expiry date.

### Summary

Active home improvement contractor registrations from the Pennsylvania Office of Attorney General, the register every contractor doing $5,000 or more of home improvement work a year must join under the Home Improvement Consumer Protection Act. Each row has the company, registration number, expiry date, phone, street address and, where the contractor declared it, the types of work (roofing, HVAC, electrical, ...). On 2026-10-28 the dataset holds 52,330 active registrations, and every one carries a phone and a street address. Data is served from a stored copy, so a run returns in seconds. Pay only per registration returned.

### Who it's for

- Building-supply, insurance and software sales teams prospecting Pennsylvania contractors
- Homeowners, property managers and lenders checking a contractor's registration before signing
- Compliance and procurement teams verifying vendor registrations in bulk
- Marketing agencies building local contractor lists by county

### How to use

This actor does two jobs. Run it, then collect results from the run's dataset (export to JSON/CSV/Excel, or pull via the Apify API).

**Get a list (export):** no names, just filters; returns the whole matching list.

```json
{
  "categories": [
    "allegheny"
  ],
  "status": "Active",
  "maxResults": 500
}
```

**Check specific firms (lookup):** put company names or licence numbers in `queries`; **Inputs** below says how each is matched.

```json
{
  "queries": [
    "PA178376",
    "Allens Handyman Services"
  ],
  "maxResults": 5
}
```

See **Inputs** below for every available field.

### What you get

One row per record:

| Field | Description |
|---|---|
| `listing_id` | Registration number (e.g. PA178376) |
| `name` | Business name |
| `extras.status` | Active; a registration whose expiry date has passed since the copy was read reads Expired, with a status_note |
| `extras.expires` | Registration expiry date |
| `extras.types_of_work` | Types of work the contractor declared (roofing, HVAC, electrical, ...), where on file |
| `phone` | Phone as the registry printed it |
| `phone_e164` | The same number in +1 format |
| `street` | Street address (address lines joined) |
| `city` | City |
| `region` | State of the business address (most are PA; out-of-state firms keep their own) |
| `postal_code` | ZIP code |
| `categories` | Types of work, or home improvement contractor where none was declared |
| `source_url` | The registry, with the registration number |

Sample:

```json
{
  "listing_id": "PA178376",
  "name": "Allens Handyman Services",
  "phone": "412-447-1794",
  "phone_e164": "+14124471794",
  "street": "2283 Monroeville Rd",
  "city": "Monroeville",
  "region": "PA",
  "postal_code": "15146",
  "country": "US",
  "category": "home improvement contractor",
  "categories": [
    "home improvement contractor"
  ],
  "source": "snapshot",
  "source_url": "https://hicsearch.attorneygeneral.gov/#PA178376",
  "extras": {
    "status": "Active",
    "expires": "2027-04-16"
  }
}
```

### Inputs

| Field | Required | Type | Default | Description |
|---|---|---|---|---|
| `mode` | no | string | `"auto"` | export: no names, just filters; returns the whole matching list. lookup / verify: put company names (matched if contained in the company name) or licence numbers (exact) in 'queries'. auto picks the mode for you. |
| `query` | no | string | — | A business name (or listing number) to look up in the stored copy of the directory. Kept alongside 'queries' for saved tasks. |
| `queries` | no | array | `[]` | A business name (or listing number) to look up in the stored copy of the directory. Several values in one run; combined with 'query'. |
| `status` | no | string | — | Only listings in this status. Kept alongside 'statuses' for saved tasks. |
| `statuses` | no | array | `[]` | Only listings in this status. Several values in one run; combined with 'status'. |
| `city` | no | string | — | Only listings in this city. Kept alongside 'cities' for saved tasks. |
| `cities` | no | array | `[]` | Only listings in this city. Several values in one run; combined with 'city'. |
| `categories` | no | array | `[]` | Only rows from this county (one or more). Available: adams, allegheny, armstrong, beaver, bedford, berks, blair, bradford, bucks, butler, cambria, cameron, carbon, centre, chester, clarion, clearfield, clinton, columbia, crawford, cumberland, dauphin, delaware, elk, erie, … (68 in all; an unknown name returns the full list, free). |
| `maxResults` | no | integer | `500` | Per query in lookup mode; per run in export mode. |
| `proxyConfiguration` | no | object | `{"useApifyProxy": false}` | Used only for live lookups; exports read the stored snapshot. |

### Pricing (Pay Per Event)

You pay per result (`dataset-item`) — **no charge for empty runs**. Example: **1000 contractor registrations** at *$0.004/result* ≈ **$4.00**.

Notices (unknown county, no match, stale data) are free. Apify platform usage is billed separately per your plan.

### Use cases

- Lead lists: every active home improvement contractor registered in Allegheny County, with phone and street address.
- Trade lists: roofing or HVAC contractors in one county, from the types of work they declared.
- Vendor checks: verify a batch of registration numbers and flag the ones expiring soon.
- Renewal outreach: registrations expiring in the next 60 days, by county.

### Why this actor

- The whole state in one dataset: all 67 counties plus out-of-state firms, one row per registration.
- Nothing to solve on your side: no county-by-county searching and no human check per search.
- Every filter takes a list; one registration number or a batch verifies in one run.
- Pay per registration; notices are free.

### Limitations & updates

Covers active home improvement contractor registrations from the Pennsylvania Office of Attorney General only: no expired registrations, no email, and no licensed trades the state regulates elsewhere. Type of work is on file for about half the registrations (the field is new). Lookups and verification answer from the stored copy, never a live search.

### FAQ

**Who has to register?**

Under Pennsylvania's Home Improvement Consumer Protection Act, contractors who do $5,000 or more of home improvement work a year register with the Office of Attorney General. Registration is not a licence and, as the Attorney General states, not an endorsement.

**Where does the data come from?**

The Pennsylvania Office of Attorney General's Home Improvement Contractor search, read with the Office's permission. Only the fields the search shows a visitor are returned.

**How do I get one county?**

Set categories to one or more county names (allegheny, philadelphia, montgomery, ..., or out-of-state). A county is the Attorney General's own county search, which can list a contractor under more than one county; a run never returns the same registration twice.

**Does it include expired registrations?**

No. The registry publishes active registrations only. A registration whose expiry date has passed since the copy was read is returned as Expired, with a status_note saying the status came from the date.

**Can I verify a registration number?**

Yes. Put one or more registration numbers (e.g. PA178376) in queries, or company names to match by name.

**How current is it?**

The registry was read on 2026-10-28. The stored copy is refreshed when it is older than a month and the actor is in use. The run log states the date of the copy, and a run served from a copy older than 45 days returns one free notice saying so.

**How am I charged?**

One event per registration returned. Notices are free.

### Guides & use cases

Written up on **[scrapebench.dev](https://scrapebench.dev)** — the bench that runs and verifies this actor against the live source every night:

- **How-to:** [How to run Pennsylvania Contractor Registration Lookup & Leads Scraper](https://scrapebench.dev/guides/how-to-pennsylvania-contractor-license-lookup/)
- **Use case:** [Allegheny County PA Home Improvement Contractors with Phone Numbers](https://scrapebench.dev/use-cases/allegheny-county-contractors/)

More actors, coverage and nightly verification results: **[scrapebench.dev](https://scrapebench.dev)**

### Works with AI assistants (MCP)

Callable as an MCP tool, so Claude, Cursor, VS Code Copilot and other MCP clients can run it directly. Grab the config from the [MCP tab](https://apify.com/scrapebench/pennsylvania-contractor-license-lookup/api/mcp) on this page — Apify hosts the server and keeps that snippet current, and OAuth signs you in on first connect, so no API token goes in your config file.

Then just ask:

> "List active home improvement contractors registered in Allegheny County, Pennsylvania, with their phone numbers and registration expiry dates."

That is categories allegheny, status Active: 4,145 registrations on the 2026-10-28 data. Keep maxResults small on a first call. Runs started this way bill exactly like any other run.

### Data & lawful use

This actor collects publicly available information that the Pennsylvania Office of Attorney General (Home Improvement Consumer Protection Act registrations) publishes for public
lookup — licence records, business listings and the contact details professionals list there.
Some of it identifies individuals (sole proprietors, licence holders, agents), so treat any
names, phone numbers and emails in your results as personal data.

When you run this actor, you decide what is collected and what it is used for, so you are the
controller of that data and we act only as your processor (Apify Standard Actor Contract).
You need a lawful basis for your use, must honour opt-out and deletion requests, and must
follow the marketing rules that apply to you (CAN-SPAM, TCPA, GDPR, CCPA and similar).
Don't use the output for unsolicited bulk messaging, for screening covered by the FCRA, or
for anything the source's own terms forbid.

Your results are stored in your own Apify account. We don't keep a copy of your results and
don't sell or share them.

### Disclaimer

This is an independent tool. It is not affiliated with, endorsed by or sponsored by
the Pennsylvania Office of Attorney General (Home Improvement Consumer Protection Act registrations). Names and marks are used only to describe the data source. Records are
provided as published by the source and may be out of date or incomplete. For anything
consequential (hiring, a permit, a legal decision), confirm the record with the issuing
agency. You are responsible for making sure your use complies with applicable law and the
source's terms.

### Need help?

Open an issue on this actor's **Issues** tab and we'll respond there. Bug reports, missing
fields and feature requests are all welcome. Guides and examples: [scrapebench.dev](https://scrapebench.dev).

If you are a person named in this data and want your record removed from our copy, email
apify-help@scrapebench.dev; the source agency remains the official record.

Your run may be used to improve our services. If something looks off, or you want this actor to fit your use better, please share your run data with us: [Apify Console → Settings → Security → Share run data with developers](https://console.apify.com/settings/security). It lets us see exactly what went wrong and keep improving the actor.

# Actor input Schema

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

export: no names, just filters; returns the whole matching list. lookup / verify: put company names (matched if contained in the company name) or licence numbers (exact) in 'queries'. auto picks the mode for you.

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

A business name (or listing number) to look up in the stored copy of the directory. Kept alongside 'queries' for saved tasks.

## `queries` (type: `array`):

A business name (or listing number) to look up in the stored copy of the directory. Several values in one run; combined with 'query'.

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

Only listings in this status. Kept alongside 'statuses' for saved tasks.

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

Only listings in this status. Several values in one run; combined with 'status'.

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

Only listings in this city. Kept alongside 'cities' for saved tasks.

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

Only listings in this city. Several values in one run; combined with 'city'.

## `categories` (type: `array`):

Only rows from this county (one or more). Available: adams, allegheny, armstrong, beaver, bedford, berks, blair, bradford, bucks, butler, cambria, cameron, carbon, centre, chester, clarion, clearfield, clinton, columbia, crawford, cumberland, dauphin, delaware, elk, erie, … (68 in all; an unknown name returns the full list, free).

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

Per query in lookup mode; per run in export mode.

## `proxyConfiguration` (type: `object`):

Used only for live lookups; exports read the stored snapshot.

## Actor input object example

```json
{
  "mode": "auto",
  "queries": [],
  "statuses": [],
  "cities": [],
  "categories": [],
  "maxResults": 500,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

One row per business listing; notices are free.

# 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("scrapebench/pennsylvania-contractor-license-lookup").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("scrapebench/pennsylvania-contractor-license-lookup").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 scrapebench/pennsylvania-contractor-license-lookup --silent --output-dataset

```

## MCP server setup

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

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/OMphvteXBtyrZFRWQ/builds/vNUPVxYcdskp1Jgjb/openapi.json
