# Yellow Pages Scraper (`juanoox/yellowpages-scraper`) Actor

Scrape US local business listings from Yellow Pages: name, phone, address, categories, rating, review count, opening hours and website, from any search term and location.

- **URL**: https://apify.com/juanoox/yellowpages-scraper.md
- **Developed by:** [Juan ignacio Veltri](https://apify.com/juanoox) (community)
- **Categories:** Lead generation, 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 results

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?

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 — US local business data with phone, address and website

Scrape business listings from Yellow Pages by search term and city: name, phone, full address,
categories, rating, review count, opening hours and website — 30 businesses per page, straight into
a table.

### Why this one holds up

Most Yellow Pages scrapers read the page's HTML classes. Yellow Pages changes those, and those
scrapers quietly return empty rows until someone notices.

This one takes its core fields from the page's **structured data** — the `LocalBusiness` blocks the
site publishes for search engines. Yellow Pages cannot change those without damaging its own SEO,
which is exactly why they are stable.

The markup is still used, but only for the three things structured data leaves out — **categories,
website and position** — and the two sources are joined by each business's own listing path rather
than by row order. That matters more than it sounds: joining by position silently mismatches rows
whenever the page escapes a character in a name, and joining by the site's internal ID only works
for about half the listings. The listing path matched every single one.

***

### Quick start

```json
{ "searchTerms": ["plumber"], "location": "Austin, TX" }
```

Several trades at once, only established businesses:

```json
{
  "searchTerms": ["plumber", "electrician", "hvac contractor"],
  "location": "Phoenix, AZ",
  "minRating": "4",
  "minReviews": 10,
  "maxPagesPerSearch": 10
}
```

Lead lists — businesses that have a phone but **no website yet**:

```json
{
  "searchTerms": ["landscaping"],
  "location": "Denver, CO",
  "onlyWithPhone": true,
  "onlyWithWebsite": false
}
```

Or paste result pages you already filtered on the site:

```json
{ "startUrls": ["https://www.yellowpages.com/austin-tx/plumbers?page=2"] }
```

***

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `searchTerms` | array | `["plumber"]` | Trade or business type to search |
| `location` | string | `Austin, TX` | City and state. Required with search terms — Yellow Pages never searches nationwide |
| `startUrls` | array | — | Result pages you already filtered on the site |
| `maxPagesPerSearch` | integer | `5` | 30 businesses per page |
| `minRating` | string | — | e.g. `4` or `4.5` |
| `minReviews` | integer | — | Drop businesses with fewer reviews |
| `onlyWithPhone` | boolean | `false` | Drop listings with no phone |
| `onlyWithWebsite` | boolean | `false` | Drop listings with no website |
| `categoryKeywords` | array | — | Only businesses whose categories mention any of these |
| `maxItems` | integer | `300` | Total cap. `0` = no cap |
| `includeSeen` | boolean | `true` | Off = only businesses not seen in previous runs |

***

### Output

```json
{
  "id": "yellowpages:473194899",
  "url": "https://www.yellowpages.com/austin-tx/mip/ars-rescue-rooter-473194899",
  "name": "ARS Rescue Rooter",
  "category": "other",
  "categories": ["Plumbers", "Furnaces-Heating", "Plumbing-Drain & Sewer Cleaning"],
  "rating": 2.87,
  "reviewsCount": 15,
  "rank": 1,
  "website": "https://www.ars.com/austin",
  "openingHours": [
    { "day": "Monday", "opens": "09:00", "closes": "17:00" },
    { "day": "Tuesday", "opens": "09:00", "closes": "17:00" }
  ],
  "location": {
    "address": "9411 Atterbury Ln",
    "city": "Austin",
    "state": "TX",
    "postalCode": "78754",
    "country": "US"
  },
  "contact": { "name": "ARS Rescue Rooter", "phones": ["(833) 947-9225"] }
}
```

Two deliberate choices:

- **`openingHours` is expanded to one entry per day.** The site publishes `Mo-Fr 09:00-17:00`, and
  you cannot filter "open on Saturday" against that string.
- **`category` is always `other`.** Yellow Pages is a general directory; calling a plumber a
  restaurant to fill a vertical field would be inventing data. The real classification is in
  `categories`, exactly as the site publishes it.

***

### Notes and limits

- **Yellow Pages only serves US IP addresses** and blocks datacenter traffic. This Actor runs behind
  Apify's unblocking proxy with the country pinned to the US, so you do not have to configure
  anything — but it is why runs are slower than a plain HTTP scraper.
- **The site shows a captcha to traffic that goes too fast.** The default rate is deliberately
  conservative; raising `maxRequestsPerMinute` a lot is how runs start failing.
- **Businesses with no rating are dropped by `minRating`**, because claiming they pass a threshold
  they never published would misreport the filter you asked for.
- Every listing carries `rank`, its position on the result page, which is what paid placement looks
  like from the outside.

***

### Pricing

Pay per result. You are charged for businesses that actually land in your dataset — filtered out and
duplicate rows cost nothing.

# Actor input Schema

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

What to look for, e.g. plumber, italian restaurant, dentist. Each term is searched in the location below.

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

City and state, e.g. Austin, TX. Yellow Pages searches by city, never nationwide, so this is required when you use search terms.

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

Paste Yellow Pages result pages you already filtered on the site. Use this instead of search terms when you want their exact filters.

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

Each page holds 30 businesses.

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

Drop businesses rated below this, e.g. 4 or 4.5. Businesses with no rating are dropped too, since it cannot be claimed they pass. Leave empty for no filter.

## `minReviews` (type: `integer`):

Drop businesses with fewer reviews than this.

## `onlyWithPhone` (type: `boolean`):

Drop listings with no phone number.

## `onlyWithWebsite` (type: `boolean`):

Drop listings with no website. Useful to separate businesses that already have an online presence from those that do not.

## `categoryKeywords` (type: `array`):

Only businesses whose Yellow Pages categories mention any of these. Ignores case and accents.

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

Total cap for the run. 0 = no cap.

## `includeSeen` (type: `boolean`):

Turn it off to skip businesses returned by previous runs.

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

Parallel requests.

## `maxRequestsPerMinute` (type: `integer`):

Rate ceiling. Yellow Pages shows a captcha to traffic that goes too fast.

## `maxRequestRetries` (type: `integer`):

How many times to retry a failed request before dropping it.

## Actor input object example

```json
{
  "searchTerms": [
    "plumber"
  ],
  "location": "Austin, TX",
  "maxPagesPerSearch": 5,
  "onlyWithPhone": false,
  "onlyWithWebsite": false,
  "maxItems": 300,
  "includeSeen": true,
  "maxConcurrency": 3,
  "maxRequestsPerMinute": 30,
  "maxRequestRetries": 3
}
```

# Actor output Schema

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

No description

## `runSummary` (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 = {
    "searchTerms": [
        "plumber"
    ],
    "location": "Austin, TX"
};

// Run the Actor and wait for it to finish
const run = await client.actor("juanoox/yellowpages-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": ["plumber"],
    "location": "Austin, TX",
}

# Run the Actor and wait for it to finish
run = client.actor("juanoox/yellowpages-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": [
    "plumber"
  ],
  "location": "Austin, TX"
}' |
apify call juanoox/yellowpages-scraper --silent --output-dataset

```

## MCP server setup

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