# YellowPages.ca Scraper - Canadian Business Leads (`datascraperes/yellowpages-ca-business-scraper`) Actor

Extract Canadian business data from YellowPages.ca by category and city: name, phone, address, postal code, coordinates, categories, rating, reviews, hours, services and photos. Sort, paginate and deduplicate, with full detail pages. Pay only for businesses saved.

- **URL**: https://apify.com/datascraperes/yellowpages-ca-business-scraper.md
- **Developed by:** [DataScraperES](https://apify.com/datascraperes) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.75 / 1,000 business saveds

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

Turn a category and a Canadian city into structured business records from YellowPages.ca and PagesJaunes.ca. Each row carries the phone, full address, coordinates, categories, rating, review count, opening hours, services offered and photo gallery, so the dataset is ready for lead lists, CRM imports or local-market analysis.

### What this Actor does

The Actor reads the public Canadian Yellow Pages directory by business category and location, walks the result pages, deduplicates businesses by their Yellow Pages id and then loads each business page to add the details that the result list does not show: daily opening hours, the services offered list, the full description and the photo gallery. English uses **yellowpages.ca**, French uses **pagesjaunes.ca**.

You can start from search terms plus locations, from specific Yellow Pages search or business URLs, or from both in the same run.

### Use cases

- Build a Canadian B2B lead list for one trade and several cities (plumbers, dentists, HVAC, restaurants).
- Audit a local market: how many competitors exist, their categories, ratings and review counts.
- Enrich a CRM with phone numbers, postal codes and coordinates for Canadian businesses.
- Track how a category or city listing changes over time by scheduling repeated runs.

### How to use

1. Open the Actor in Apify Console.
2. Enter at least one search term and one location, for example `plumbers` and `Toronto, ON`.
3. Click **Start** and open the Dataset when the run finishes.

### Input

Only one start type is required: **search terms + locations**, or **start URLs**, or both.

| Field | Required | Description |
|---|---|---|
| `searchTerms` | with locations | Business categories or keywords, as typed on the site. Every term is combined with every location. |
| `locations` | with terms | Canadian city, optionally with the province: `Toronto, ON`. |
| `startUrls` | optional | YellowPages.ca or PagesJaunes.ca search pages and business pages. |
| `maxResults` | no | Unique businesses to save (default 100, maximum 5000). The run stops there. |
| `maxPagesPerSearch` | no | Result pages per term and location (default 3, maximum 20). Each page holds about 35 businesses. |
| `sortBy` | no | `relevance` (default), `name`, `distance`, `rating` or `reviews`. |
| `language` | no | `en` for yellowpages.ca, `fr` for pagesjaunes.ca. |
| `includeDetails` | no | Load each business page for hours, services, description and photos (default on). |
| `maxConcurrency` | no | Pages requested at the same time (default 4, maximum 8). |

```json
{
  "searchTerms": ["plumbers", "dentists"],
  "locations": ["Toronto, ON", "Mississauga, ON"],
  "startUrls": [],
  "maxResults": 150,
  "maxPagesPerSearch": 3,
  "sortBy": "rating",
  "language": "en",
  "includeDetails": true,
  "maxConcurrency": 4
}
```

### Output

Results are stored in the default Dataset, one row per unique business. Formats: JSON, CSV, Excel and XML from the Console export.

```json
{
  "businessId": "101902936",
  "name": "Drain King Plumbers",
  "url": "https://www.yellowpages.ca/bus/Ontario/North-York/Drain-King-Plumbers/101902936.html",
  "phone": "+16473622109",
  "phones": ["+16473622109"],
  "street": "100 Saint Regis Crescent",
  "city": "North York",
  "province": "ON",
  "postalCode": "M3J 1Y8",
  "country": "CA",
  "latitude": 43.7550621,
  "longitude": -79.4822464,
  "categories": ["Plumbers & Plumbing Contractors", "Sewer Line Inspection"],
  "primaryCategory": "Plumbers & Plumbing Contractors",
  "rating": 5.0,
  "reviewCount": 8,
  "hours": [
    { "days": ["Monday"], "opens": "00:00", "closes": "23:59" }
  ],
  "services": ["Plumbing Repairs", "Pipe Replacement", "Drain Cleaning"],
  "description": "Drain King Plumbers is a locally-owned, 24/7 full-service plumbing and drain company.",
  "teaser": "Premium plumbing and drain services in the Greater Toronto Area.",
  "photoCount": 11,
  "photos": ["https://ssmscdn.yp.ca/image/resize/.../photo-1.jpg"],
  "isAd": false,
  "searchTerm": "plumbers",
  "location": "Toronto ON",
  "language": "en",
  "detailLoaded": true,
  "scrapedAt": "2026-11-18T12:30:00+00:00"
}
```

A run also writes a `SUMMARY` record in the key-value store with the counters used for the run: searches, pages read, businesses saved, detail pages loaded, duplicates, not-found items, failed requests, token refreshes and transferred bytes.

Check `SUMMARY.status` before using the export. `completed` means the run finished within its configured limits. `partial` means some requests or writes failed after results were saved. `stopped` means an interruption ended collection, and `limit_reached` means the spending limit was reached. For `delivery_uncertain`, inspect the Dataset and run charges. The corresponding count is `null` when the Actor cannot confirm it.

### Pricing

Pay per event: one `business` event for each **unique business saved to the dataset**. Duplicates, skipped pages, failed requests and the run start are not charged, and there is no start fee or minimum.

| Apify discount tier | Per business | Per 1,000 businesses |
|---|---:|---:|
| FREE | $0.0025 | $2.50 |
| BRONZE | $0.00225 | $2.25 |
| SILVER | $0.002 | $2.00 |
| GOLD | $0.00175 | $1.75 |

The price that applies to your account is shown on the Actor page under **Pricing**. A 100-business run costs $0.25 or less.

### Related Actors

| Actor | Best for |
|---|---|
| [Google Maps Business Scraper | $1 per 1,000](https://apify.com/datascraperes/actor-google-maps) | Adding Google Maps ratings, review counts and coordinates to the same businesses. |
| [Website Email Scraper - Emails & Social Profiles](https://apify.com/datascraperes/website-email-social-scraper) | Turning the websites in your export into public emails and social profiles. |
| [Bulk Domain Rating Checker](https://apify.com/datascraperes/bulk-domain-rating-checker) | Scoring lead websites before you prioritise your outreach list. |

### Limits and data quality

- **Coverage is directory-driven.** YellowPages.ca repeats paid and featured listings across result pages, so a search usually yields fewer unique businesses than `maxResults`. The Actor stops a search when the directory repeats a result page instead of asking for the same page again.
- **Business website and email are not included** because the directory does not publish them reliably on the pages this Actor reads. Phone, address, coordinates, hours, services and photos are.
- **`hours`, `services`, `description` and `photos` need `includeDetails`.** Turning it off returns list-level fields only and is much faster and lighter.
- **Network access is handled by the Actor.** No network settings are exposed or needed: the Actor manages its own connections and repeat attempts.
- **Large runs are limited by the source**, not only by `maxResults`. Very broad categories in large cities can return several hundred unique businesses; narrow trades may return a few dozen.
- **The site can throttle a very long run.** If it starts refusing page after page, the Actor stops after a short streak of failures and keeps the businesses already saved, with a message explaining it. You can start a new run later. If Apify restarts a run after delivery began, the Actor keeps the existing results and stops to avoid sending them again.
- Result pages change over time, so page composition can differ between runs. Businesses are deduplicated by their Yellow Pages id inside one run.

### Frequently asked questions

#### Why did I get fewer businesses than `maxResults`?

Two reasons: the source repeated the same businesses across pages, or the category in that city simply does not have more unique entries. Lower `maxResults`, add more locations or use broader search terms.

#### Do I need to configure anything for the network?

No. The Actor manages network access and repeat attempts internally; there is nothing to set up.

#### Is PagesJaunes.ca supported?

Yes. Set `language` to `fr`, or pass a `pagesjaunes.ca` URL in `startUrls`. A start URL always keeps its own host.

#### Are emails or websites included?

No. The directory pages used by this Actor do not publish a reliable business website or inbox. The dataset documents what is available: phone, address, postal code, coordinates, categories, rating, review count, hours, services, description and photos.

#### Can I run specific business pages?

Yes. Put business URLs such as `/bus/Ontario/Toronto/Example/123456.html` in `startUrls` and set `maxResults` to the number of pages you want to read.

#### Why did the Actor stop at a repeated page?

The directory returned a page with the same business IDs again. The Actor stops that search instead of fetching identical pages, and the summary counts the duplicates.

### Responsible use

You are responsible for using the data lawfully. Respect the YellowPages.ca and PagesJaunes.ca terms of service, Canada's anti-spam and privacy law (including CASL and PIPEDA) when you contact businesses, and any contractual obligations of your organisation. This Actor reads publicly listed business information; it does not collect consumer data.

### Support

Open an issue in the **Issues** tab of this Actor with the input you used and the run ID, and describe what you expected instead.

Python, JavaScript and cURL examples, sample input and CSV: [YellowPages.ca scraper examples on GitHub](https://github.com/datacrawler-edu/yellowpages-ca-scraper-python).

# Actor input Schema

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

Business categories or keywords, as you would type them on YellowPages.ca, for example <b>plumbers</b> or <b>dentists</b>. Every term is combined with every location below.

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

Canadian cities or city plus province, for example <b>Toronto, ON</b> or <b>Montreal</b>. Every location is combined with every search term.

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

Optional. Run specific YellowPages.ca or PagesJaunes.ca pages instead of (or together with) terms and locations. Accepted: search pages like <code>https://www.yellowpages.ca/search/si/1/Plumbers/Toronto+ON</code> and business pages like <code>https://www.yellowpages.ca/bus/Ontario/Toronto/Example/123456.html</code>.

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

Stop after this many unique businesses have been saved to the dataset.

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

How many result pages to read for each term and location combination. Each page holds about 35 businesses.

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

Order of the YellowPages.ca result pages. Relevance is the site default.

## `language` (type: `string`):

English uses yellowpages.ca, French uses pagesjaunes.ca. A start URL always keeps its own host.

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

Fetch each business page to add opening hours, services offered, the full description and photo gallery. Turn off for faster, lighter result rows.

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

How many pages are requested at the same time. Higher values finish faster but are more likely to trigger the site's rate protection.

## Actor input object example

```json
{
  "searchTerms": [
    "plumbers"
  ],
  "locations": [
    "Toronto, ON"
  ],
  "startUrls": [],
  "maxResults": 20,
  "maxPagesPerSearch": 1,
  "sortBy": "relevance",
  "language": "en",
  "includeDetails": true,
  "maxConcurrency": 2
}
```

# Actor output Schema

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

One row per unique business with contact details, address, coordinates, categories, rating, hours, services and photos.

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

Counters for the run: searches, pages read, businesses saved, detail pages loaded, skipped and failed requests.

# 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"
    ],
    "startUrls": [],
    "maxResults": 20,
    "maxPagesPerSearch": 1,
    "sortBy": "relevance",
    "language": "en",
    "includeDetails": true,
    "maxConcurrency": 2
};

// Run the Actor and wait for it to finish
const run = await client.actor("datascraperes/yellowpages-ca-business-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"],
    "startUrls": [],
    "maxResults": 20,
    "maxPagesPerSearch": 1,
    "sortBy": "relevance",
    "language": "en",
    "includeDetails": True,
    "maxConcurrency": 2,
}

# Run the Actor and wait for it to finish
run = client.actor("datascraperes/yellowpages-ca-business-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"
  ],
  "startUrls": [],
  "maxResults": 20,
  "maxPagesPerSearch": 1,
  "sortBy": "relevance",
  "language": "en",
  "includeDetails": true,
  "maxConcurrency": 2
}' |
apify call datascraperes/yellowpages-ca-business-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,datascraperes/yellowpages-ca-business-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/OgtzzsHW1sdSwIufb/builds/opnHRnZ1676ukpjtP/openapi.json
