# YellowPages.com Business Listings and Ratings Scraper (`nimbryxo-studio/yellowpages-com-business-listings-and-ratings`) Actor

Search YellowPages.com businesses by keyword and location or ZIP, browse a category, or enrich known profile URLs, filtering by rating, review count and years in business.

- **URL**: https://apify.com/nimbryxo-studio/yellowpages-com-business-listings-and-ratings.md
- **Developed by:** [Nimbryxo-studio](https://apify.com/nimbryxo-studio) (community)
- **Categories:** Lead generation, Automation, E-commerce
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.49 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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

## YellowPages.com Business Listings and Ratings Scraper

YellowPages.com remains one of the largest searchable directories of US local businesses — restaurants, contractors, salons, repair shops and more. This actor turns a keyword-and-location search, a category browse page, or a list of business profile URLs into structured records with contact info, star rating, review count and hours.

### What this actor does

- Searches by keyword plus a city/state or ZIP code, matching YellowPages' own search box
- Browses a specific category-and-location combination using YellowPages' category slugs
- Enriches a known list of business profile URLs directly, skipping the search step entirely
- Sorts results by relevance, distance, rating or name, the same options YellowPages itself offers
- Filters on minimum rating, minimum review count, years in business, website presence and currently-open status
- Omits any field a listing didn't actually show — no empty strings or nulls in the output

### Output per business

- `businessId` — YellowPages' internal listing ID
- `name`, `businessUrl`
- `website` — the business's own site, when listed
- `phone`
- `categories[]`, `primaryCategory`
- `rating` — 0.5–5.0 stars, only once the business has at least one review
- `reviewCount`, `yearsInBusiness`
- `openStatus` — e.g. "open now", "open 24 hours", "Closed"
- `streetAddress`, `city`, `state`, `zipCode`, `fullAddress`
- `snippet` — short description or review excerpt shown on the results page
- `generalInfo` — longer business description, only with profile enrichment or `businessDetail` mode
- `servicesProducts[]` — listed services or products, only with profile enrichment or `businessDetail` mode
- `hours[]` — `{day, hours}` opening-hours entries, only with profile enrichment or `businessDetail` mode
- `searchLocation` — the location you searched with (`search`/`category` modes)
- `recordType: "business"`, `scrapedAt`

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | string | `search` | `search`, `category` or `businessDetail` |
| `searchTerms` | string | `restaurants` | What to search for (mode=search); leave blank to list everything at the location |
| `geoLocationTerms` | string | `New York, NY` | City + state or a 5-digit ZIP code (mode=search) |
| `categorySlug` | string | – | YellowPages category slug, e.g. `plumbers` (mode=category) |
| `locationSlug` | string | – | YellowPages location slug, e.g. `new-york-ny` (mode=category) |
| `detailUrls` | array | `[]` | Business profile URLs to fetch directly (mode=businessDetail) |
| `sortBy` | string | `default` | `default`, `distance`, `average_rating` or `name` |
| `fetchBusinessDetails` | boolean | `false` | Visit each business's profile page for hours, description and services (search/category modes); slower |
| `minRating` | string | – | Only keep businesses rated at least this many stars (1–5) |
| `minReviewCount` | integer | – | Only keep businesses with at least this many reviews |
| `minYearsInBusiness` | integer | – | Only keep businesses operating at least this many years |
| `hasWebsiteOnly` | boolean | `false` | Only keep businesses that list a website |
| `openNowOnly` | boolean | `false` | Only keep businesses currently shown as open |
| `maxItems` | integer | `30` | Hard cap on emitted records (1–500) |

#### Example: top-rated plumbers in a city

```json
{
  "mode": "search",
  "searchTerms": "plumbers",
  "geoLocationTerms": "New York, NY",
  "sortBy": "average_rating",
  "minRating": "4",
  "maxItems": 50
}
```

#### Example: search by ZIP code, open right now

```json
{
  "mode": "search",
  "searchTerms": "pizza",
  "geoLocationTerms": "10005",
  "openNowOnly": true,
  "maxItems": 30
}
```

#### Example: a full category browse with enrichment

```json
{
  "mode": "category",
  "categorySlug": "hair-salons",
  "locationSlug": "los-angeles-ca",
  "fetchBusinessDetails": true,
  "maxItems": 20
}
```

#### Example: enrich a known list of profile URLs

```json
{
  "mode": "businessDetail",
  "detailUrls": [
    "https://www.yellowpages.com/new-york-ny/mip/local-plumbing-new-york-ny-550182424"
  ]
}
```

### Use cases

- **Local SEO and marketing agencies** — build a prospect list by category and city
- **Lead generation** — filter on rating, review count and years in business to find established targets
- **Market research** — compare business density and ratings across categories and cities
- **Directory cross-checking** — reconcile a business's YellowPages listing against your own records
- **Competitive tracking** — watch a category's ratings and review counts shift over time
- **Bulk enrichment** — turn a list of known profile URLs into structured contact records

### FAQ

**Is this affiliated with YellowPages.com or YP Holdings?**
No. This is an independent actor that reads publicly available pages on yellowpages.com; it is not affiliated with YP Holdings.

**What's the real difference between `search` and `category` mode?**
`search` matches the YellowPages search box — a free-text keyword plus a city/ZIP, sortable any way YellowPages allows. `category` goes straight to a specific category-and-location browse page when you already know both slugs, skipping the keyword search.

**Why is `rating` missing for some businesses?**
YellowPages only shows a star rating once a business has at least one review; unrated businesses omit the field instead of showing a zero.

**Why are `generalInfo`, `servicesProducts` and `hours` sometimes absent?**
Those fields only come from a business's own profile page. They appear when `fetchBusinessDetails` is on, or always in `businessDetail` mode — leaving enrichment off keeps `search`/`category` runs faster.

**What location formats work?**
`City, ST` (e.g. `Chicago, IL`) or a 5-digit ZIP code (e.g. `60601`); coverage is US-only.

**How current is the listing data?**
Each run reads the live YellowPages page, so results reflect whatever is currently published.

**Why did a heavily filtered search come back empty?**
Combining several filters — minimum rating, minimum reviews and open-now, for example — can legitimately exclude every match in a small result set; try a broader location or fewer filters at once.

# Actor input Schema

## `mode` (type: `string`):

What to fetch from YellowPages.com.

## `searchTerms` (type: `string`):

What to search for, e.g. `restaurants`, `plumbers`, `Starbucks`. Leave blank to list all businesses at the location.

## `geoLocationTerms` (type: `string`):

City + state (e.g. `New York, NY`) or a 5-digit ZIP code (e.g. `10005`).

## `categorySlug` (type: `string`):

YellowPages category slug, e.g. `plumbers`, `pizza`, `hair-salons`, `auto-repair-service`. Found in category browse URLs: yellowpages.com/{location}/{category}.

## `locationSlug` (type: `string`):

YellowPages location slug, e.g. `new-york-ny`, `los-angeles-ca`, `chicago-il`.

## `detailUrls` (type: `array`):

Full YellowPages business profile URLs (containing `/mip/`), e.g. `https://www.yellowpages.com/new-york-ny/mip/some-business-123456`.

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

How YellowPages should order results (applies to search and category modes).

## `fetchBusinessDetails` (type: `boolean`):

For search/category modes, visit each business's profile page to add hours, general info, and services/products. Slower and less reliable — leave off for fast, reliable runs.

## `minRating` (type: `string`):

Only keep businesses with at least this star rating.

## `minReviewCount` (type: `integer`):

Only keep businesses with at least this many reviews.

## `minYearsInBusiness` (type: `integer`):

Only keep businesses that have been operating for at least this many years.

## `hasWebsiteOnly` (type: `boolean`):

Only keep businesses that list a website link.

## `openNowOnly` (type: `boolean`):

Only keep businesses shown as currently open.

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

Hard cap on emitted records.

## Actor input object example

```json
{
  "mode": "search",
  "searchTerms": "restaurants",
  "geoLocationTerms": "New York, NY",
  "detailUrls": [],
  "sortBy": "default",
  "fetchBusinessDetails": false,
  "hasWebsiteOnly": false,
  "openNowOnly": false,
  "maxItems": 30
}
```

# Actor output Schema

## `businesses` (type: `string`):

Dataset containing all scraped Yellow Pages 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 = {
    "mode": "search",
    "searchTerms": "restaurants",
    "geoLocationTerms": "New York, NY",
    "detailUrls": [],
    "sortBy": "default",
    "fetchBusinessDetails": false,
    "hasWebsiteOnly": false,
    "openNowOnly": false,
    "maxItems": 30
};

// Run the Actor and wait for it to finish
const run = await client.actor("nimbryxo-studio/yellowpages-com-business-listings-and-ratings").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 = {
    "mode": "search",
    "searchTerms": "restaurants",
    "geoLocationTerms": "New York, NY",
    "detailUrls": [],
    "sortBy": "default",
    "fetchBusinessDetails": False,
    "hasWebsiteOnly": False,
    "openNowOnly": False,
    "maxItems": 30,
}

# Run the Actor and wait for it to finish
run = client.actor("nimbryxo-studio/yellowpages-com-business-listings-and-ratings").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 '{
  "mode": "search",
  "searchTerms": "restaurants",
  "geoLocationTerms": "New York, NY",
  "detailUrls": [],
  "sortBy": "default",
  "fetchBusinessDetails": false,
  "hasWebsiteOnly": false,
  "openNowOnly": false,
  "maxItems": 30
}' |
apify call nimbryxo-studio/yellowpages-com-business-listings-and-ratings --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nimbryxo-studio/yellowpages-com-business-listings-and-ratings"
        }
    }
}
```

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/JxwOgWo4xq5H8hWrW/builds/9i5Pd4hRAuFDfqWRp/openapi.json
