# Virginia Contractor Licence Leads (`yanairon/virginia-contractor-licence-leads`) Actor

Virginia contractor firm licences (Class A, B, C) from the DPOR public lists: business name, email, address, licence class and expiry. No phone number in the official data. Business records only; individuals removed.

- **URL**: https://apify.com/yanairon/virginia-contractor-licence-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

## Virginia Contractor Licence Leads

Contractor firm leads from the **official Virginia DPOR (Board for Contractors) public regulant lists**: business name, email address, address, licence class (A, B, C), specialty codes and expiry date.

- **Source:** [Virginia DPOR regulant lists](https://www.dpor.virginia.gov/RegulantLists) (public text files, 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 lists held about 53.7k rows. After removing names that look like individuals and duplicates, about 40.9k firms remain, and roughly 83% of them have an email address. Counts change as the state updates the lists. Many licensees are based outside Virginia, so use the `state` filter (for example `VA`) to keep Virginia addresses only.

### What you do not get

The official data has **no phone numbers**. This Actor does not look them up or guess them. Email is the lead field.

### Privacy, best effort

Virginia's files do not flag sole proprietors. The Actor treats a registered name as a business only when it looks like a company (for example LLC, Inc, Construction, Roofing). Names that look like a person's name are treated as individuals: their address and email are removed and they are excluded by default (`businessOnly`). This is a name-based heuristic, so a small number of sole proprietors may remain, and a few real firms with person-like names may be dropped.

### Input

| Field | Default | Notes |
| --- | --- | --- |
| `licenceClasses` | A, B, C | Contractor class |
| `specialties` | all | DPOR specialty codes such as ELE, HVA, HIC, RBC, CBC |
| `businessOnly` | `true` | Exclude person-looking names |
| `state`, `city`, `zip` | - | State code, city exact match, ZIP prefix |
| `expiringWithinDays` | - | Only licences expiring within N days |
| `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 licence: `licenceNumber`, `businessName`, `licenceClass`, `specialtyCodes`, `issuedDate`, `expirationDate`, `daysUntilExpiration`, `email`, `address`, `city`, `state`, `zip`, `recordType`, `isNewSinceLastRun`, `sourceDataset`. Export as JSON, CSV or Excel.

### 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 Commonwealth of Virginia; follow applicable email marketing rules (CAN-SPAM) when contacting firms.

# Actor input Schema

## `licenceClasses` (type: `array`):

Virginia contractor classes to include. Leave empty for A, B and C.

## `specialties` (type: `array`):

Keep firms holding any of these DPOR specialty codes (e.g. ELE, HVA, HIC, RBC, CBC). See the DPOR classifications list linked in the README. Leave empty for all.

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

Keep only records whose registered name looks like a company. Names that look like a person's name (possible sole proprietors) are excluded. Recommended for lead generation.

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

Filter by the firm's state (2-letter code). Many Virginia licensees are out of state; use VA for Virginia addresses. Optional.

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

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

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

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

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

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

## `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
{
  "licenceClasses": [],
  "specialties": [],
  "businessOnly": true,
  "state": "",
  "city": "",
  "zip": "",
  "expiringWithinDays": null,
  "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/virginia-contractor-licence-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/virginia-contractor-licence-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/virginia-contractor-licence-leads --silent --output-dataset

```

## MCP server setup

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