# Yellow Pages Scraper: US Business Directory (`santamaria-automations/yellow-pages-scraper`) Actor

Extract US business listings from YellowPages.com by search term and city: name, phone, address, website, categories, open status, rating and review count. Multiple search terms per run, export to CSV, JSON or Excel.

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

## Pricing

from $2.00 / 1,000 listings

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?

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

## Yellow Pages Scraper

Search YellowPages.com by business category and US location and get one record per business listing: name, phone, address, website, categories, rating, review count and the other details shown on the listing card.

### What you get

One record per listing. Fields that a listing does not show are `null` (or an empty list).

| Field | Type | Description |
|-------|------|-------------|
| `id` | string | YellowPages business ID |
| `name` | string | Business name |
| `phone` | string or null | Phone number |
| `address` | string or null | Street address |
| `city` | string or null | City |
| `state` | string or null | State abbreviation |
| `zip_code` | string or null | ZIP code |
| `website` | string or null | Business website |
| `categories` | array | Categories listed for the business |
| `rating` | number or null | Star rating, when the listing has reviews |
| `review_count` | integer or null | Number of reviews |
| `years_in_business` | integer or null | Years in business, when the card shows it |
| `open_status` | string or null | Opening status text from the card, for example "open 24 hours" |
| `snippet` | string or null | Description text from the card |
| `is_ad` | boolean | `true` for a sponsored or nationwide listing, `false` otherwise |
| `source_url` | string | Link to the listing on YellowPages.com |
| `search_term` | string | The search term that returned this listing |
| `serp_page` | integer | Results page the listing was found on |
| `scraped_at` | string | UTC timestamp, ISO 8601 |

Not every field is filled for every listing. In a test search for plumbers and electricians in New York, NY (80 listings), name, categories and source_url were present on every row, phone on 85 percent, address on 80 percent and website on 78 percent. Rating and review count were present on fewer than 10 percent.

Sponsored nationwide listings are skipped by default because they usually have no local phone or address; set includeAds to true to keep them, marked with is_ad.

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `searchTerms` | list of text | `["plumber"]` | Business categories or keywords, for example `plumber` or `pizza restaurant`. A comma separated text also works. |
| `geoLocation` | text | `New York, NY` when no search term is given | US city and state, for example `Chicago, IL`. Leave empty to search without a location. |
| `maxResults` | integer | `10` | Maximum number of listings across all search terms. `0` means no limit. The limit is shared equally between the search terms; a share a term does not use goes to the next terms. |
| `includeAds` | boolean | `false` | Include nationwide sponsored listings. They often have no phone or address. |
| `proxyConfiguration` | object | `{"useApifyProxy": true}` | Proxy settings. The default works for most runs. The actor picks a suitable Apify Proxy group automatically if requests are refused. |

Numbers may be given as text (`"25"`). An empty input `{}` runs a small sample search (plumber, New York, NY, 10 results). If the input cannot be read, the actor runs that same sample and writes a warning to the log.

#### Example input

```json
{
  "searchTerms": ["plumber", "electrician"],
  "geoLocation": "Chicago, IL",
  "maxResults": 100
}
```

#### Example output

```json
{
  "id": "556353842",
  "name": "Light Electric Services Company New York NY",
  "phone": "(347) 518-1481",
  "address": "122 1st Ave",
  "city": "New York",
  "state": "NY",
  "zip_code": "10065",
  "website": "http://lightelectricservicescompanynewyorkny.localsearch.com",
  "categories": ["Electricians", "Electric Companies", "Electric Contractors-Commercial & Industrial"],
  "rating": null,
  "review_count": null,
  "open_status": "open 24 hours",
  "source_url": "https://www.yellowpages.com/new-york-ny/mip/light-electric-services-company-new-york-ny-556353842",
  "search_term": "electrician",
  "serp_page": 1,
  "scraped_at": "2026-10-27T07:52:47Z"
}
```

### Behaviour

- A listing that appears more than once, within one search term or across several, is delivered once.
- You are charged per delivered listing plus a start event that is charged together with the first listing. The current prices are on the Pricing tab.
- A search with no results ends normally with a message and no charge.
- If YellowPages.com cannot be reached and nothing was delivered, the run fails with the message "Could not reach yellowpages.com (...). Nothing was charged."
- If your maximum charge per run is reached, the run stops with "Stopped at the max charge limit. N listings delivered." and finishes successfully.

### Use with AI (MCP)

Add this actor as a tool in Claude or another MCP client:

```
https://mcp.apify.com?tools=santamaria-automations/yellow-pages-scraper
```

Example prompts:

- "Find plumbers in Chicago, IL and return their phone numbers and websites."
- "Get 50 Italian restaurants in New York, NY as a table."

### Related actors

- [Contact Details Scraper](https://apify.com/santamaria-automations/contact-details-scraper) extracts emails, phones and social links from websites.
- [Google Maps Scraper](https://apify.com/santamaria-automations/google-maps-scraper) returns business listings from Google Maps.
- [Yelp Scraper](https://apify.com/santamaria-automations/yelp-scraper) returns business listings from Yelp.

### Data protection

This actor returns only data that is publicly visible on the source pages. Results can include personal data, such as names, phone numbers, email addresses and addresses of private persons, sole traders or contact persons. Where the source labels an entry type, it is included so you can filter the results yourself.

You are responsible for using the data lawfully, including the GDPR/DSGVO, national data-protection laws and unfair-competition rules (e.g. UWG) for marketing and outreach.

### Support

Questions or problems? Open a ticket in the [Issues tab](https://console.apify.com/actors/CeYxaNrMRWO1FobQr/info/issues) on the actor page or email contact@nanoscrape.com.

# Actor input Schema

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

Business categories or keywords to search (for example plumber, pizza restaurant, auto repair). Each term runs as a separate search and duplicates are removed. Leave empty to run the sample search.

## `geoLocation` (type: `string`):

US city and state (for example New York, NY or Chicago, IL). Leave blank to search nationally.

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

Maximum number of business listings to return across all search terms. Set to 0 for no limit.

## `includeAds` (type: `boolean`):

Include nationwide sponsored listings. They often have no phone or address.

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

Proxy settings. The default works for most runs.

## Actor input object example

```json
{
  "searchTerms": [
    "plumber"
  ],
  "geoLocation": "New York, NY",
  "maxResults": 10,
  "includeAds": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `defaultDataset` (type: `string`):

Business listings from YellowPages.com with name, phone, address, website, categories, rating, and review count.

# 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"
    ],
    "geoLocation": "New York, NY",
    "maxResults": 10,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("santamaria-automations/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 = {
    "searchTerms": ["plumber"],
    "geoLocation": "New York, NY",
    "maxResults": 10,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("santamaria-automations/yellow-pages-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"
  ],
  "geoLocation": "New York, NY",
  "maxResults": 10,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call santamaria-automations/yellow-pages-scraper --silent --output-dataset

```

## MCP server setup

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