# Yellow Pages US Scraper 📒 (`shahidirfan/yellow-pages-us-scraper`) Actor

Scrape Yellow Pages USA business listings by keyword, category, city, or state. Extract business names, phone numbers, addresses, websites, ratings, and contact details. Ideal for B2B lead generation, local business data extraction, market research, and sales prospecting.

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

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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

### What does Yellow Pages US Scraper do?

Yellow Pages US Scraper collects business listings from yellowpages.com and saves them as a structured dataset. Paste a Yellow Pages category URL such as `https://www.yellowpages.com/los-angeles-ca/pizza`, or enter a keyword and a city, and the Actor reads the result pages and returns each business with its categories, phone number, address, rating, review count, website and Yellow Pages profile link. It is built for lead lists, local market research, competitor checks and directory data enrichment.

### Why use Yellow Pages US Scraper?

- **Clean, structured output** - every business becomes one dataset row with consistent field names, so you can filter, sort and export without cleaning HTML by hand.
- **City and category coverage** - one run can combine several cities, categories or search phrases, and duplicate businesses are removed from the result.
- **Lead generation ready** - phone numbers, street addresses, websites and categories are exactly the fields used for outreach lists and territory planning.
- **Market research ready** - compare how many businesses compete in a category, how they are rated and how established they are in each area.
- **Runs on a schedule** - refresh a city list weekly or monthly and diff runs to spot new openings and closures.

### What data can you extract from Yellow Pages?

| Field             | Description                                                                   |
| ----------------- | ----------------------------------------------------------------------------- |
| `name`            | Business name as shown on the listing                                         |
| `id`              | Yellow Pages listing ID, stable across runs                                   |
| `categories`      | Category labels attached to the listing, such as Pizza or Italian Restaurants |
| `rating`          | Average rating from Yellow Pages reviews, for example `4.5`                   |
| `reviewCount`     | Number of reviews behind that rating                                          |
| `yearsInBusiness` | Years the business reports on Yellow Pages, when shown                        |
| `phone`           | Primary phone number                                                          |
| `street`          | Street address, when the listing publishes one                                |
| `city`            | City                                                                          |
| `state`           | Two-letter state code                                                         |
| `zip`             | ZIP code                                                                      |
| `website`         | Business website, when the listing links to one                               |
| `description`     | Short business summary shown under the listing                                |
| `url`             | Direct Yellow Pages profile URL                                               |

Fields are only included when Yellow Pages publishes a value, so every row has at least a name, a listing ID and a profile URL. Ratings and review counts come from the same listing block, so they always belong to each other.

### How to use Yellow Pages US Scraper

1. Open the Actor on Apify Store.
2. Pick one search mode: paste one or more Yellow Pages category or search URLs, type a keyword alone, or type a keyword with a city.
3. Set `maxResults` for the number of businesses you want, and `maxPages` as a safety cap.
4. Leave the proxy off for normal runs. Turn it on if a run reports blocked requests.
5. Run the Actor, then open the dataset to preview, filter and export the businesses.

The URL field is prefilled with an example so the first run works immediately. A keyword search ignores the URL list, prefilled example included, so there is nothing to clear.

A keyword on its own also works. Without a location, Yellow Pages picks the area from the request, usually the city the run appears to come from.

### Input Parameters

| Parameter            | Type             | Required | Default                         | Description                                                                                                               |
| -------------------- | ---------------- | -------- | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| `urls`               | Array of strings | No       | Los Angeles pizza category page | Yellow Pages category or search URLs to collect. Each URL is scraped in order. Ignored when a keyword or location is set. |
| `keyword`            | String           | No       | -                               | Search phrase such as `pizza` or `plumber`. A keyword search replaces the URL list for that run.                          |
| `location`           | String           | No       | -                               | City and state for the keyword search, for example `Los Angeles, CA`. Needs a keyword.                                    |
| `maxResults`         | Integer          | No       | `20`                            | Maximum number of businesses to save across all URLs.                                                                     |
| `maxPages`           | Integer          | No       | `10`                            | Maximum result pages to read per URL. Each page holds up to 30 businesses.                                                |
| `proxyConfiguration` | Object           | No       | Off by default                  | Turn Apify Proxy on if a run reports blocked requests.                                                                    |

### Output Data

