# Yellow Pages Canada Scraper — Business Leads, Phones & Emails (`yugenox/yellowpages-canada-scraper`) Actor

Scrape YellowPages.ca & PagesJaunes.ca businesses by category and city, province or all of Canada: phone, address, postal code, coordinates, website, rating, ad flag. Goes past the 2,100-result cap. Optional hours, services, socials and website emails.

- **URL**: https://apify.com/yugenox/yellowpages-canada-scraper.md
- **Developed by:** [Yugenox Corp](https://apify.com/yugenox) (community)
- **Categories:** Lead generation, Business, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 businesses

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 Scraper — business leads from YellowPages.ca & PagesJaunes.ca

Extract Canadian business listings from **YellowPages.ca** (English) and **PagesJaunes.ca** (French) by category and location: a city, a whole province, or all of Canada. Every row has the phone number, full address with postal code, **latitude/longitude**, website, categories, rating, and a flag for paid ads. You can also add opening hours, services, social media profiles and **email addresses found on each business's own website**.

No account, no cookies, nothing to set up. Type a category and a place and run it.

### Why this scraper

- **Goes past the 2,100-result limit.** YellowPages.ca never shows more than 2,100 results for one search (60 pages of 35), and for some categories many of those are repeats. When a search is bigger, for example *Plumbers in Ontario* (7,500+) or *Restaurants in Toronto* (10,000+), the actor splits it into smaller searches by city, postal area and sort order, then merges and de-duplicates the results. It maximizes coverage (99% for *Dentists in Alberta*, 84% for *Plumbers in Ontario* in our tests), and the run summary tells you how many businesses it found compared to how many the site lists.
- **Coordinates on every mappable row.** Latitude and longitude come with each listing, ready for maps, territory planning or distance filters.
- **Clean, de-duplicated data.** Paid ads repeat on page after page and can take up most of page 1. The actor saves each business once, flags ads with `isAd`, and removes duplicates across all your searches in the run.
- **English and French.** PagesJaunes.ca uses the same engine, so Quebec searches come back with French categories and descriptions.
- **Emails the directory doesn't have.** YellowPages.ca never publishes email addresses. With *Find emails on business websites* turned on, the actor visits each business's own site (home page, then its contact page) and collects email addresses and social links.
- **Bulk mode.** Enter several categories and several locations, and every combination runs in one go.

### Input

| Field | What it does |
|---|---|
| **Search terms** | Categories or keywords, e.g. `Plumbers`, `Dentists`, `Roofing contractors`, `Restaurants`. |
| **Locations** | `Toronto ON`, `Laval, QC`, `Ontario`, `BC`, or `Canada`. Every term runs in every location. |
| **Start URLs** | Optional. Paste YellowPages.ca / PagesJaunes.ca search pages (filters and sort order are kept) or individual business pages. |
| **Site / language** | English (YellowPages.ca) or French (PagesJaunes.ca). Use French category names on PagesJaunes, e.g. `Plombiers`. |
| **Max businesses per search** | Default 100. Set to `0` to take everything, including the automatic split past 2,100. |
| **Max businesses in total** | Stops the whole run at this many rows. |
| **Go past the 2,100-result limit** | On by default. It applies when a search has more than 2,100 results and your per-search limit is above 2,100. |
| **Include paid ad placements** | On by default. Ads are always flagged and de-duplicated. |
| **Add business details** | Opening hours, services, brands, specialties, languages, payment methods, social profiles and photos from each business page. |
| **Find emails on business websites** | Emails and social links from the business's own website. |

Example:

```json
{
  "searchTerms": ["Plumbers", "Electricians"],
  "locations": ["Toronto ON", "Mississauga ON", "Ottawa ON"],
  "maxItemsPerSearch": 500,
  "includeDetails": true,
  "enrichContacts": true
}
```

### Output

One row per business:

```json
{
  "listingId": "101902936",
  "name": "Drain King Plumbers",
  "phone": "647-362-2109",
  "website": "http://www.drainkingplumbers.ca/",
  "street": "100 Saint Regis Crescent",
  "city": "North York",
  "province": "ON",
  "postalCode": "M3J 1Y8",
  "fsa": "M3J",
  "fullAddress": "100 Saint Regis Crescent, North York, ON M3J 1Y8",
  "lat": 43.7550621,
  "lng": -79.4822464,
  "categories": ["Plumbers & Plumbing Contractors", "Sewer Contractors"],
  "businessType": "Plumber",
  "rating": 5,
  "reviewCount": 8,
  "isAd": true,
  "openStatus": "Open 24 hours",
  "description": "Drain King Plumbers is a locally-owned, 24/7 full-service plumbing and drain company…",
  "servicesText": "Plumbing Repairs, Pipe Replacement, Plumbing Installation, …",
  "logoUrl": "https://ssmscdn.yp.ca/image/resize/…/yp-serp-thumbnail/1.jpg",
  "ypUrl": "https://www.yellowpages.ca/bus/Ontario/North-York/Drain-King-Plumbers/101902936.html",
  "distanceKm": 14.3,
  "searchTerm": "Plumbers",
  "searchLocation": "Toronto ON",
  "site": "en",
  "page": 1,
  "position": 1,
  "sourceUrl": "https://www.yellowpages.ca/search/si/1/Plumbers/Toronto+ON",
  "scrapedAt": "2026-09-24T10:00:44.618Z",

  "openingHours": [{ "day": "Monday", "opens": "00:00", "closes": "23:59" }],
  "servicesOffered": ["Plumbing Repairs", "Drain Cleaning", "Camera Inspection"],
  "brandsCarried": ["Moen", "American Standard", "Grohe"],
  "specialties": ["Emergency Plumbing Service", "Residential", "Commercial"],
  "languagesSpoken": ["English"],
  "paymentMethods": ["American Express", "Cash", "Cheque", "Mastercard", "Visa"],
  "socials": { "facebook": "https://www.facebook.com/drainkingplumbers/", "twitter": "http://twitter.com/drainkingGTA" },
  "images": ["https://ssmscdn.yp.ca/image/resize/…/drain-king-plumbers-1.jpg"],
  "detailsFetched": true,

  "emails": ["info@drainkingplumbers.ca"],
  "websiteSocials": { "facebook": "https://www.facebook.com/drainkingplumbers" },
  "websiteStatus": "ok"
}
```

The fields from `openingHours` to `detailsFetched` appear when **Add business details** is on. `emails`, `websiteSocials` and `websiteStatus` appear when **Find emails on business websites** is on. `fsa` is the first three characters of the postal code (the forward sortation area), which is handy for territory grouping.

The dataset has three views: **Overview**, **Leads (contacts)** and **Hours & services**. The run's key-value store holds a `SUMMARY` record with the found-vs-listed count for each search.

### Use cases

- **Lead generation** for trades, home services, B2B sales and agencies: phone, website and email by category and territory.
- **Market sizing and territory planning**: count businesses by category, city, postal area or province, and map them with the coordinates.
- **Local SEO and listings audits**: check names, addresses, phones, categories, ratings and who is running paid ads.
- **Competitor tracking**: see which businesses advertise in a category and city.
- **Data enrichment**: match your CRM against the directory by phone, website or postal code.

### FAQ

**How many businesses can I get?**
Everything the site shows for a search, up to 2,100 per search. Above that, turn on *Go past the 2,100-result limit* (the default) and set *Max businesses per search* to `0` or a number above 2,100. The actor then splits the search by city, postal area and sort order. The summary reports found vs. listed for every search. In our tests *Dentists in Alberta* returned 3,196 of 3,229 listed (99%), and *Plumbers in Ontario* returned 6,322 of 7,534 (84%) instead of the 2,100 a single search shows. The site's own count includes paid ads and listings that repeat from page to page, so 100% is rarely reachable exactly.

**Why do some rows have no address or coordinates?**
Some businesses, mostly service-area trades, hide their street address on YellowPages.ca. Those rows still have a name, phone and usually a website.

**Why are there no emails without the website option?**
YellowPages.ca and PagesJaunes.ca don't publish email addresses; they only offer a contact form. The email option reads the business's own website instead, including addresses hidden behind common email-obfuscation scripts. In our tests about half of the businesses that have their own website publish an email there. Many small businesses list only a Facebook page as their website; those links are saved in `websiteSocials`.

**Can I search in French?**
Yes. Set *Site / language* to French and use French categories (`Plombiers`, `Dentistes`, `Restaurants`). You can also paste PagesJaunes.ca URLs as start URLs.

**Does it work for a whole province or all of Canada?**
Yes. Use `Ontario`, `QC`, `British Columbia` or `Canada` as the location. Large areas are split automatically, and province-wide runs take longer because they cover many cities.

**What does `isAd` mean?**
The listing was shown in a paid placement ("Ad" / "Annonce") in that search. Advertisers often also appear as organic results. The actor keeps each business once.

**What does `distanceKm` mean?**
The distance from the searched location, when the site provides it.

**How fast is it?**
Without details, about 1,000 businesses a minute (900 in 52 seconds in our tests). A split province-wide search takes a few minutes (Dentists in Alberta: 3,196 businesses in under 5 minutes). The details and email options add one or more page visits per business, about 100 businesses a minute with both on.

**What if the site is slow, blocks requests, or my run hits its time limit?**
The run still finishes successfully with everything collected up to that point, and the status message says what happened (for example *Partial — stopped at the time limit. 2,323 businesses saved*). Failed pages are retried on fresh IP addresses with backoff; if the datacenter pool is refused, the actor moves to residential proxies on its own. It stops starting new work shortly before the run's timeout (a fifth of the run, at most about a minute) so results are always saved, even on 30–60 second runs; if the timeout cuts a run short, the status message says so and suggests a longer timeout (a run that saved nothing is not charged). You are only charged for businesses that were actually saved to the dataset, and for details or emails only when that row really has them.

**Can I send the input from code with different field names?**
Yes. Besides the fields above, the actor understands common names such as `query`/`keywords` (search terms), `location`/`city` (locations), `urls` (start URLs), `maxResults`/`limit` (max businesses in total) and `language: "fr"`. A single string works where a list is expected, and a YellowPages.ca URL pasted into the search terms is treated as a start URL.

**Is it legal to scrape YellowPages.ca?**
The actor collects only public business listings that anyone can see on YellowPages.ca and PagesJaunes.ca without logging in. Many listings belong to sole proprietors, so a row can contain a person's name, phone number or an email address published on their own website, which can count as personal data. If you store or use that data, follow the privacy laws that apply to you (for example PIPEDA, GDPR and CCPA, plus Canada's anti-spam law CASL for commercial email) and the site's terms. If you are unsure, check with a lawyer. More background: [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/)

