# Yellow Pages Canada Scraper — Business Leads (`muhammadafzal/yellow-pages-ca-scraper`) Actor

Scrape Yellow Pages Canada listings with names, phones, websites, addresses, categories, ratings, and structured local business leads.

- **URL**: https://apify.com/muhammadafzal/yellow-pages-ca-scraper.md
- **Developed by:** [Muhammad Afzal](https://apify.com/muhammadafzal) (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 $3.00 / 1,000 business listing scrapeds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Yellow Pages Canada Scraper — Business Leads

Scrape Canadian business listings from **YellowPages.ca** — the largest business directory in Canada. Extract business names, phone numbers, emails, addresses, websites, ratings, reviews, operating hours, social media links, and geo-coordinates. Search by keyword + location or paste direct URLs.

### Use Cases

- **B2B Lead Generation:** Build targeted prospect lists of Canadian SMBs by category and city for outbound sales
- **Local SEO Analysis:** Audit client listings against top-ranked competitors across Canadian markets
- **Market Research:** Map business density, compare ratings, and track competitor coverage across provinces
- **CRM Enrichment:** Enrich existing business databases with verified phone, website, address, and social handles
- **Recruiting:** Find trades and skilled-trade employers (plumbers, electricians, contractors) for sourcing
- **Directory Building:** Build structured local-business corpora for RAG, LLM training, or data products

### Features

- **Multi-input mode:** Search by keyword + location OR paste direct YellowPages.ca URLs
- **Detail page enrichment:** Optional visit to each business detail page for email, hours, social links, services, photos, coordinates
- **Customer reviews:** Optional review extraction (author, rating, text, date)
- **Anti-bot handling:** Residential CA proxies + session rotation + stealth browser args
- **Pagination:** Automatic pagination through search results (configurable max pages)
- **Sort options:** Default, distance, name, or rating
- **MCP-optimized:** Semantic field names, structured output, AI-agent-ready schema
- **Pay-per-event:** Only charged for results actually extracted

### Input Parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `searchTerms` | string\[] | `["plumber"]` | Keywords/categories to search (cross-joined with locations) |
| `locations` | string\[] | `["Toronto, ON"]` | Canadian locations in "City, Province" format |
| `startUrls` | array | `[]` | Direct YellowPages.ca URLs (search, category, or detail pages) |
| `maxResults` | integer | `100` | Hard cap on total business records (0 = unlimited) |
| `maxPagesPerSearch` | integer | `10` | Max result pages to crawl per search term × location |
| `extractDetails` | boolean | `true` | Visit detail pages for richer fields (email, hours, social, etc.) |
| `includeReviews` | boolean | `false` | Extract customer reviews (requires extractDetails) |
| `maxReviewsPerBusiness` | integer | `30` | Max reviews per business (0 = all, ~500 cap) |
| `sortBy` | enum | `"default"` | Sort: default, distance, name, or rating |
| `proxyConfiguration` | object | CA residential | Proxy settings (CA residential required) |
| `maxConcurrency` | integer | `5` | Concurrent browser pages |

### Output Data

Each record contains:

| Field | Type | Description |
|-------|------|-------------|
| `businessName` | string | Business name |
| `phone` | string|null | Phone number |
| `email` | string|null | Email address (from detail page) |
| `website` | string|null | Business website URL |
| `address` | object | {street, city, province, postalCode} |
| `addressFormatted` | string|null | Full address as single string |
| `coordinates` | object|null | {lat, lng} geo-coordinates |
| `categories` | string\[] | Business categories |
| `primaryCategory` | string|null | First category |
| `rating` | number|null | Star rating (1-5) |
| `reviewCount` | number|null | Total review count |
| `hours` | object|null | Day-by-day operating hours |
| `socialLinks` | object | {facebook, instagram, linkedin, twitter, youtube} |
| `logo` | string|null | Logo image URL |
| `photos` | string\[] | Photo image URLs |
| `services` | string\[] | Services offered |
| `paymentMethods` | string\[] | Accepted payment methods |
| `yearsInBusiness` | number|null | Years in operation |
| `claimed` | boolean|null | Whether listing is owner-claimed |
| `profileUrl` | string | YellowPages.ca profile URL |
| `yellowPagesId` | string|null | Internal YP listing ID |
| `searchTerm` | string|null | Search keyword used |
| `searchLocation` | string|null | Search location used |
| `sourceUrl` | string | Page URL where data was extracted |
| `scrapedAt` | string | ISO 8601 timestamp |
| `reviews` | array|undefined | Customer reviews (if enabled) |

#### Sample Output

```json
{
  "businessName": "Joe's Plumbing Inc",
  "phone": "+1 416-555-0123",
  "email": "info@joesplumbing.ca",
  "website": "https://joesplumbing.ca",
  "address": {
    "street": "123 Main Street",
    "city": "Toronto",
    "province": "ON",
    "postalCode": "M1M 1M1"
  },
  "addressFormatted": "123 Main Street, Toronto, ON, M1M 1M1",
  "coordinates": { "lat": 43.6532, "lng": -79.3832 },
  "categories": ["Plumbing", "Contractor"],
  "primaryCategory": "Plumbing",
  "rating": 4.5,
  "reviewCount": 127,
  "hours": { "Monday": "8:00-17:00", "Tuesday": "8:00-17:00" },
  "socialLinks": {
    "facebook": "https://facebook.com/joesplumbing",
    "instagram": null,
    "linkedin": null,
    "twitter": null,
    "youtube": null
  },
  "logo": "https://...",
  "photos": ["https://..."],
  "services": ["Drain cleaning", "Pipe repair"],
  "paymentMethods": ["Visa", "Mastercard"],
  "yearsInBusiness": 15,
  "claimed": true,
  "profileUrl": "https://www.yellowpages.ca/bus/Ontario/Toronto/Joes-Plumbing/12345.html",
  "yellowPagesId": "12345",
  "searchTerm": "plumber",
  "searchLocation": "Toronto, ON",
  "sourceUrl": "https://www.yellowpages.ca/search/si/1/plumber/Toronto+ON",
  "scrapedAt": "2026-07-02T10:30:00.000Z"
}
```

### Pricing

This actor uses **pay-per-event pricing**:

| Event | Price | Description |
|-------|-------|-------------|
| Actor Start | $0.00005 | Charged once per run start |
| Business Scraped | $0.003 | Per business listing extracted |

#### Cost Examples

- Scrape 100 businesses → $0.30
- Scrape 1,000 businesses → $3.00
- Scrape 10,000 businesses → $30.00

### Code Examples

#### JavaScript

```javascript
const { ApifyClient } = require('apify-client');

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });

const run = await client.actor('muhammadafzal/yellow-pages-ca-scraper').call({
  searchTerms: ['plumber'],
  locations: ['Toronto, ON', 'Montreal, QC'],
  maxResults: 200,
  extractDetails: true
});

const dataset = await client.dataset(run.defaultDatasetId).listItems();
console.log(dataset.items);
```

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")
run = client.actor("muhammadafzal/yellow-pages-ca-scraper").call(run_input={
    "search_terms": ["dentist"],
    "locations": ["Vancouver, BC"],
    "max_results": 500,
    "extract_details": True
})
dataset = client.dataset(run["defaultDatasetId"]).list_items()
for item in dataset:
    print(item["businessName"], item["phone"], item["email"])
```

### Technical Notes

- **Proxy:** Canadian residential proxies are **required** — YellowPages.ca uses CloudFront geo-blocking that blocks datacenter IPs and non-CA traffic
- **Crawler:** PlaywrightCrawler with stealth browser args and session rotation
- **Speed:** ~2-5 seconds per search page, ~3-8 seconds per detail page
- **Limits:** YellowPages.ca returns up to ~500 results per search term × location pair

### FAQ

**Q: Why am I getting 0 results?**
A: Ensure proxy is set to Canadian residential (CA). YellowPages.ca geo-blocks non-Canadian IPs. Check that your search terms and locations are valid Canadian locations.

**Q: Can I scrape all of Canada?**
A: Yes — leave `locations` empty (defaults to Toronto, ON). For comprehensive coverage, specify multiple cities: `["Toronto, ON", "Montreal, QC", "Vancouver, BC", "Calgary, AB", "Ottawa, ON"]`.

**Q: Why is email null for some businesses?**
A: Email is only available on the business detail page. Ensure `extractDetails` is `true`. Some businesses don't list emails publicly.

**Q: How do I get reviews?**
A: Enable both `extractDetails` and `includeReviews`. Reviews increase runtime significantly.

### What is Yellow Pages Canada Scraper?

**Yellow Pages Canada Scraper** turns the target data into structured, reusable results on Apify. Use it when you need repeatable collection for sales teams, agencies, recruiters, market researchers, and data-enrichment workflows without maintaining a custom scraper or one-off integration. Run it manually, schedule recurring jobs, call it through the Apify API, or connect it to an AI agent through the Apify MCP server.

The Actor stores results in an Apify dataset, where they can be previewed and exported as JSON, CSV, Excel, XML, or RSS. Availability and completeness depend on the source, supplied inputs, public visibility, authentication requirements, and upstream rate limits.

### Use cases for Yellow Pages Canada Scraper

- Build structured datasets for research, reporting, enrichment, or monitoring.
- Automate repetitive collection with schedules, webhooks, and API calls.
- Feed clean records into spreadsheets, databases, CRMs, BI tools, AI agents, or RAG pipelines.
- Track changes over time by running the same validated input on a schedule.
- Replace fragile manual copy-and-paste work with a reproducible Apify workflow.

### How to use Yellow Pages Canada Scraper

1. Open the Actor input page and choose a focused, valid target.
2. Set a conservative result limit for the first run.
3. Start the Actor and inspect the dataset for coverage and field availability.
4. Export the results or connect the dataset to your downstream system.
5. Scale gradually and use scheduling, pagination, or proxies when supported.

#### Important input options

- `searchTerms` — Keywords or business categories to search for on YellowPages.ca (e.g. plumber, dentist, restaurant). Each term is cross-joined with every location — 2 terms x 3 locations = 6 searches. Use t
- `locations` — Canadian locations in 'City, Province' or 'City, ST' format (e.g. 'Toronto, ON', 'Montreal, QC', 'Vancouver, BC'). Each location is cross-joined with every search term. Leave empty to search
- `startUrls` — Direct YellowPages.ca URLs to scrape. Accepts search results pages (yellowpages.ca/search/...), category pages (yellowpages.ca/ON/Toronto/Plumbers), or individual business detail pages (yell
- `maxResults` — Hard cap on total business records extracted across all searches and URLs. Set to 0 for unlimited (internal cap of 10,000 applies). The actor stops paginating once this number is reached.
- `maxPagesPerSearch` — Maximum number of result pages to crawl per (search term x location) pair or per start URL. YellowPages.ca typically shows up to 50 results per page. Set higher for more exhaustive crawls.
- `extractDetails` — When enabled, follow each business's detail page on YellowPages.ca to extract additional fields (email, full hours, social links, services, payment methods, years in business, logo, photos,
- `includeReviews` — Embed customer reviews for each business when 'Visit Detail Pages' is also enabled. Off by default — significantly increases runtime as each business needs additional review page fetches.
- `maxReviewsPerBusiness` — Maximum number of customer reviews to capture per business when 'Include Reviews' is enabled (most recent first). Set to 0 to capture every available review (internal hard cap of ~500 applie

### API and automation example

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('muhammadafzal/yellow-pages-ca-scraper').call({
  // Add the same input fields you use in the Apify Console.
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

### Related Apify Actors

Use these dedicated tools when a neighboring data source or workflow is a better match:

- [Instagram Followers & Following Scraper — With Cookies](https://apify.com/muhammadafzal/instagram-following-scraper)
- [Leads Finder Pro - B2B Leads with Emails \[Apollo Alternative\]](https://apify.com/muhammadafzal/leads-finder-pro)
- [Yellow Pages US Scraper — Business Leads & Reviews](https://apify.com/muhammadafzal/yellow-pages-us-scraper)
- [Yellow Pages Australia Scraper — Business Leads & Reviews](https://apify.com/muhammadafzal/yellow-pages-au-scraper)
- [OpenTable Restaurants, Ratings & Reviews Scraper](https://apify.com/muhammadafzal/opentable-scraper)
- [Etsy Scraper Pro — Products, Prices, Reviews & Shop Data](https://apify.com/muhammadafzal/etsy-scraper-pro)
- [Shopify Store Scraper - Products, Reviews & Emails](https://apify.com/muhammadafzal/shopify-store-scraper)
- [🔧 USA Plumbers Scraper — Leads with Phone, Address & Website](https://apify.com/muhammadafzal/usa-plumbers-scraper)
- [California CSLB Contractor License Scraper](https://apify.com/muhammadafzal/cslb-california-scraper)
- [USA HVAC Leads Scraper — Verified Emails (AC, Heating)](https://apify.com/muhammadafzal/hvac-lead-scraper)

### Frequently asked questions

#### How many results can I scrape with Yellow Pages Canada Scraper?

The practical total depends on the source, input limits, pagination, available records, run timeout, and upstream restrictions. Start with a small run, verify the output, and increase the limit gradually.

#### Can I integrate Yellow Pages Canada Scraper with other apps?

Yes. Use Apify integrations, webhooks, schedules, dataset exports, Make, Zapier, Google Sheets, cloud storage, or your own application.

#### Can I use Yellow Pages Canada Scraper with the Apify API?

Yes. Start runs with the Apify REST API or an official Apify client, then retrieve records from the run's default dataset. Keep your API token in a secret or environment variable.

#### Can I use Yellow Pages Canada Scraper through an MCP Server?

Yes. The Apify MCP server can expose the Actor to compatible AI clients and agents. Review the input and expected cost before allowing an autonomous workflow to run it at scale.

#### Do I need proxies?

It depends on the source and volume. Use the default configuration first. For larger or geographically sensitive jobs, select an appropriate proxy configuration only when the Actor supports it.

#### Is it legal to scrape this data?

Scraping rules vary by source, jurisdiction, data type, and intended use. Collect only data you are authorized to access, respect applicable terms and privacy laws, and avoid restricted or personal data misuse. This documentation is not legal advice.

#### Your feedback

If a field is missing, a source layout has changed, or you need a supported use case documented, open an issue on the Actor page with a reproducible input and run ID.

# Actor input Schema

## `searchTerms` (type: `array`):

Keywords or business categories to search for on YellowPages.ca (e.g. plumber, dentist, restaurant). Each term is cross-joined with every location — 2 terms x 3 locations = 6 searches. Use this when the user wants to find businesses by type or keyword. Do NOT use this field when the user provides specific YellowPages.ca URLs — use startUrls instead.

## `locations` (type: `array`):

Canadian locations in 'City, Province' or 'City, ST' format (e.g. 'Toronto, ON', 'Montreal, QC', 'Vancouver, BC'). Each location is cross-joined with every search term. Leave empty to search all of Canada.

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

Direct YellowPages.ca URLs to scrape. Accepts search results pages (yellowpages.ca/search/...), category pages (yellowpages.ca/ON/Toronto/Plumbers), or individual business detail pages (yellowpages.ca/bus/...). Use this when the user provides specific URLs to scrape. Do NOT use this when the user describes a keyword or business type — use searchTerms + locations instead.

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

Hard cap on total business records extracted across all searches and URLs. Set to 0 for unlimited (internal cap of 10,000 applies). The actor stops paginating once this number is reached.

## `maxPagesPerSearch` (type: `integer`):

Maximum number of result pages to crawl per (search term x location) pair or per start URL. YellowPages.ca typically shows up to 50 results per page. Set higher for more exhaustive crawls.

## `extractDetails` (type: `boolean`):

When enabled, follow each business's detail page on YellowPages.ca to extract additional fields (email, full hours, social links, services, payment methods, years in business, logo, photos, coordinates). Roughly 2x the runtime and proxy cost. Disable for faster runs with basic fields only.

## `includeReviews` (type: `boolean`):

Embed customer reviews for each business when 'Visit Detail Pages' is also enabled. Off by default — significantly increases runtime as each business needs additional review page fetches.

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

Maximum number of customer reviews to capture per business when 'Include Reviews' is enabled (most recent first). Set to 0 to capture every available review (internal hard cap of ~500 applies).

## `sortBy` (type: `string`):

How YellowPages.ca sorts the search results before extraction. Applies to keyword + location searches only (ignored for direct URLs).

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

Apify proxy settings. Canadian residential proxies (RESIDENTIAL, country CA) are required — YellowPages.ca uses CloudFront geo-blocking and blocks datacenter IPs and non-CA residential ranges. Leave default unless you have custom proxy needs.

## `maxConcurrency` (type: `integer`):

Maximum number of concurrent browser pages. Lower this if you encounter rate-limiting or timeout errors. Increase for faster scraping on stable connections.

## Actor input object example

```json
{
  "searchTerms": [
    "plumber"
  ],
  "locations": [
    "Toronto, ON"
  ],
  "startUrls": [],
  "maxResults": 20,
  "maxPagesPerSearch": 3,
  "extractDetails": false,
  "includeReviews": false,
  "maxReviewsPerBusiness": 30,
  "sortBy": "default",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "CA"
  },
  "maxConcurrency": 5
}
```

# Actor output Schema

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

Link to the dataset containing all extracted Canadian business records.

# 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 = {
    "searchTerms": [
        "plumber"
    ],
    "locations": [
        "Toronto, ON"
    ],
    "startUrls": [],
    "maxResults": 20,
    "maxPagesPerSearch": 3,
    "extractDetails": false,
    "includeReviews": false,
    "maxReviewsPerBusiness": 30,
    "sortBy": "default",
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "CA"
    },
    "maxConcurrency": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("muhammadafzal/yellow-pages-ca-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 = {
    "searchTerms": ["plumber"],
    "locations": ["Toronto, ON"],
    "startUrls": [],
    "maxResults": 20,
    "maxPagesPerSearch": 3,
    "extractDetails": False,
    "includeReviews": False,
    "maxReviewsPerBusiness": 30,
    "sortBy": "default",
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "CA",
    },
    "maxConcurrency": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("muhammadafzal/yellow-pages-ca-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "searchTerms": [
    "plumber"
  ],
  "locations": [
    "Toronto, ON"
  ],
  "startUrls": [],
  "maxResults": 20,
  "maxPagesPerSearch": 3,
  "extractDetails": false,
  "includeReviews": false,
  "maxReviewsPerBusiness": 30,
  "sortBy": "default",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "CA"
  },
  "maxConcurrency": 5
}' |
apify call muhammadafzal/yellow-pages-ca-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=muhammadafzal/yellow-pages-ca-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/VfpprB0o2Pajj783j/builds/MD6ZTR8XXPGT2I64x/openapi.json
