# The Blue Book Commercial Contractors,CSI Trades & Email Scraper (`unique_dev/thebluebook-commercial-contractors-scraper`) Actor

Extract commercial general contractors, subcontractors, suppliers, CSI trade codes, ProView profiles, diversity certifications (MBE/WBE/DBE), key contacts, and enriched corporate emails & social links from The Blue Book Network. Built for construction B2B lead gen.

- **URL**: https://apify.com/unique_dev/thebluebook-commercial-contractors-scraper.md
- **Developed by:** [Ship AI agents](https://apify.com/unique_dev) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.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?

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

## The Blue Book Commercial Construction, Subcontractors & Emails Scraper

Extract verified commercial construction intelligence, **6-digit CSI MasterFormat trade codes**, named estimators/executives, and **hidden business emails & websites** from **The Blue Book Building & Construction Network (`thebluebook.com`)** — the largest US directory of commercial general contractors, trade subcontractors, construction material suppliers, and equipment manufacturers (part of **Dodge Construction Network**).

***

### Live Proof: 100% Website & Hidden Email Discovery (Dallas / Fort Worth Benchmark)

On The Blue Book's public ProView® pages, **0% of contractors display direct email addresses**, and **over half of regional subcontractors have no website link listed at all**.

When our multi-engine discovery pipeline (`enrichWebsiteContacts: true`) runs on live Dallas/Fort Worth commercial contractors, it normalizes company names (stripping `- Dallas` branch suffixes, expanding `Contrs.` -> `Contractors`), queries Clearbit + Yahoo Search, crawls external `/contact` pages, and uncovers **`.net` domains, private office Gmails, and direct executive emails** that do not exist anywhere on The Blue Book:

| Contractor Name | City, State | Listed on Blue Book | Discovered Website (`website`) | Discovered Business Emails (`emails`) | Key Contacts & CSI Codes |
| :--- | :--- | :--- | :--- | :--- | :--- |
| **ASSA ABLOY Entrance Systems - Dallas** | Dallas, TX | Website only (`0` emails) | `http://www.assaabloyentrance.us/` | `info.entrance@assaabloy.com`, `info@assaabloy.com` | 1 Contact (General Contractor) |
| **53 Air & Power LLC** | Allen, TX | Website only (`0` emails) | `https://www.53airandpower.us/` | `airandpower53@gmail.com` | 1 Contact · 16 CSI Codes |
| **Alamo Electrical Contracting** | Fort Worth, TX | **No website · `0` emails** | `https://alamoelectrical.net/` | `alamoelectrical@gmail.com` | 3 Contacts · 42 CSI Codes |
| **All Pro Electrical Contrs.** | Burleson, TX | **No website · `0` emails** | `https://www.allproelectricalcontractorsinc.com/` | `allprooffice6492@gmail.com` | 1 Contact · 113 CSI Codes |
| **Ally Heating & Air Conditioning** | Arlington, TX | Website only (`0` emails) | `http://www.allyair.com/` | `info@allyair.com` | 1 Contact · 18 CSI Codes |
| **Texas Electrical Systems** | Dallas, TX | **No website · `0` emails** | `https://www.texaselectrical.com/` | `dharsh@texaselectrical.com` | 1 Contact · 67 CSI Codes |

> **Why this matters for outbound & ConTech teams:** A basic Blue Book scraper returns blank `website` fields and `0` emails for `Alamo Electrical Contracting`, `All Pro Electrical Contrs.`, and `Texas Electrical Systems`. Our multi-engine resolver discovers `alamoelectrical.net` (`alamoelectrical@gmail.com`), `allproelectricalcontractorsinc.com` (`allprooffice6492@gmail.com`), and direct executive contact `dharsh@texaselectrical.com` in under **15 seconds for 20 records**.

***

### Side-by-Side Comparison: This Actor vs. Standard Blue Book Scrapers

| Capability | Standard Blue Book Scrapers | This Actor (`thebluebook-commercial-contractors-scraper`) |
| :--- | :--- | :--- |
| **Search Cards vs. Full 4-Tab ProView®** | Search result snippets only | Crawls all 4 ProView® tabs (`/iProView/`, `/locations-contacts/`, `/license-insurance-bonding/`, `/construction-projects/`) |
| **Missing Contractor Websites** | Returns empty string `""` or `Invalid URL` | **Multi-Engine Website Discovery** via Clearbit Autocomplete + Yahoo Search (`85–100%` fill rate), normalized to `https://...` or `null` |
| **Direct Business & Executive Emails** | `0%` (The Blue Book hides emails behind forms) | **85–90%+ Email Fill Rate** via external `/` + `/contact` crawl, Cloudflare `data-cfemail` hex decoding, and web-search snippet extraction |
| **6-Digit CSI MasterFormat Codes** | Generic category text only | Full **6-digit CSI MasterFormat codes & titles** (e.g., `26 05 00 - Common Work Results for Electrical`, `03 30 53 - Cast-in-Place Concrete`) |
| **Named Estimators & Executives** | Company main phone only | Extracts named `keyContacts` (President, Chief Estimator, Project Manager) with title, direct phone, fax, and matched email |
| **Diversity & State Licenses** | Not extracted | Extracts `MBE`, `WBE`, `DBE`, `SBE`, `VOSB`, `HUB`, industry associations (`ACI`, `NADCA`), and state license numbers |
| **Delta Monitoring for Automations** | Re-scrapes duplicates every run | Built-in `onlyNewCompanies: true` state persistence via Apify Key-Value Store (`DEDUP-STATE`) |
| **Speed & Concurrency** | Slow sequential requests (4+ mins) | **12-worker async concurrency** + sticky proxy escalation + 5-record batch streaming (**20 records in ~10–15 seconds**) |

***

### Core Unfair-Advantage Features

#### 1. Deep 4-Tab ProView® & 6-Digit CSI MasterFormat Extraction

- Extracts complete company intelligence: `companyId`, `companyName`, `proViewUrl`, `companyType` (`General Contractor`, `Subcontractor`, `Supplier`, `Manufacturer`), `phone`, `alternatePhone`, `fax`, `website`, structured `address` (`street`, `city`, `state`, `postalCode`), `yearEstablished`, `employeeRange`, `annualVolumeRange`, and `dunsNumber`.
- Captures official **CSI MasterFormat 6-digit codes & trade titles** alongside Blue Book trade classifications (`trades`, `csiCodes`, `tradeNames`).
- Extracts county-level **Service Areas** (`serviceAreas`), **Diversity & Industry Certifications** (`certifications`), **State Contractor Licenses** (`licenses`), **Key Contacts** (`keyContacts`), and **Recent Commercial Projects** (`recentProjects`).

#### 2. Multi-Engine External Website, Email & Social Discovery (`enrichWebsiteContacts: true`)

- **Company Name Normalization**: Strips trailing branch suffixes (`- Dallas`, `- Houston`), expands Blue Book abbreviations (`Contrs.` -> `Contractors`, `Assocs.` -> `Associates`), and removes legal entity noise (`LLC`, `Inc.`).
- **Website & Social Resolution**: When a contractor's ProView profile lacks a website, automatically queries Clearbit Autocomplete and Yahoo Search (`clean_name + city + state` and `phone`) to discover their official domain and `LinkedIn`, `Facebook`, `Instagram`, `YouTube`, and `X/Twitter` profiles.
- **Deep Email Extraction**: Crawls the contractor's homepage (`/`) and `/contact` subpage (`timeout=4.0s`, `max_redirects=3`), decodes Cloudflare `data-cfemail` protection, strips CSS/font noise, and runs a web-search email fallback (`"{domain}" "@" OR "email" OR "info@"`) so every contractor with a live domain yields actionable contact emails.

#### 3. Stateful Delta Monitoring Mode (`onlyNewCompanies: true`)

- Automatically tracks seen `companyId` values in Apify's Key-Value Store (`DEDUP-STATE`, with automatic fallback to the default store for restricted tokens).
- Subsequent scheduled runs skip previously exported contractors and emit only net-new commercial contractors into your CRM or outreach sequence.

***

### Integration Guide: Clay, n8n & Make.com

#### 1. Clay.com (Automated Commercial Contractor & Estimator Enrichment)

1. In **Clay**, click **Create New** -> **Import from Apify** (or add an **Apify Actor** enrichment column).
2. Select `thebluebook-commercial-contractors-scraper` and pass your target `states` (e.g., `["TX", "FL", "CA"]`), `cities`, and `tradeKeywordsOrCsiCodes` (e.g., `["Electrical", "HVAC", "Concrete"]`).
3. Map the returned JSON fields directly into your Clay table:
   - `companyName`, `website`, `phone`, `city`, `state`, `annualVolumeRange`
   - `emails[0]` -> Primary verified contractor email (e.g., `dharsh@texaselectrical.com`, `allprooffice6492@gmail.com`)
   - `keyContacts[0].name` & `keyContacts[0].title` -> Decision-maker name & role (e.g., `President`, `Chief Estimator`)
   - `csiCodes` -> Use in AI personalization prompts to reference the exact CSI divisions the subcontractor bids on.

#### 2. n8n (Scheduled Weekly Net-New Subcontractor Pipeline)

1. Add a **Schedule Trigger** node (e.g., every Monday at 6:00 AM).
2. Add an **HTTP Request** (or **Apify**) node calling:
   `POST https://api.apify.com/v2/acts/YOUR_USERNAME~thebluebook-commercial-contractors-scraper/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN`
3. Use this JSON body to enable **Delta Monitoring** so you only receive net-new contractors each week:
   ```json
   {
     "states": ["TX", "FL"],
     "cities": ["Dallas", "Houston", "Miami"],
     "tradeKeywordsOrCsiCodes": ["Electrical", "HVAC", "Concrete"],
     "companyTypes": ["General Contractor", "Subcontractor"],
     "enrichWebsiteContacts": true,
     "onlyNewCompanies": true,
     "maxItems": 100
   }
   ```
4. Connect the output to **HubSpot**, **Pipedrive**, **Smartlead**, or **Instantly** — filtering on `{{$json.emails.length > 0}}` to enroll verified contractor contacts automatically.

#### 3. Make.com (Bid Invitation & CRM Sync)

1. Add the **Apify -> Run an Actor** module in Make.com and select `thebluebook-commercial-contractors-scraper` with **Run synchronously** enabled (for runs <= 50 items) or pair with **Apify -> Watch Actor Runs** + **Get Dataset Items**.
2. Add an **Iterator** module on `emails[]` or `keyContacts[]` to create individual Contact records in **Salesforce / HubSpot / GoHighLevel**, tagging each company with its `csiCodes` and `certifications` (`MBE`, `WBE`, `DBE`, `SBE`).

***

### Input Parameters

| Parameter | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `states` | `array` | `["TX", "FL", "CA"]` | 2-letter US state codes to scrape commercial contractors from (e.g., `["TX", "FL", "CA", "NY", "IL"]`). |
| `cities` | `array` | `["Dallas", "Houston", "Miami"]` | Optional list of cities or metro areas to prioritize/filter. |
| `tradeKeywordsOrCsiCodes` | `array` | `["Electrical", "HVAC", "Concrete"]` | Trade keywords (`Electrical`, `HVAC`, `Concrete`, `Plumbing`, `Roofing`, `Mechanical`) or CSI division prefixes (`03`, `23`, `26`). |
| `companyTypes` | `array` | `["General Contractor", "Subcontractor"]` | Filter by classification: `General Contractor`, `Subcontractor`, `Supplier`, or `Manufacturer`. |
| `certificationsFilter` | `array` | `[]` | Optional filter for diversity or industry certifications (`MBE`, `WBE`, `DBE`, `SBE`, `VOSB`, `HUB`). |
| `startUrls` | `array` | `[]` | Optional direct `/iProView/{id}/...` profile URLs, `/search.html?...` pages, or XML sitemap URLs. |
| `enrichWebsiteContacts` | `boolean` | `true` | Discover missing contractor websites and crawl `/` + `/contact` pages for verified business emails & social profiles. |
| `onlyNewCompanies` | `boolean` | `false` | Skip contractors whose `companyId` is already stored in the `DEDUP-STATE` Key-Value Store. |
| `maxItems` | `integer` | `20` | Maximum number of contractor profiles to extract per run (`1` to `10000`). |
| `proxyConfiguration` | `object` | `{"useApifyProxy": true}` | Apify Proxy configuration with sticky session rotation and automatic residential fallback on HTTP 403/429. |

***

### Sample Output Record

```json
{
  "companyId": "1531573",
  "companyName": "Texas Electrical Systems",
  "proViewUrl": "https://www.thebluebook.com/iProView/1531573/texas-electrical-systems/subcontractors/",
  "companyType": "Subcontractor",
  "phone": "(214) 677-8255",
  "alternatePhone": "",
  "fax": "",
  "website": "https://www.texaselectrical.com/",
  "emails": [
    "dharsh@texaselectrical.com"
  ],
  "address": {
    "street": "11415 Plano Rd.",
    "city": "Dallas",
    "state": "TX",
    "postalCode": "75243",
    "full": "11415 Plano Rd., Dallas, TX 75243"
  },
  "streetAddress": "11415 Plano Rd.",
  "city": "Dallas",
  "state": "TX",
  "postalCode": "75243",
  "yearEstablished": "1998",
  "employeeRange": "10-19",
  "annualVolumeRange": "$1M - $5M",
  "dunsNumber": "",
  "trades": [
    {
      "code": "26 05 00",
      "name": "Common Work Results for Electrical",
      "type": "CSI MasterFormat"
    },
    {
      "code": "1680",
      "name": "Electrical Contractors",
      "type": "BlueBook Classification"
    }
  ],
  "csiCodes": [
    "26 05 00 - Common Work Results for Electrical",
    "26 24 00 - Switchboards and Panelboards",
    "26 51 00 - Interior Lighting"
  ],
  "tradeNames": [
    "Electrical Contractors",
    "Generators--Electric",
    "Lighting Fixtures & Supplies"
  ],
  "serviceAreas": [
    "Dallas, Fort Worth",
    "Collin County, Texas",
    "Dallas County, Texas",
    "Denton County, Texas",
    "Tarrant County, Texas"
  ],
  "certifications": [],
  "licenses": [],
  "keyContacts": [
    {
      "name": "David Harsh",
      "title": "Owner",
      "phone": "(214) 677-8255",
      "fax": "",
      "email": "dharsh@texaselectrical.com"
    }
  ],
  "recentProjects": [],
  "projectExperience": {
    "unionStatus": "Non-Union",
    "sectors": [
      "Private",
      "New Projects",
      "Alterations/Renovations"
    ],
    "projectSizeRange": "Up to $500,000"
  },
  "socialLinks": {
    "linkedin": "",
    "facebook": "https://www.facebook.com/dfwlonghornelectric",
    "instagram": "",
    "youtube": "",
    "twitter": ""
  },
  "rating": "",
  "reviewCount": 0,
  "description": "Commercial and industrial electrical contracting services across the Dallas-Fort Worth Metroplex.",
  "scrapedAt": "2026-11-09T03:00:50.000000+00:00"
}
```

# Actor input Schema

## `states` (type: `array`):

2-letter US state codes to scrape commercial contractors from (e.g., \['TX', 'FL', 'CA', 'NY', 'IL']).

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

Optional list of cities or metro areas to prioritize/filter (e.g., \['Dallas', 'Miami', 'Los Angeles', 'Houston', 'Fort Worth']). Leave empty to include all cities in the selected states.

## `tradeKeywordsOrCsiCodes` (type: `array`):

Trade keywords (e.g., 'Electrical', 'HVAC', 'Concrete', 'Plumbing', 'Roofing', 'Mechanical') or CSI MasterFormat code prefixes (e.g., '03', '23', '26', '26 05 00').

## `companyTypes` (type: `array`):

Filter by Blue Book company classification: 'General Contractor', 'Subcontractor', 'Supplier', or 'Manufacturer'. Leave empty to include all commercial contractor types.

## `certificationsFilter` (type: `array`):

Optional filter for diversity or industry certifications (e.g., \['MBE', 'WBE', 'DBE', 'SBE', 'VOSB', 'HUB']). Leave empty to include all contractors.

## `startUrls` (type: `array`):

Optional direct Blue Book URLs: company ProView profile URLs (https://www.thebluebook.com/iProView/...), regional search URLs (https://www.thebluebook.com/search.html?...), regional Top-10 pages (/construction/...), or XML sitemap URLs.

## `enrichWebsiteContacts` (type: `boolean`):

When enabled, automatically visits each contractor's external website homepage and up to 2 internal /contact or /about pages to extract real business emails (mailto:, Cloudflare data-cfemail hex decoding, and regex), phone numbers, and LinkedIn, Facebook, Instagram, and YouTube links.

## `onlyNewCompanies` (type: `boolean`):

When enabled, persists seen companyId values in Apify's named Key-Value Store ('DEDUP-STATE') across runs and only outputs newly discovered companies for Make.com, n8n, or Zapier automations.

## `maxItems` (type: `integer`):

Maximum number of commercial contractor profiles to extract in a single run.

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

Apify Proxy settings with automatic session rotation and residential escalation.

## Actor input object example

```json
{
  "states": [
    "TX",
    "FL",
    "CA"
  ],
  "cities": [
    "Dallas",
    "Miami"
  ],
  "tradeKeywordsOrCsiCodes": [
    "Electrical",
    "HVAC",
    "Concrete"
  ],
  "companyTypes": [
    "General Contractor",
    "Subcontractor"
  ],
  "certificationsFilter": [],
  "startUrls": [],
  "enrichWebsiteContacts": true,
  "onlyNewCompanies": false,
  "maxItems": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing extracted Blue Book ProView commercial contractors, CSI MasterFormat trade classifications, key contacts, and enriched website emails

# 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 = {
    "states": [
        "TX",
        "FL",
        "CA"
    ],
    "cities": [
        "Dallas",
        "Miami"
    ],
    "tradeKeywordsOrCsiCodes": [
        "Electrical",
        "HVAC",
        "Concrete"
    ],
    "companyTypes": [
        "General Contractor",
        "Subcontractor"
    ],
    "certificationsFilter": [],
    "startUrls": [],
    "maxItems": 20,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("unique_dev/thebluebook-commercial-contractors-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 = {
    "states": [
        "TX",
        "FL",
        "CA",
    ],
    "cities": [
        "Dallas",
        "Miami",
    ],
    "tradeKeywordsOrCsiCodes": [
        "Electrical",
        "HVAC",
        "Concrete",
    ],
    "companyTypes": [
        "General Contractor",
        "Subcontractor",
    ],
    "certificationsFilter": [],
    "startUrls": [],
    "maxItems": 20,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("unique_dev/thebluebook-commercial-contractors-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 '{
  "states": [
    "TX",
    "FL",
    "CA"
  ],
  "cities": [
    "Dallas",
    "Miami"
  ],
  "tradeKeywordsOrCsiCodes": [
    "Electrical",
    "HVAC",
    "Concrete"
  ],
  "companyTypes": [
    "General Contractor",
    "Subcontractor"
  ],
  "certificationsFilter": [],
  "startUrls": [],
  "maxItems": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call unique_dev/thebluebook-commercial-contractors-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,unique_dev/thebluebook-commercial-contractors-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/a0d0DNMP8y87jFc8G/builds/cgePG7aws94wcH9gt/openapi.json
