# Yellow Pages Canada Scraper - Business Leads (`b2b_leads/yellow-pages-canada-real-time-data-scraper`) Actor

Live Yellow Pages Canada business leads: search any category in any Canadian city and get name, phone, website, address, category, hours and public reviews. Streams to your dataset in real time — webhooks supported. Free plan exports a 2-result sample.

- **URL**: https://apify.com/b2b_leads/yellow-pages-canada-real-time-data-scraper.md
- **Developed by:** [Emmanuel](https://apify.com/b2b_leads) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 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

## Yellow Pages Canada Real-Time Data

Live Yellow Pages Canada business directory intelligence: search any trade or category in any Canadian city or province, collect complete business records, pull public customer reviews, and enrich every business with the contact details a sales team actually needs — phone, website, email and social profiles. Checkbox features, structured JSON streamed to your dataset in real time.

> **Free plan notice:** on the Apify Free plan this Actor exports a small sample of results per run (2 records). Upgrade to a paid Apify plan for full, unlimited exports.

### Who this is for

Built for teams that sell to Canadian businesses and need fresh, structured local-business data:

- **Lead generation** — pull plumbers, dentists, restaurants, lawyers, contractors and more from any city, with phone numbers and websites ready for outreach.
- **Local SEO & citation audits** — see who ranks in a city, who has a website, who carries ratings, and where the gaps are.
- **Market & territory sizing** — measure how many players exist in any trade in any postal area before opening a territory or hiring a rep.
- **CRM & enrichment pipelines** — stream records straight into Sheets, Airtable, HubSpot, Pipedrive, Salesforce or n8n through webhooks.
- **Franchise & network monitoring** — watch a category across cities for new openings, rating changes and contact accuracy.
- **Reviews & reputation research** — collect public customer reviews per business to analyse sentiment, service themes and rating trends.
- **AI agents & MCP workflows** — answer live directory questions inside an agent (see below).

### What you get

One dataset row per business, plus optional review rows — all streamed while the run is still going, so your pipeline starts receiving data within seconds.

| Field group | Examples |
|---|---|
| Identity | business name, business id, listing link, categories |
| Contact | phone, all listed phone numbers, website, email(s), social profiles |
| Location | street, city, province, postal code, joined address, coordinates |
| Reputation | rating (out of 5), review count, public reviews (optional rows) |
| Detail | opening hours, products & services, specialties, brands carried, languages, payment methods, description |

Coverage on a typical Canadian run is high: in a 60-row Toronto plumbing run, 100% of businesses came back with a phone number, 90% with a website, and 70% with a rating.

### Feature matrix

| Feature | What it does | Default |
|---|---|---|
| 🔎 **Business search** | Multi-task search: pair what a business does ("plumber", "restaurant", "dentist"…) with any Canadian location ("Toronto, ON", "Montreal, QC", "Laval, QC"). Each task collects its businesses across result pages — every business on every page is a row. | **On** |
| 📋 **Listing Details** | Turn business ids or listing links into complete records: phone, website, coordinates, opening hours, categories, services, specialties, payment methods, languages. | Off |
| 🔗 **Scrape By URL** | Paste a results link (one row per business on that page) or a business link (one complete record). | Off |
| 🎯 **Lead details** | Enriches **every** row in place: phone, website, email(s) — including from the business's own website — social profiles, opening hours, coordinates, categories, services. Enrich, never filter: every business is still exported. | **On** |
| ⭐ **Reviews** | Public customer reviews — one row per review (rating, date, author, text), linked to its business. | Off |
| 🌐 **Webhooks** | JSON or Slack. Every record is POSTed to your URL the moment it is collected — CRM, Zapier, Make, n8n, Google Sheets. | Off |

Features combine freely: search + lead details is the classic lead-gen run; Listing Details + Reviews is the deep-dive run; Scrape By URL re-collects a page you already track.

### Input reference

#### 🔎 Business search

| Field | Type | Default | Notes |
|---|---|---|---|
| `enableSearch` | boolean | `true` | Master switch for search. |
| `searchTasks` | array | 1 demo row | One row per search: `what`, `where`, optional `maxResults`. |
| `maxResultsPerTask` | integer | `10` | Default cap per task; override per task with `maxResults`. |
| `maxPagesPerTask` | integer | *empty* | Optional safety cap on result pages per task. Empty = keep going until this task's businesses are collected or the last page is reached. |
| `searchSort` | select | `relevance` | `relevance`, `rating`, `reviews`, `rating_reviews`, `name` (A–Z), `distance` (nearest first). |

Example `searchTasks`:

```json
[
    { "what": "plumber", "where": "Toronto, ON", "maxResults": 50 },
    { "what": "dentist", "where": "Calgary, AB", "maxResults": 50 },
    { "what": "restaurant", "where": "Montreal, QC", "maxResults": 25 }
]
```

`where` accepts a city, a city plus province code, or a full postal area. Adding the province code sharpens the search. `what` accepts everyday terms ("plumber", "coffee shop", "car repair") or directory category names.

#### 📋 Listing details

| Field | Type | Default | Notes |
|---|---|---|---|
| `enableListingDetails` | boolean | `false` | Master switch. |
| `listingIds` | string\[] | `[]` | Numeric business ids, e.g. `101902936` — the number in any listing link. |
| `listingUrls` | string\[] | `[]` | Full yellowpages.ca business links. |

Every requested id or link produces exactly one row (found or not), so counts stay predictable.

#### 🔗 Scrape By URL

| Field | Type | Default | Notes |
|---|---|---|---|
| `enableScrapeByUrl` | boolean | `false` | Master switch. |
| `scrapeUrls` | string\[] | `[]` | Results links (one row per business on the page) or business links (one full record). |

Only `yellowpages.ca` links are accepted; anything else fails validation with a clear message.

#### 🎯 Lead details

| Field | Type | Default | Notes |
|---|---|---|---|
| `enableLeadDetails` | boolean | `true` | Enrich **every** business row in place. Never filters — output count stays predictable. |

What enrichment adds, where publicly available:

- **Phone** numbers as the business publishes them.
- **Website**, and **emails** collected from the business's own site (mailboxes belonging to the business's own domain are listed first).
- **Social profiles** — Facebook, X/Twitter, LinkedIn, Instagram, YouTube, TikTok, Pinterest.
- **Opening hours**, grouped per day range.
- **Coordinates** (`lat`, `lng`).
- **Categories**, **products & services**, **specialties**, **brands carried**, **languages spoken**, **payment methods**.