**Does it access any private data?**
No. It reads only public pages: YellowPages.ca / PagesJaunes.ca search results and business pages that anyone can open without an account, plus, when *Find emails on business websites* is on, the public home and contact pages of each business's own website. It never logs in, uses no accounts or cookies, never fills in contact forms, and collects nothing that sits behind a login.

# Actor input Schema

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

Categories or keywords, exactly as you would type them on YellowPages.ca, e.g. "Plumbers", "Dentists", "Restaurants", "Roofing contractors". Every term is searched in every location.

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

A city with its province ("Toronto ON", "Laval, QC"), a province ("Ontario", "BC") or "Canada" for the whole country.

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

Optional. Search results pages (https://www.yellowpages.ca/search/si/1/Plumbers/Toronto+ON — filters and sort order in the URL are kept) or business pages (https://www.yellowpages.ca/bus/…/123456.html). PagesJaunes.ca URLs work too.

## `site` (type: `string`):

English (YellowPages.ca) or French (PagesJaunes.ca) for search terms + locations. Same businesses; categories, descriptions and opening-status text come in the chosen language. Use French category names on PagesJaunes (e.g. "Plombiers").

## `maxItemsPerSearch` (type: `integer`):

Limit for each search term × location. 0 = everything the site lists. Searches with more than 2,100 results are split automatically (see below).

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

Stop the whole run after this many businesses. 0 = no limit.

## `splitLargeSearches` (type: `boolean`):

The site shows at most 2,100 results for any one search. When a search has more (e.g. "Restaurants" in "Ontario") and your per-search limit is above 2,100, the actor splits it by city, postal area and sort order to maximize coverage. The run summary reports found vs. listed for every search.

## `includeAds` (type: `boolean`):

Paid ads repeat on many pages; they are always de-duplicated and flagged with isAd. Turn off to keep only organic results (an advertiser still appears if it also has an organic listing).

## `includeDetails` (type: `boolean`):

Opens each business page for opening hours, services offered, brands, specialties, languages spoken, payment methods, social media profiles and photos. One extra page per business.

## `enrichContacts` (type: `boolean`):

Visits each business's own website (home page, then its contact page) and collects email addresses and social links. The directory itself does not publish emails.

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

Pages fetched in parallel. The default is fast and gentle.

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

Apify Proxy is required. The default datacenter pool works; the actor switches to residential (Canada) on its own if it gets blocked.

## Actor input object example

```json
{
  "searchTerms": [
    "Plumbers"
  ],
  "locations": [
    "Toronto ON"
  ],
  "site": "en",
  "maxItemsPerSearch": 50,
  "maxItems": 0,
  "splitLargeSearches": true,
  "includeAds": true,
  "includeDetails": false,
  "enrichContacts": false,
  "concurrency": 8,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

All scraped business listings.

## `summary` (type: `string`):

Per search: results the site lists vs. unique businesses collected, plus request and bandwidth counts.

# 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": [
        "Plumbers"
    ],
    "locations": [
        "Toronto ON"
    ],
    "maxItemsPerSearch": 50,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("yugenox/yellowpages-canada-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": ["Plumbers"],
    "locations": ["Toronto ON"],
    "maxItemsPerSearch": 50,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("yugenox/yellowpages-canada-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 '{
  "searchTerms": [
    "Plumbers"
  ],
  "locations": [
    "Toronto ON"
  ],
  "maxItemsPerSearch": 50,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call yugenox/yellowpages-canada-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,yugenox/yellowpages-canada-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/g79IGxCyyYx2RE7zN/builds/qMPltLJfxKiF1mnqL/openapi.json
