# Yellow Pages Scraper — Business Listings & Contacts (`junipr/yellow-pages-scraper`) Actor

Extract public Yellow Pages business listings with names, categories, phone numbers, websites, addresses, ratings, and area lead-gen exports.

- **URL**: https://apify.com/junipr/yellow-pages-scraper.md
- **Developed by:** [junipr](https://apify.com/junipr) (community)
- **Categories:** Lead generation, Other
- **Stats:** 8 total users, 0 monthly users, 72.4% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.90 / 1,000 result 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 Scraper — Business Listings & Contacts

Extract public Yellow Pages business listings with names, categories, phone numbers, websites, addresses, ratings, and area lead-gen exports.

### Features

- Search by keyword and location (city and state, or ZIP code)
- Extract comprehensive business data: name, address, phone, website, email, hours, ratings
- Automatic pagination to collect hundreds or thousands of results
- Optional detail page scraping for emails and business hours
- TripAdvisor rating data extracted alongside Yellow Pages ratings
- Configurable concurrency and retry settings for reliability
- Zero-config — works out of the box with sensible defaults (restaurants in New York, NY)

### Input

All fields are optional with sensible defaults. The actor runs without any configuration.

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `searchQuery` | string | `"restaurants"` | What to search for — business type, name, or keyword |
| `location` | string | `"New York, NY"` | City and state, or ZIP code |
| `maxResults` | integer | `1` | Maximum number of listings to extract (up to 5,000) |
| `maxPages` | integer | `1` | Maximum number of result pages to crawl |
| `extractEmails` | boolean | `false` | Visit detail pages to find email addresses |
| `extractPhoneNumbers` | boolean | `true` | Extract phone numbers from listings |
| `extractReviews` | boolean | `false` | Extract review counts and star ratings |
| `maxConcurrency` | integer | `5` | Simultaneous requests (1–10) |
| `maxRetries` | integer | `3` | Retry attempts per failed request |
| `requestTimeout` | integer | `30000` | Request timeout in milliseconds |

### Output

Each result is one business listing stored in the default dataset.

| Field | Type | Description |
|-------|------|-------------|
| `name` | string | Business name |
| `address` | string | null | Street address |
| `city` | string | null | City |
| `state` | string | null | Two-letter state abbreviation |
| `zip` | string | null | ZIP code |
| `phone` | string | null | Primary phone number |
| `website` | string | null | Business website URL |
| `email` | string | null | Contact email (requires `extractEmails: true`) |
| `categories` | string\[] | Category tags from Yellow Pages |
| `rating` | number | null | Yellow Pages star rating (1–5) |
| `reviewCount` | number | null | Yellow Pages review count |
| `tripAdvisorRating` | number | null | TripAdvisor star rating |
| `tripAdvisorReviewCount` | number | null | TripAdvisor review count |
| `yearsInBusiness` | number | null | Years in business, if shown |
| `hours` | object | null | Business hours by day of week |
| `detailUrl` | string | Yellow Pages detail page URL |

#### Output Example

```json
{
  "name": "Joe's Pizza",
  "address": "123 Main St",
  "city": "New York",
  "state": "NY",
  "zip": "10001",
  "phone": "(212) 555-1234",
  "website": "https://joespizza.com",
  "email": "info@joespizza.com",
  "categories": ["Pizza", "Italian Restaurants"],
  "rating": 4.5,
  "reviewCount": 127,
  "tripAdvisorRating": 4.5,
  "tripAdvisorReviewCount": 320,
  "yearsInBusiness": 42,
  "hours": {
    "Mon": "11:00 am - 10:00 pm",
    "Tue": "11:00 am - 10:00 pm",
    "Sat": "12:00 pm - 11:00 pm"
  },
  "detailUrl": "https://www.yellowpages.com/new-york-ny/mip/joes-pizza-12345678"
}
```

### Cost

This actor uses pay-per-event pricing at **$4.90 per 1,000 business listings extracted** in the queued monetization update. You are charged once per business listing successfully extracted. Running with `extractEmails: false` is faster and cheaper since it skips detail page visits.

### Limitations

- Currently supports US Yellow Pages (yellowpages.com) only
- Email extraction requires visiting individual business detail pages, which is slower but returns more data — disable it for fastest results
- Yellow Pages shows a maximum of 30 results per page and roughly 3,000 results per search query
- Some businesses may not have websites, emails, or ratings listed

### FAQ

#### How many results can I extract?

Up to 5,000 results per run. Yellow Pages shows 30 listings per page and caps search results at approximately 3,000 entries. Use specific queries and narrow locations to get the most relevant results.

#### Does it extract emails?

Yes, when `extractEmails` is enabled (default: `true`), the scraper visits each business's Yellow Pages detail page to find email addresses listed via `mailto:` links or visible contact info. Disable this option to run faster and skip the detail page step.

#### Can I scrape international Yellow Pages?

Currently US only (yellowpages.com). International Yellow Pages sites have different structures and are not supported.

#### How do I search for plumbers in Chicago?

Set `searchQuery` to `"plumbers"` and `location` to `"Chicago, IL"`. The actor will scrape all plumbers listed in that area.

#### Does it get business hours?

Yes. When `extractEmails` is enabled, the scraper visits detail pages and extracts hours from the hours table. Hours are returned as a `{ day: "HH:MM am - HH:MM pm" }` object.

#### Why are some fields null?

Not all Yellow Pages listings include every data point. Businesses without a claimed or complete profile may be missing websites, emails, ratings, or hours. The actor extracts whatever is available for each listing.

#### How does concurrency affect reliability?

Higher concurrency (`maxConcurrency`) is faster but increases the chance of rate limiting. The default of 5 is a good balance. If you see many failed requests, lower it to 2–3.

# Actor input Schema

## `searchQuery` (type: `string`):

What to search for on Yellow Pages — business type, name, or keyword (e.g. "plumbers", "Italian restaurants", "Joe's Pizza").

## `location` (type: `string`):

City and state, or ZIP code to search in (e.g. "New York, NY", "Chicago, IL", "90210").

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

Maximum number of business listings to extract. Yellow Pages shows up to 30 results per page.

## `maxPages` (type: `integer`):

Maximum number of search result pages to crawl. Each page contains up to 30 listings.

## `extractEmails` (type: `boolean`):

Visit each business detail page to find email addresses. Slower but returns more contact data.

## `extractPhoneNumbers` (type: `boolean`):

Extract phone numbers from search results. Enabled by default.

## `extractReviews` (type: `boolean`):

Extract review count and rating data from listings. Data comes from Yellow Pages and TripAdvisor ratings shown on the results page.

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

Maximum number of pages to crawl simultaneously. Higher values are faster but may trigger rate limiting.

## `maxRetries` (type: `integer`):

Maximum number of times to retry a failed request before skipping it.

## `requestTimeout` (type: `integer`):

How long to wait for a page to load before timing out, in milliseconds.

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

Proxy settings. Defaults to Apify US residential proxy for Yellow Pages reliability.

## Actor input object example

```json
{
  "searchQuery": "restaurants",
  "location": "New York, NY",
  "maxResults": 1,
  "maxPages": 1,
  "extractEmails": false,
  "extractPhoneNumbers": true,
  "extractReviews": false,
  "maxConcurrency": 5,
  "maxRetries": 3,
  "requestTimeout": 30000,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}
```

# Actor output Schema

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

Scraped business listings from Yellow Pages with full contact info and metadata.

# 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 = {
    "searchQuery": "restaurants",
    "location": "New York, NY",
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "US"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("junipr/yellow-pages-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 = {
    "searchQuery": "restaurants",
    "location": "New York, NY",
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "US",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("junipr/yellow-pages-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 '{
  "searchQuery": "restaurants",
  "location": "New York, NY",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}' |
apify call junipr/yellow-pages-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

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