Enrichment runs with bounded parallelism (see `concurrency` below) and adds a little extra time per business. A business whose details cannot be read right now is still exported with its search-card data.

#### ⭐ Reviews

| Field | Type | Default | Notes |
|---|---|---|---|
| `enableReviews` | boolean | `false` | Adds one row per public review on top of the business rows. |
| `maxReviewsPerBusiness` | integer | `10` | Cap per business (1–50). |

#### ⚙️ Output & limits

| Field | Type | Default | Notes |
|---|---|---|---|
| `maxItems` | integer | `10000` | Global dataset-row cap across all features. The run also respects your max total charge for the run. |
| `concurrency` | integer | `3` | Parallel detail lookups (1–8). Higher is faster; 3 balances speed and reliability. |
| `delayBetweenRequestsMs` | integer | `250` | Polite pacing between batches (0–5000 ms). |
| `webhookUrl` | string | `""` | Optional real-time POST per record. |
| `webhookFormat` | select | `json` | `json` (full record) or `slack` (formatted message). |
| `proxyConfiguration` | object | Residential CA | Apify residential proxy, Canada by default. Change the country only if you know why. |

### Output field reference

One dataset row per business (search), per listing, per review, or per scraped URL — identified by `featureType`:

| `featureType` | Meaning |
|---|---|
| `search` | A business found by term + location search. |
| `listing_details` | A complete record for a requested id or link. |
| `reviews` | One public review (linked to its business via `listingId`). |
| `scrape_by_url` | A record collected directly from a pasted link. |

Key fields on business rows:

| Field | Description |
|---|---|
| `name`, `listingId`, `listingUrl` | Identity: business name, business id, canonical listing link. |
| `phone`, `phones`, `website`, `emails` | Contact channels where publicly listed. |
| `socials` | Facebook / X / LinkedIn / Instagram / YouTube / TikTok / Pinterest profiles. |
| `street`, `city`, `province`, `postalCode`, `location` | Address; `location` is joined, ready for CRM import. |
| `geo` | `{ lat, lng }` coordinates. |
| `rating`, `reviewCount` | Public rating (out of 5) and review count. |
| `categories` | Business categories (e.g. `Plumbers & Plumbing Contractors`). |
| `services`, `specialties`, `brandsCarried`, `languages`, `paymentAccepted` | Detail blocks where the business publishes them. |
| `openingHours` | Grouped weekly hours: `[{ days: [...], opens, closes }]`. |
| `description`, `imageUrl` | Short profile text and logo/banner link. |
| `sponsored` | `true` when the directory marked the placement as paid. |
| `searchWhat`, `searchWhere`, `searchTaskLabel`, `position`, `totalAvailable` | Which task found this row, where it ranked, and how many businesses that search holds. |
| `leadDetails`, `detailsFetched`, `hasWebsite` | Enrichment flags for this row. |
| `scrapedAt` | ISO timestamp. |

