# Yellow Pages Business and Contact Scraper (`automationagents/directory-yellowpages`) Actor

Search Yellow Pages and export business name, phone, address, website, and category. Build local B2B lead lists in minutes.

- **URL**: https://apify.com/automationagents/directory-yellowpages.md
- **Developed by:** [Alex Jordan](https://apify.com/automationagents) (community)
- **Categories:** Lead generation
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.00 / 1,000 successful api calls

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

### What does Yellow Pages Business Search do?

**Yellow Pages Business Search** scrapes business listings from YellowPages.com for any query and location — returning business names, phone numbers, addresses, websites, categories, and ratings in a clean, structured JSON dataset. No API key, no captchas, no setup.

Built on the **Apify platform**, this Actor integrates with Apify's scheduling, webhooks, and 1,500+ tools via Zapier and Make.

### Why use Yellow Pages Business Search?

- **Local lead generation** — Build targeted lists of local businesses in any city, state, or ZIP code
- **Sales prospecting** — Find direct phone numbers and websites for outreach campaigns
- **Market research** — Understand business density and competition in specific markets or niches
- **Directory building** — Compile local business databases for directories, maps, or apps
- **Agency prospecting** — Find small businesses without websites that need digital marketing help

### How to use Yellow Pages Business Search

1. Click **Try for free** on this Actor's page
2. Enter your **query** (e.g. `plumber`) and **location** (e.g. `New York, NY`)
3. Set **max\_pages** to scrape multiple pages of results
4. Click **Start** and wait a few seconds
5. Download your results from the **Output** tab in JSON, CSV, or Excel

### Input

| Field | Type | Required | Description |
|---|---|---|---|
| `query` | string | ✅ | Business type or name to search for |
| `location` | string | ✅ | City, state, or ZIP code |
| `page` | integer | ❌ | Page number (default 1) |
| `max_pages` | integer | ❌ | Number of pages to scrape (default 1) |
| `cache` | boolean | ❌ | Use cached result if available (default true) |

**Example input:**

```json
{
  "query": "plumber",
  "location": "New York, NY",
  "max_pages": 3
}
```

### Output

**Example output:**

```json
{
  "results": [
    {
      "name": "Joe's Plumbing Services",
      "phone": "(212) 555-0123",
      "address": "123 Main St, New York, NY 10001",
      "website": "https://joesplumbing.com/",
      "categories": ["Plumbers", "Water Heater Repair"],
      "rating": 4.7
    }
  ],
  "total_results": 30,
  "meta": { "cache_hit": false, "execution_time_ms": 1800 }
}
```

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

### Data fields

| Field | Type | Description |
|---|---|---|
| `results` | array | List of matched business listings |
| `results[].name` | string | Business name |
| `results[].phone` | string | Phone number |
| `results[].address` | string | Full street address |
| `results[].website` | string | Business website URL (if listed) |
| `results[].categories` | array | Business category tags |
| `results[].rating` | number | Average customer rating (if available) |
| `total_results` | integer | Total listings returned |

### Pricing / Cost estimation

**$0.02 per successful API call** on Apify.

- 1,000 successful Apify runs = $20.00

### FAQ & Support

**Is this legal?** Yellow Pages listings are public business information — the same data visible to any visitor on yellowpages.com.

**Known limitations:** Not all listings include a website or rating. Phone number formatting may vary by region.

**Need help?** Open an issue in the Issues tab or contact the support team for custom solutions.

# Actor input Schema

## `query` (type: `string`):

Business type or name to search for

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

City, state, or ZIP code

## `page` (type: `integer`):

Page number for pagination (default 1)

## `max_pages` (type: `integer`):

Maximum number of pages to scrape (default 1)

## `cache` (type: `boolean`):

Use cached result if available

## Actor input object example

```json
{
  "query": "plumber",
  "location": "New York, NY",
  "page": 1,
  "max_pages": 1,
  "cache": true
}
```

# Actor output Schema

## `results` (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 = {
    "query": "plumber",
    "location": "New York, NY",
    "page": 1,
    "max_pages": 1,
    "cache": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("automationagents/directory-yellowpages").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 = {
    "query": "plumber",
    "location": "New York, NY",
    "page": 1,
    "max_pages": 1,
    "cache": True,
}

# Run the Actor and wait for it to finish
run = client.actor("automationagents/directory-yellowpages").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 '{
  "query": "plumber",
  "location": "New York, NY",
  "page": 1,
  "max_pages": 1,
  "cache": true
}' |
apify call automationagents/directory-yellowpages --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,automationagents/directory-yellowpages"
        }
    }
}

```

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/eLwoZBS2aihaOVErM/builds/I8948fcEvtN2q5HFF/openapi.json