| Field             | Type             | Description                      |
| ----------------- | ---------------- | -------------------------------- |
| `name`            | String           | Business name                    |
| `id`              | String           | Yellow Pages listing ID          |
| `categories`      | Array of strings | Category labels for the business |
| `rating`          | Number           | Average Yellow Pages rating      |
| `reviewCount`     | Number           | Number of reviews                |
| `yearsInBusiness` | Number           | Reported years in business       |
| `phone`           | String           | Primary phone number             |
| `street`          | String           | Street address                   |
| `city`            | String           | City                             |
| `state`           | String           | State code                       |
| `zip`             | String           | ZIP code                         |
| `website`         | String           | Business website                 |
| `description`     | String           | Short business summary           |
| `url`             | String           | Yellow Pages profile URL         |

### Usage Examples

#### Collect a city category list

Paste one category page and stop after 100 businesses:

```json
{
    "urls": ["https://www.yellowpages.com/los-angeles-ca/pizza"],
    "maxResults": 100,
    "maxPages": 5
}
```

#### Combine several cities in one run

Read the same category in several cities, with duplicates removed:

```json
{
    "urls": [
        "https://www.yellowpages.com/los-angeles-ca/pizza",
        "https://www.yellowpages.com/new-york-ny/pizza",
        "https://www.yellowpages.com/chicago-il/pizza"
    ],
    "maxResults": 300,
    "maxPages": 3
}
```

#### Search by keyword only

Enter a phrase and let Yellow Pages pick the area:

```json
{
    "keyword": "plumber",
    "maxResults": 30,
    "maxPages": 2
}
```

#### Search by keyword and location

Enter a phrase and a city. The URL list is ignored for this run:

```json
{
    "keyword": "plumber",
    "location": "Los Angeles, CA",
    "maxResults": 50,
    "maxPages": 2
}
```

#### Start from a Yellow Pages search URL

Use the search URL from your browser address bar, including its filters:

```json
{
    "urls": ["https://www.yellowpages.com/search?search_terms=pizza&geo_location_terms=Los+Angeles%2C+CA"],
    "maxResults": 60,
    "maxPages": 2
}
```

### Sample Output

One dataset item from a real run on the Los Angeles pizza category:

```json
{
    "name": "Pizza Next Door",
    "id": "1944959",
    "url": "https://www.yellowpages.com/los-angeles-ca/mip/pizza-next-door-1944959",
    "categories": ["Pizza", "Italian Restaurants", "Restaurants"],
    "rating": 4.5,
    "reviewCount": 4,
    "tripAdvisorRating": 4.5,
    "tripAdvisorReviewCount": 28,
    "yearsInBusiness": 16,
    "claimed": false,
    "phone": "(213) 622-6595",
    "street": "806 W 8th St",
    "city": "Los Angeles",
    "state": "CA",
    "zip": "90017",
    "website": "http://www.pizzanextdoor.com/",
    "imageUrl": "https://i4.ypcdn.com/blob/34845e1806a0998bd9473e8e88542c840284d831_130x130_crop.jpg?fbfdc6472",
    "description": "this is a neighborhood place that has been around for a long time. they haven't changed the interior maybe since they opened, and they are good for families. this place is so…"
}
```

### Tips for Best Results

- Use category URLs such as `/los-angeles-ca/pizza`. They paginate far deeper than a plain search result page.
- Keep `maxPages` modest for a first run, check the dataset, then raise it for the full list.
- One page holds up to 30 businesses, so `maxResults` above 30 needs at least two pages.
- When you combine cities, keep the same category so the merged list stays comparable.
- Add a location when you need results from a specific city, since a keyword on its own uses the area Yellow Pages infers from the request.
- `claimed` tells you whether the business manages its own listing, which is a useful filter when you want reachable owners rather than unclaimed listings.
- `tripAdvisorRating` is a second opinion next to the Yellow Pages rating and is only present on listings that show TripAdvisor reviews.
- Runs normally succeed without a proxy. If a run reports blocked requests, turn on Apify Proxy and retry, or use residential proxies for heavier volumes.
- A keyword that Yellow Pages has no page for fails with a clear message instead of returning an empty dataset, so check the spelling of the city and the category.
- Addresses missing a street line are listings where Yellow Pages itself does not show a street. The city, state and ZIP are still filled in.
- Ratings appear only for businesses with Yellow Pages reviews. A business without reviews has no `rating` field, which is not a scraping error.

### Frequently Asked Questions

#### Can I export the data to CSV or Excel?

Yes. Every run writes to an Apify dataset, downloadable as CSV, Excel, JSON, XML and other formats, or readable through the Apify API.

#### Can I run this Actor on a schedule?

Yes. Schedule it in Apify Console to refresh a city list daily, weekly or monthly, and compare runs to find new or closed businesses.

#### How many businesses can one run return?

