# Yellow Pages Scraper (Cheap) (`data_api/yellow-pages-scraper-cheap`) Actor

Yellow Pages scraper that pulls local business listings from yellowpages.com, so sales teams and researchers get business names, phones, addresses, and ratings without the manual work.

- **URL**: https://apify.com/data\_api/yellow-pages-scraper-cheap.md
- **Developed by:** [Data API](https://apify.com/data_api) (community)
- **Categories:** Lead generation, Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.99 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 Business Scraper

![Yellow Pages Business Scraper](cover.jpg)

Building a call list off Yellow Pages by hand means copying a name, a phone number, and an address from one card, scrolling, and doing it again until your eyes glaze over. This scraper does the copying for you. Give it a business keyword and a city, and it walks the Yellow Pages results page by page, pulling the company name, phone, full address, website, rating, and trade categories into a clean table you can open in a spreadsheet. Point it at one keyword in one town, or a dozen keywords across a dozen cities, and let it run.

### What you get

Every listing comes back as one row with the same shape, so missing pieces show up as `null` instead of shifting your columns around. The data splits into a few natural groups:

- **Identity and contact** — `companyName`, `contactPhone`, `websiteUrl`, `directoryUrl`
- **Address** — `streetLine`, `cityName`, `stateCode`, `postalCode`, and the `fullAddress` as printed
- **Reputation and context** — `starRating`, `reviewsTotal`, `operatingYears`, `categoryTags`
- **Search trail** — `queryTerm`, `queryLocation`, and a `collectedAt` timestamp on each row

### Quick start

1. Click **Try for free** and open the input form.
2. Add one or more business keywords under **Business keywords** (for example roofing contractor, coffee shop).
3. List the **Cities and states** to cover, one per line, like Austin, TX.
4. Set **Pages to read per search** and a **Listing cap per search** to control how much you pull.
5. Press **Start**, then download the results as JSON, CSV, Excel, or XML when the run ends.

![How it works](how-it-works.jpg)

### Use cases

- **Lead generation** — assemble call and email lists of local businesses by trade and city
- **Local market sizing** — count how many businesses of a type operate in a given area before you expand there
- **Directory and database building** — seed a regional business database for a category you care about
- **Outreach campaigns** — gather phone numbers and websites for cold calls or mailers
- **CRM enrichment** — attach phone, address, and rating data to records you already hold
- **Competitor mapping** — see who else serves a neighborhood and how they rate

### Input

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `queryTerms` | array of strings | Yes | Business keywords to search, one per line (e.g. roofing contractor, coffee shop). Each is paired with every area. |
| `searchAreas` | array of strings | Yes | Cities and states to cover, one per line, such as Austin, TX. Every keyword runs against each area. |
| `pageLimit` | integer | No | Result pages to read per keyword-and-area pairing; each page holds about 30 listings. Default `2`. |
| `resultsLimit` | integer | No | Cap on listings gathered per keyword-and-area pairing. Default `50`. |
| `timeoutSeconds` | integer | No | Seconds to wait on each page request before giving up. Default `45`. |

#### Example input

```json
{
    "queryTerms": ["roofing contractor", "coffee shop"],
    "searchAreas": ["Austin, TX", "Denver, CO"],
    "pageLimit": 2,
    "resultsLimit": 50,
    "timeoutSeconds": 45
}
````

### Output

Results land in an Apify dataset, one row per business listing. Every field is always present — anything Yellow Pages does not show comes back as `null` so the table stays rectangular.

#### Example output

```json
{
    "companyName": "Lone Star Roofing & Exteriors",
    "contactPhone": "(512) 555-0142",
    "streetLine": "2204 E Cesar Chavez St",
    "cityName": "Austin",
    "stateCode": "TX",
    "postalCode": "78702",
    "fullAddress": "2204 E Cesar Chavez St, Austin, TX 78702",
    "websiteUrl": "https://www.lonestarroofingtx.com/",
    "categoryTags": ["Roofing Contractors", "Gutters & Downspouts", "Siding Contractors"],
    "starRating": 4.5,
    "reviewsTotal": 38,
    "operatingYears": 17,
    "directoryUrl": "https://www.yellowpages.com/austin-tx/mip/lone-star-roofing-exteriors-552014872",
    "queryTerm": "roofing contractor",
    "queryLocation": "Austin, TX",
    "collectedAt": "2026-06-30T14:21:08.337241+00:00",
    "errorMessage": null
}
```

#### Output fields

| Field | Type | Description |
|-------|------|-------------|
| `companyName` | string | Business name shown on the listing |
| `contactPhone` | string | Main phone number |
| `streetLine` | string | Street portion of the address |
| `cityName` | string | Town or city |
| `stateCode` | string | Two-letter state code |
| `postalCode` | string | ZIP or postal code |
| `fullAddress` | string | Whole address as printed on the listing |
| `websiteUrl` | string | Link to the company website |
| `categoryTags` | array | Trade or service categories for the listing |
| `starRating` | number | Average review score on a five-star scale |
| `reviewsTotal` | integer | Number of reviews |
| `operatingYears` | integer | Years in business, when stated |
| `directoryUrl` | string | Direct link to the Yellow Pages listing |
| `queryTerm` | string | Keyword that surfaced this result |
| `queryLocation` | string | Area searched for this result |
| `collectedAt` | string | ISO 8601 capture timestamp |
| `errorMessage` | string | Reason a listing failed to parse; `null` on success |

### Tips for best results

- **Try one keyword and one city first.** A small run shows you the column shape before you queue up a long batch.
- **Each page is about 30 listings.** Set `pageLimit` to 3 for roughly 90 results, or raise `resultsLimit` to cap the total per pairing instead.
- **Keywords times areas adds up fast.** Three keywords across four cities is twelve separate searches, so watch the totals when you scale.
- **Not every card has every field.** A listing with no website, rating, or years-in-business returns `null` for those — the `errorMessage` field only fills in when parsing actually fails.
- **Raise `timeoutSeconds` if requests stall.** Bumping it to 60 helps on slower connections or busy result pages.

### How can I use Yellow Pages business data?

**How can I use the Yellow Pages Business Scraper to build a local lead list?**
Enter the trades you sell to under `queryTerms` and the towns you cover under `searchAreas`. The scraper returns each matching business with its phone, website, and full address, so you can load the dataset straight into a CRM or dialer and start outreach the same day.

**How can I scrape Yellow Pages listings for a whole metro area?**
List several cities and suburbs in `searchAreas` and pair them with your keywords. Every keyword runs against every area, and `pageLimit` plus `resultsLimit` control depth — a practical way to pull a broad Yellow Pages business directory for a region without scraping the same page twice.

**How can I research competitors in a category near me?**
Search your own trade keyword in your city and read the `starRating`, `reviewsTotal`, `operatingYears`, and `categoryTags` columns. That gives you a quick read on who else operates nearby, how long they have been around, and how customers rate them.

**How can I enrich existing business records with phone and address data?**
Run the keywords and locations that match your current records, then match the scraped `companyName` and `fullAddress` back against your file to fill in missing phone numbers, websites, and categories from the Yellow Pages data.

### Is it legal to scrape data?

Our actors are ethical and do not extract any private user data, such as email addresses or private contact information. They only extract what the user has chosen to share publicly. We therefore believe that our actors, when used for ethical purposes by Apify users, are safe.

However, you should be aware that your results could contain personal data. Personal data is protected by the GDPR in the European Union and by other regulations around the world. You should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, consult your lawyers.

You can also read Apify's blog post on the [legality of web scraping](https://blog.apify.com/is-web-scraping-legal/).

### Support

Questions, feature requests, or a field you'd like added? Reach out at <data.apify@proton.me> and we'll get back to you.

# Actor input Schema

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

One or more business types to search (e.g. plumber, dentist, pizza restaurant). Enter one per line.

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

One or more cities and states to search in. Enter one per line (e.g. Los Angeles, CA).

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

Number of result pages to scrape per search term + location combination. Each page has up to 30 listings.

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

Maximum number of listings to collect per search term + location combination. Each combination runs independently up to this limit.

## `requestTimeoutSecs` (type: `integer`):

Per-request timeout in seconds.

## Actor input object example

```json
{
  "searchTerms": [
    "plumber",
    "electrician"
  ],
  "locations": [
    "Los Angeles, CA",
    "New York, NY"
  ],
  "maxPages": 1,
  "maxItems": 25,
  "requestTimeoutSecs": 30
}
```

# 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"
    ],
    "locations": [
        "Los Angeles, CA"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("data_api/yellow-pages-scraper-cheap").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"],
    "locations": ["Los Angeles, CA"],
}

# Run the Actor and wait for it to finish
run = client.actor("data_api/yellow-pages-scraper-cheap").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 '{
  "searchTerms": [
    "plumber"
  ],
  "locations": [
    "Los Angeles, CA"
  ]
}' |
apify call data_api/yellow-pages-scraper-cheap --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Yellow Pages Scraper (Cheap)",
        "description": "Yellow Pages scraper that pulls local business listings from yellowpages.com, so sales teams and researchers get business names, phones, addresses, and ratings without the manual work.",
        "version": "0.0",
        "x-build-id": "xqsN8KwxZ2wIJtWaA"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/data_api~yellow-pages-scraper-cheap/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-data_api-yellow-pages-scraper-cheap",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/data_api~yellow-pages-scraper-cheap/runs": {
            "post": {
                "operationId": "runs-sync-data_api-yellow-pages-scraper-cheap",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/data_api~yellow-pages-scraper-cheap/run-sync": {
            "post": {
                "operationId": "run-sync-data_api-yellow-pages-scraper-cheap",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "searchTerms",
                    "locations"
                ],
                "properties": {
                    "searchTerms": {
                        "title": "Search terms",
                        "type": "array",
                        "description": "One or more business types to search (e.g. plumber, dentist, pizza restaurant). Enter one per line.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "locations": {
                        "title": "Locations",
                        "type": "array",
                        "description": "One or more cities and states to search in. Enter one per line (e.g. Los Angeles, CA).",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxPages": {
                        "title": "Max pages per search",
                        "minimum": 1,
                        "maximum": 20,
                        "type": "integer",
                        "description": "Number of result pages to scrape per search term + location combination. Each page has up to 30 listings.",
                        "default": 1
                    },
                    "maxItems": {
                        "title": "Max items total",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Maximum number of listings to collect per search term + location combination. Each combination runs independently up to this limit.",
                        "default": 25
                    },
                    "requestTimeoutSecs": {
                        "title": "Request timeout (seconds)",
                        "minimum": 5,
                        "maximum": 120,
                        "type": "integer",
                        "description": "Per-request timeout in seconds.",
                        "default": 30
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