Review rows add `businessName`, `reviewIndex`, `rating`, `date`, `author`, `text`. Listing-details rows carry the same business fields plus a `reviews` array; scrape rows also include a `data` object with extras.

### Webhook guide

Set `webhookUrl` and every record is POSTed as JSON the moment it is collected — in addition to the dataset, never instead of it.

- **JSON format** — the full record object, identical to the dataset row.
- **Slack format** — a formatted message with business name, rating, location, phone, website, email, category and a link to the listing.

Works with Slack incoming webhooks, Discord, Zapier, Make, n8n, or your own URL. Delivery is best-effort: a failing webhook never interrupts the run or the dataset writes.

### Using with AI agents (MCP)

The Actor pairs naturally with Apify's MCP server, so an agent can answer questions with live Canadian directory data:

> "Find 20 roofing companies in Mississauga, ON with a phone number and a website, sorted by rating."

> "Which dentists in Calgary, AB have more than 3 reviews and no website listed?"

> "List restaurants in Montreal, QC with their opening hours and public reviews for a competitor scan."

### FAQ

**Do I need my own proxies?**
No. The Actor runs on Apify residential proxies (Canada) by default, configured in the Connection section.

**How current is the data?**
Every run collects live from the directory while it runs — what you get reflects the listings as they stand when you press Start.

**What happens on the free plan?**
Free-plan runs export a small sample (2 records) so you can verify output quality before upgrading. Paid plans are uncapped.

**Why do some rows have no phone or website?**
The directory only shows what businesses publish. Enrichment adds what is publicly available and always exports the row regardless — nothing is filtered out.

**Why do some enriched rows have no email?**
Many small Canadian businesses simply do not publish an email. When the listing carries a website, the Actor also checks that site's contact and about pages — but if neither publishes one, there is nothing to collect.

**Can I collect the same business twice?**
No — rows are deduplicated by business id across pages and tasks, so a business that re-ranks onto a later page never produces a duplicate row.