As many as the category contains, up to your `maxResults` and `maxPages` limits. Large cities run into thousands of listings across many pages.

#### Can I scrape several cities or categories at once?

Yes. Add multiple URLs, or set a keyword and location. Duplicate businesses are removed by their Yellow Pages listing ID.

#### Which takes priority, the URL field or the keyword?

The keyword wins. A keyword search replaces the URL list for that run, and the prefilled example never leaks into it.

#### Why are some fields empty?

Yellow Pages publishes different details for each listing. A business without a website, a street address or reviews simply has no value for that field. Empty fields are omitted rather than filled with placeholders.

#### Do I need a proxy?

No for normal runs. The Actor works without one, and the proxy setting is off by default. If Yellow Pages starts blocking requests, turn on Apify Proxy and retry; residential proxies help at larger volumes.

#### Is this Actor suitable for non-technical users?

Yes. The Actor runs from a form in Apify Console, and the results can be downloaded without writing code.

#### Does it collect business pages one by one?

No. It reads the result pages for the category or search you give it, which is why a run finishes in seconds rather than minutes.

#### Do I have to choose a URL or a keyword?

Yes. Use URLs, a keyword alone, or a keyword with a location. A keyword search takes priority over the URL list, and a location needs a keyword.

#### What does the claimed field mean?

Claimed means the business owner has taken control of that Yellow Pages listing. Unclaimed listings are often run by the directory rather than the business, and their details can be out of date.

#### Where do the TripAdvisor fields come from?

Some Yellow Pages listings display TripAdvisor ratings next to their own. Those values are captured as `tripAdvisorRating` and `tripAdvisorReviewCount` and are left out when a listing does not show them.

#### Is it legal to scrape Yellow Pages?

Scraping public business data can be legal, but you are responsible for following applicable laws, the website terms of service and privacy rules, and for how you use the collected contact details.

### Integrations

- **Google Sheets** - Send each run to a spreadsheet for lead tracking.
- **Webhooks** - Trigger your own pipeline when a run finishes.
- **Make or Zapier** - Push new businesses into a CRM without code.
- **Apify API** - Read datasets programmatically for dashboards and enrichment jobs.
- **CSV and Excel exports** - Hand results to sales or research teams directly.

### Related Actors

- [Avvo Lawyers Scraper](https://apify.com/shahidirfan/Avvo-Scraper) - collect lawyer profiles from a professional directory.
- [OpenTable Restaurants Scraper](https://apify.com/shahidirfan/opentable-scraper) - restaurant listings and booking data.
- [Tripadvisor Hotels Scraper](https://apify.com/shahidirfan/tripadvisor-hotels-scraper) - hotel listings for hospitality research.

### Support

For issues, feature requests or custom Actor work, use the Issues tab on the Actor page or contact the developer through Apify.

### Legal Notice

This Actor is designed for legitimate collection of publicly available business information. Users are responsible for using the data responsibly and for complying with applicable laws, website terms and privacy rules.

# Actor input Schema

## `urls` (type: `array`):

Listing or search URLs, for example https://www.yellowpages.com/los-angeles-ca/pizza. Add several to cover more cities or categories. Ignored when you enter a keyword or location.

## `keyword` (type: `string`):

What to search for, for example pizza, plumber or dentist. Works on its own or with a location, and replaces the URL list for that run.

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

City and state, for example Los Angeles, CA. Optional with a keyword; without it Yellow Pages picks the area from the request.

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

Stop after this many businesses.

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

Safety cap on result pages read per URL. Each page holds up to 30 businesses.

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

Off by default, since runs usually succeed without one. Turn on Apify Proxy if a run reports blocked requests; residential proxies help at higher volume.

## Actor input object example

```json
{
  "urls": [
    "https://www.yellowpages.com/los-angeles-ca/pizza"
  ],
  "maxResults": 20,
  "maxPages": 10,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# 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 = {
    "urls": [
        "https://www.yellowpages.com/los-angeles-ca/pizza"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("shahidirfan/yellow-pages-us-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 = { "urls": ["https://www.yellowpages.com/los-angeles-ca/pizza"] }

# Run the Actor and wait for it to finish
run = client.actor("shahidirfan/yellow-pages-us-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 '{
  "urls": [
    "https://www.yellowpages.com/los-angeles-ca/pizza"
  ]
}' |
apify call shahidirfan/yellow-pages-us-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,shahidirfan/yellow-pages-us-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/KLtghbOBh1RaS0fvg/builds/j29ca4FzfgeeQ7HUq/openapi.json
