# Blue Book Contractor Scraper: US Leads by State, Trade and City (`getascraper/thebluebook-contractor-directory`) Actor

Collect general contractors, subcontractors, suppliers and manufacturers from The Blue Book by state, company type, city and trade. Get phone, website, email, trades, services, CSI codes, DUNS number and service areas as JSON or CSV. About $4 per 1,000 companies, no subscription.

- **URL**: https://apify.com/getascraper/thebluebook-contractor-directory.md
- **Developed by:** [GetAScraper](https://apify.com/getascraper) (community)
- **Categories:** Lead generation, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.88 / 1,000 company records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Blue Book Contractor Scraper: US Leads by State, Trade and City

<table width="100%">
<tr>
<td style="padding:24px 28px;background:#FFF3EA;border:1px solid #FBD3B4;border-top:4px solid #EA580C;border-radius:12px">
<span style="font-size:23px;font-weight:800;color:#1C1917;line-height:1.3">800,000+ construction companies, searchable by trade and state</span><br>
<span style="font-size:15px;color:#57534E;line-height:1.6">Search The Blue Book Building &amp; Construction Network by state, company type, city or trade, and get phone, website, trades, CSI codes and service areas as clean JSON.</span>
</td>
</tr>
</table>

<table width="100%">
<tr>
<td style="padding:14px 12px;width:25%;background:#FFFFFF;border:1px solid #FBD3B4;border-radius:10px 0 0 10px;vertical-align:top">
<span style="font-size:15px;font-weight:800;color:#9A3412">🗺️ State &amp; city filters</span><br>
<span style="font-size:12px;color:#57534E">Narrow to the states and cities you actually sell into</span>
</td>
<td style="padding:14px 12px;width:25%;background:#FFFFFF;border:1px solid #FBD3B4;border-left:none;vertical-align:top">
<span style="font-size:15px;font-weight:800;color:#9A3412">🧰 Trade matching</span><br>
<span style="font-size:12px;color:#57534E">Matches trades, services and CSI codes, not just a title</span>
</td>
<td style="padding:14px 12px;width:25%;background:#FFFFFF;border:1px solid #FBD3B4;border-left:none;vertical-align:top">
<span style="font-size:15px;font-weight:800;color:#9A3412">📇 DUNS &amp; annual volume</span><br>
<span style="font-size:12px;color:#57534E">Included when the company has published them</span>
</td>
<td style="padding:14px 12px;width:25%;background:#FFFFFF;border:1px solid #FBD3B4;border-left:none;border-radius:0 10px 10px 0;vertical-align:top">
<span style="font-size:15px;font-weight:800;color:#9A3412">🔗 Direct profile lookup</span><br>
<span style="font-size:12px;color:#57534E">Paste known Blue Book URLs to skip the search entirely</span>
</td>
</tr>
</table>

**Find every contractor, subcontractor, supplier or manufacturer that lists your trade, in the states and cities you sell into.** The Blue Book's own site search has no bulk export and blocks most automated access, so buyers today copy listings by hand or buy a static leads list that goes stale. This Actor reads Blue Book's own public company sitemaps and returns structured company records: no login, no CAPTCHA to solve, no static list.

### 🔍 What does Blue Book Contractor Scraper do?

The Blue Book Building & Construction Network lists over 800,000 US contractors, subcontractors, suppliers, manufacturers, engineers and architects. This Actor collects their public ProView profiles: company name, type, address, phone, website, email when published, a short company description, trades, services, CSI codes, the states and counties they serve, and annual volume or DUNS number when the company has published them.

### 👥 Why use Blue Book Contractor Scraper?

- **"I'm building a prospect list of subcontractors in my trade and state."** Filter by trade keyword, state and company type, then export phone and website in minutes.
- **"I sell building products and need installers who list my trade."** Trade matching checks every published trade, service and CSI code, not just a company's headline category.
- **"I'm mapping which trades are covered in a market before I expand there."** Pull every company type in a state or city and see how dense the coverage already is.
- **"I already track specific companies by their Blue Book profile URL."** Paste the URLs directly and get fresh structured data without running a search at all.

### 🚀 How to use Blue Book Contractor Scraper

<table width="100%">
<tr>
<td style="padding:16px 14px;width:33%;background:#FFF3EA;border:1px solid #FBD3B4;border-radius:10px 0 0 10px;vertical-align:top">
<span style="font-size:12px;font-weight:800;color:#EA580C;letter-spacing:1px">STEP 1</span><br>
<span style="font-size:14px;font-weight:700;color:#1C1917">Pick your filters</span><br>
<span style="font-size:12px;color:#57534E">Choose states and company types, then add an optional trade or city keyword.</span>
</td>
<td style="padding:16px 14px;width:33%;background:#FFF3EA;border:1px solid #FBD3B4;border-left:none;vertical-align:top">
<span style="font-size:12px;font-weight:800;color:#EA580C;letter-spacing:1px">STEP 2</span><br>
<span style="font-size:14px;font-weight:700;color:#1C1917">Run the search</span><br>
<span style="font-size:12px;color:#57534E">The Actor works through Blue Book&#39;s own public company sitemaps. No login needed.</span>
</td>
<td style="padding:16px 14px;width:33%;background:#FFF3EA;border:1px solid #FBD3B4;border-left:none;border-radius:0 10px 10px 0;vertical-align:top">
<span style="font-size:12px;font-weight:800;color:#EA580C;letter-spacing:1px">STEP 3</span><br>
<span style="font-size:14px;font-weight:700;color:#1C1917">Export your leads</span><br>
<span style="font-size:12px;color:#57534E">Download JSON, CSV or Excel, or connect the dataset to your CRM.</span>
</td>
</tr>
</table>

### ⚙️ Input

| Field | Type | Required | Description |
|---|---|---|---|
| Company profile URLs | array of URLs | No | Known Blue Book profile links to collect directly. When set, every filter below is ignored. |
| States | array (enum) | No | States to collect companies from. Defaults to Arizona; leave empty for every state. |
| Company types | array (enum) | No | Keep only these types: general contractors, subcontractors, material suppliers, manufacturers, vendor services, engineers or architects. |
| City | array of strings | No | Keep only companies whose published city matches one of these names. |
| Trade keywords | array of strings | No | Keep only companies whose trades, services or CSI codes mention any of these words. |
| Only companies with a website | boolean | No | Skip companies that have not published a website. |
| Proxy configuration | object | No | US residential proxy is the default and required; Blue Book refuses most datacenter traffic. |
| Max companies | integer | No | Most companies to return in this run. Defaults to 20. |
| Max profiles to check | integer | No | When a filter is narrow, the most profiles to open while looking for matches. |

### 📊 Output

Each company is one row. Export it from the dataset as JSON, CSV or Excel.

```json
{
  "companyId": "1882525",
  "companyName": "4 Sons Electrical LLC",
  "companyType": "Subcontractors",
  "profileUrl": "https://www.thebluebook.com/iProView/1882525/4-sons-electrical-llc/subcontractors/",
  "city": "Glendale",
  "state": "AZ",
  "postalCode": "85301",
  "phone": "(480) 349-0457",
  "website": "https://4sonselectrical.com/",
  "description": "4 Sons Electrical is a family owned business...",
  "primaryTrade": "Electrical Contractors",
  "trades": ["Electrical Contractors"],
  "services": ["Energy Efficient Design", "Safety Inspections", "Lighting Design Services"],
  "csiCodes": ["26 00 00 - Electrical", "26 05 00 - Common Work Results for Electrical"],
  "serviceStates": ["Arizona"],
  "scrapedAt": "2026-09-27T14:53:42.000Z"
}
```

#### Data table

| Field | Type | Description |
|---|---|---|
| `companyId` | string | Blue Book's own numeric ID for the company. |
| `companyName` | string | Company name. |
| `companyType` | string | General contractor, subcontractor, supplier, manufacturer, vendor service, engineer or architect. |
| `profileUrl` | string | Link to the public Blue Book profile. |
| `city` / `state` / `postalCode` / `country` | string | Published address, when Blue Book shows it. |
| `phone` / `phoneE164` | string | Phone number in display and dialable formats. |
| `website` | string | Company website, tracking parameters removed. |
| `email` | string | Contact email, when published on the profile. |
| `annualVolume` | string | Annual revenue band, when published. |
| `dunsNumber` | string | DUNS number, when published. |
| `description` | string | The company's own "Our Story" text. |
| `listedSinceYear` | number | The year the company joined Blue Book, when shown. |
| `primaryTrade` | string | The trade the company is filed under on this profile. |
| `trades` / `services` / `csiCodes` | array | Every published trade, service line and CSI code. |
| `serviceStates` / `serviceCounties` | array | States and counties the company says it serves. |
| `logoUrl` | string | Company logo, when the company has uploaded one. |
| `scrapedAt` | string | When the record was collected. |

### 💰 Pricing

You pay for each company found, plus a small separate fee for each profile opened while searching for a match. A broad search, where most of the profiles opened turn out to match, costs very little per company. A narrow city or trade combination checks more profiles per match, so it costs somewhat more per company found, but never for profiles still waiting in the queue. There is no subscription. Set Max companies, or your own per-run charge cap, to bound what any run can cost.

### ⭐ Enjoying Blue Book Contractor Scraper?

<table width="100%" style="display:table;width:100%">
<tr>
<td style="padding:20px 24px 14px;background:#FFF3EA;border:1px solid #FBD3B4;border-left:5px solid #EA580C;border-radius:10px 10px 0 0">
<span style="font-size:20px;letter-spacing:4px">⭐ ⭐ ⭐ ⭐ ⭐</span><br>
<span style="font-size:17px;font-weight:800;color:#1C1917">Did this save you from copying listings by hand?</span><br>
<span style="font-size:14px;color:#57534E">A 5-star rating takes 10 seconds and helps other lead-gen and sales teams find it. Your feedback also tells us what to build next.</span>
</td>
</tr>
<tr>
<td style="padding:0;background:#EA580C;border:1px solid #FBD3B4;border-top:none;border-radius:0 0 10px 10px;text-align:center">
<a href="https://apify.com/getascraper/thebluebook-contractor-directory/reviews" style="display:block;padding:13px 16px;color:#FFFFFF;text-decoration:none;font-weight:800;font-size:15px;letter-spacing:0.3px">★&nbsp;&nbsp;Rate this Actor on Apify</a>
</td>
</tr>
</table>

### 💡 Tips

- Combine a state with a trade keyword for a tightly targeted list instead of browsing an entire state.
- Turn on Only companies with a website if you plan to email or visit company sites afterward.
- Use Company profile URLs to refresh data on companies you already track, without running a search.
- Raise Max profiles to check if a narrow city or trade combination is not finding enough matches.

### ❓ FAQ

**Do I need a Blue Book account to use this?**
No. The Actor reads the same public profile pages anyone can view without signing in, and it never touches quote requests or account features.

**Can I search by trade instead of company name?**
Yes. Trade keywords match against every trade, service and CSI code a company has published, not just its main category.

**Why does a narrow search cost more per company than a broad one?**
Finding a match in a narrow city or trade combination means opening more profiles that turn out not to match. Each profile opened has a small fee; each company found has its own fee on top.

**Does this include Blue Book's private contact directory or certifications?**
No. Only what a company has chosen to publish on its public profile page is collected. Contact-request forms and gated documents are not accessed.

### 🔗 Other actors

- [GovDeals Vehicle Auction Scraper: Government Surplus Vehicles](https://apify.com/getascraper/govdeals-vehicle-auction-scraper) ↗ - Government surplus vehicle and equipment auctions.
- [HomeStars Scraper: Canadian Contractor Leads](https://apify.com/getascraper/homestars-scraper) ↗ - Canadian contractor leads with reviews and contact info.
- [Multi-state contractor license verifier](https://apify.com/getascraper/multistate-contractor-license-verifier) ↗ - Check a contractor's license across several US states.
- [SAM.gov Contract Monitor: Federal Opportunities Scraper](https://apify.com/getascraper/sam-gov-contract-monitor) ↗ - Federal contract opportunities for contractors who bid on public work.

# Changelog

This Actor's version history is a separate document: https://apify.com/getascraper/thebluebook-contractor-directory/changelog.md

# Actor input Schema

## `profileUrls` (type: `array`):

Known Blue Book profile URLs (thebluebook.com/iProView/...) to collect directly. When given, only these companies are collected and every filter below is ignored.

## `regions` (type: `array`):

States to collect companies from. Leave empty to cover every state and Alberta, which is a much larger run.

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

Keep only these company types, as Blue Book itself classifies them. Leave empty for all types.

## `cityKeywords` (type: `array`):

Keep only companies whose published city matches one of these names, for example Phoenix or Tucson. Leave empty for every city in the selected states.

## `tradeKeywords` (type: `array`):

Keep only companies whose trades, services or CSI codes mention any of these words, for example Electrical, Roofing or 09 67 00.

## `requireWebsite` (type: `boolean`):

Skip companies that have not published a website on their Blue Book profile.

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

US residential proxy is the default. The Blue Book refuses most requests from datacenter proxies.

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

Most companies to return in this run.

## `maxProfilesToCheck` (type: `integer`):

When a state, type, city or trade filter is narrow, the most company profiles to open while looking for matches. Keeps a narrow search from running for a long time.

## Actor input object example

```json
{
  "profileUrls": [],
  "regions": [
    "AZ"
  ],
  "companyTypes": [
    "general-contractors",
    "subcontractors"
  ],
  "cityKeywords": [],
  "tradeKeywords": [],
  "requireWebsite": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  },
  "maxItems": 20,
  "maxProfilesToCheck": 500
}
```

# Actor output Schema

## `dataset` (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 = {
    "profileUrls": [],
    "regions": [
        "AZ"
    ],
    "companyTypes": [
        "general-contractors",
        "subcontractors"
    ],
    "cityKeywords": [],
    "tradeKeywords": [],
    "requireWebsite": false,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "US"
    },
    "maxItems": 20,
    "maxProfilesToCheck": 500
};

// Run the Actor and wait for it to finish
const run = await client.actor("getascraper/thebluebook-contractor-directory").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 = {
    "profileUrls": [],
    "regions": ["AZ"],
    "companyTypes": [
        "general-contractors",
        "subcontractors",
    ],
    "cityKeywords": [],
    "tradeKeywords": [],
    "requireWebsite": False,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "US",
    },
    "maxItems": 20,
    "maxProfilesToCheck": 500,
}

# Run the Actor and wait for it to finish
run = client.actor("getascraper/thebluebook-contractor-directory").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 '{
  "profileUrls": [],
  "regions": [
    "AZ"
  ],
  "companyTypes": [
    "general-contractors",
    "subcontractors"
  ],
  "cityKeywords": [],
  "tradeKeywords": [],
  "requireWebsite": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  },
  "maxItems": 20,
  "maxProfilesToCheck": 500
}' |
apify call getascraper/thebluebook-contractor-directory --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,getascraper/thebluebook-contractor-directory"
        }
    }
}
```

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/nooK5MyaKaTFaO8Vl/builds/cKevS0QLvlNuJqFox/openapi.json