**How fast is a run?**
A 10-row run with search on and lead details off finishes in seconds. Lead details add a little extra time per business (parallel detail lookups plus a check of the business's own website when it has one); `concurrency` trades speed against reliability. Rows stream to the dataset as they are collected, so the first results arrive well before the run ends.

**Why did my run stop before reaching the requested number of results?**
Two reasons are possible, and the log always names the one that applies:

- **Charge limit reached** — the run's maximum cost was hit. Every row that was paid for is in the dataset. Raise the run's maximum cost (or the Actor's minimum, if you published this yourself) to collect more in one run, or split the work across several runs.
- **Results could not be saved** — the dataset could not be written to after repeated attempts. Nothing is kept without being stored, so the run ends with a failure message and the storage error is reported in the log and in the `OUTPUT` summary (`errors`). Retry the run; raise the run timeout if the job was cut short by it.

A long run also needs a long enough timeout: check the run's timeout when starting large jobs (the Actor requests a long default, but a run started with a short timeout is cut off by the platform).

### Delivery

The default dataset holds every record; the per-run summary (totals, feature flags, charge-limit status, save-failure status, paywall status) is stored in the key-value store under `OUTPUT`.

# Actor input Schema

## `enableSearch` (type: `boolean`):

Search the Yellow Pages Canada directory by what a business does and where it is. Enabled by default.

## `searchTasks` (type: `array`):

Primary input. Add one row per search: pair what the business does (e.g. "plumber", "restaurant", "dentist") with a Canadian location (e.g. "Toronto, ON", "Montreal, QC", "Calgary, AB"). Add as many rows as you have markets — each row is collected in turn.

## `maxResultsPerTask` (type: `integer`):

Default maximum businesses per search task. Override per task in the list above.

## `maxPagesPerTask` (type: `integer`):

Optional safety cap on result pages per task. Leave empty to keep going until this task's businesses are collected or the directory's last page is reached.

## `searchSort` (type: `string`):

Order the directory returns results in for this run.

## `enableListingDetails` (type: `boolean`):

Fetch the complete record for specific businesses by link or by numeric business id.

## `listingIds` (type: `array`):

Numeric business ids (one per line). The id is the number in any listing link, before ".html".

## `listingUrls` (type: `array`):

Full yellowpages.ca business links (one per line).

## `enableScrapeByUrl` (type: `boolean`):

Collect directly from links you already have instead of searching.

## `scrapeUrls` (type: `array`):

yellowpages.ca search or business links (one per line).

## `enableLeadDetails` (type: `boolean`):

Enrich every business with lead details (phone, website, emails, social profiles, opening hours, coordinates, categories, services, payment methods) when publicly available. Every business is still exported even when no details are found — it adds a little extra time per business.

## `enableReviews` (type: `boolean`):

Collect public customer reviews — one row per review, linked to its business.

## `maxReviewsPerBusiness` (type: `integer`):

Cap on reviews collected per business (1–50).

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

Global cap on total dataset rows across all features. Set high for large runs (e.g. 10000+). Note: the run also respects your max total charge for this run.

## `concurrency` (type: `integer`):

How many businesses to enrich in parallel (1–8). Higher is faster; 3 is a good default.

## `delayBetweenRequestsMs` (type: `integer`):

Polite pacing between result pages and detail batches (0–5000 ms). Higher values are slower but gentler.

## `webhookUrl` (type: `string`):

Optional. Every record is always saved to the run's dataset — this webhook is an ADDITIONAL real-time push. When set, each new record is also POSTed to this URL (CRM, Slack incoming webhook, Zapier, Make, Google Sheets).

## `webhookFormat` (type: `string`):

json = full record object; slack = Slack-friendly message payload.

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

Apify residential proxy (CA) is enabled by default for reliable collection.

## Actor input object example

```json
{
  "enableSearch": true,
  "searchTasks": [
    {
      "what": "plumber",
      "where": "Toronto, ON",
      "maxResults": 10
    }
  ],
  "maxResultsPerTask": 10,
  "searchSort": "relevance",
  "enableListingDetails": false,
  "listingIds": [],
  "listingUrls": [],
  "enableScrapeByUrl": false,
  "scrapeUrls": [],
  "enableLeadDetails": true,
  "enableReviews": false,
  "maxReviewsPerBusiness": 10,
  "maxItems": 10000,
  "concurrency": 3,
  "delayBetweenRequestsMs": 250,
  "webhookUrl": "",
  "webhookFormat": "json",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "CA"
  }
}
```

# Actor output Schema

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

Complete dataset with every row from all enabled features in this run.

## `leads` (type: `string`):

Business rows with contact details, ready for outreach.

## `runSummary` (type: `string`):

Per-run metadata: totals, lead-details flag, spending-limit status, and the paywall object (detected, isPaying, pricingTier, limited, blocked, freeTierMaxItems).

# 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 = {
    "enableSearch": true,
    "searchTasks": [
        {
            "what": "plumber",
            "where": "Toronto, ON",
            "maxResults": 10
        }
    ],
    "maxResultsPerTask": 10,
    "enableLeadDetails": true,
    "maxReviewsPerBusiness": 10,
    "maxItems": 10000,
    "concurrency": 3,
    "delayBetweenRequestsMs": 250,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "CA"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("b2b_leads/yellow-pages-canada-real-time-data-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 = {
    "enableSearch": True,
    "searchTasks": [{
            "what": "plumber",
            "where": "Toronto, ON",
            "maxResults": 10,
        }],
    "maxResultsPerTask": 10,
    "enableLeadDetails": True,
    "maxReviewsPerBusiness": 10,
    "maxItems": 10000,
    "concurrency": 3,
    "delayBetweenRequestsMs": 250,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "CA",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("b2b_leads/yellow-pages-canada-real-time-data-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 '{
  "enableSearch": true,
  "searchTasks": [
    {
      "what": "plumber",
      "where": "Toronto, ON",
      "maxResults": 10
    }
  ],
  "maxResultsPerTask": 10,
  "enableLeadDetails": true,
  "maxReviewsPerBusiness": 10,
  "maxItems": 10000,
  "concurrency": 3,
  "delayBetweenRequestsMs": 250,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "CA"
  }
}' |
apify call b2b_leads/yellow-pages-canada-real-time-data-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,b2b_leads/yellow-pages-canada-real-time-data-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/ULhaToW5lMqaeXH0X/builds/8KTgkY23tPzEDypg5/openapi.json
