# Simple YellowPages Scraper (USA) (`pajoe/simple-yellowpages-scraper-usa`)

Extract addresses, phone numbers, business categories, and names from Yellow Pages US listings. A flexible Yellow Pages API for crawling and downloading complete contact details.

- **URL**: https://beta-securitybyobscurity.apify.com/pajoe/simple-yellowpages-scraper-usa.md
- **Developed by:** [va-gasd](https://beta-securitybyobscurity.apify.com/pajoe) (community)
- **Categories:** E-commerce, Lead generation, Integrations
- **Stats:** 36 total users, 3 monthly users, 100.0% runs succeeded, 2 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.00 / 1,000 results

This Actor is paid per result. You are not charged for the Apify platform usage, but only a fixed price for dataset items the Actor outputs.

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

# README

## Simple Yellow Pages Scraper (USA)

**Simple Yellow Pages Scraper (USA)** is an Apify actor designed to extract business information from Yellow Pages listings. It enables users to search for businesses by combining search terms and locations or by directly providing URLs. Built on the robust Apify SDK, it can be run both on the Apify platform and locally.

### Features

**Simple Yellow Pages Scraper (USA)** provides powerful capabilities, including:

1. **Comprehensive Data Extraction**: Collect business names, addresses, phone numbers, ratings, reviews, and more.
2. **Customizable Searches**: Search by terms, locations, or input custom URLs for precise targeting.
3. **Deep Crawling**: Traverse multiple pages of listings for complete data coverage.
4. **Proxy Support**: Leverage Apify Proxy to ensure efficient and anonymous scraping.

### What Data Can You Extract?

With **Simple Yellow Pages Scraper (USA)**, you can extract the following data:

- Business Name
- Address
- Phone Number
- Ratings and Review Counts
- Categories
- Additional Information Snippets
- Images

**Note: The availability of these attributes may vary depending on the data source.**

### Getting Started

Using **Simple Yellow Pages Scraper (USA)** is simple and requires no coding skills. Follow these steps:

- Create a free Apify account.
- Access the actor via **Simple Yellow Pages Scraper (USA)**.
- Configure your input parameters (search terms, locations, or URLs).
- Click Start to initiate the scraping process.
- Download the scraped data in formats like JSON, CSV, Excel, or HTML.

### Input

Here are the input fields you can configure:

Using keyword and location search

```
{
    "extendOutputFunction": "($, record) => {\n    return {};\n}",
    "location": "Los Angeles",
    "maxItems": 5,
    "proxyConfiguration": {
        "useApifyProxy": false
    },
    "search": "Dentist"
}
```

Using Yellowpages search URL

```
{
    "extendOutputFunction": "($, record) => {\n    return {};\n}",
    "maxItems": 5,
    "proxyConfiguration": {
        "useApifyProxy": false
    },
    "startUrls": [
        {
            "url": "https://www.yellowpages.com/search?search_terms=dentist&geo_location_terms=Los+Angeles%2C+CA",
            "method": "GET"
        }
    ]
}
```

**Important: Either the search and location fields or the startUrls field must be specified.**

### Output

The scraper outputs data in a structured format stored in an Apify dataset. Each record contains details such as:

```
{
        "image": "https://i1.ypcdn.com/blob/bad0e9d8f429589b829a8308630c5628cea5905f",
        "name": "Frieden, Richard A DDS",
        "address": "6360 Wilshire Blvd, Ste 506Los Angeles, CA 90048",
        "phone": "(323) 655-3854",
        "rating": 5,
        "reviewSnippet": "Good team of experts and assistants. My problem was solved in an hour which i was suffering through. Friendly nature with good service.\"",
        "categories": [
            "Dentists"
        ],
        "url": "https://www.yellowpages.com/los-angeles-ca/mip/frieden-richard-a-dds-14640832?lid=1002105049104"
    }
```

**Note: Not all attributes are guaranteed to be present in every result, as data availability depends on the source.**

Start using the **Simple Yellow Pages Scraper (USA)** today to automate your business data extraction effortlessly!

# Actor input Schema

## `search` (type: `string`):

Query to search on Yellow Pages

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

Location to search entries in

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

List of URLs that will be crawled.

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

Maximum number of outputted results

## `extendOutputFunction` (type: `string`):

A function which result will get merged with the default result

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

In this case the best option is usually no proxy. Otherwise US or UK proxies work best.

## Actor input object example

```json
{
  "search": "Dentist",
  "location": "Los Angeles",
  "maxItems": 200,
  "extendOutputFunction": "($, record) => {\n    return {};\n}",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# 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 = {
    "search": "Dentist",
    "location": "Los Angeles",
    "maxItems": 200,
    "extendOutputFunction": ($, record) => {
        return {};
    },
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("pajoe/simple-yellowpages-scraper-usa").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 = {
    "search": "Dentist",
    "location": "Los Angeles",
    "maxItems": 200,
    "extendOutputFunction": """($, record) => {
    return {};
}""",
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("pajoe/simple-yellowpages-scraper-usa").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 '{
  "search": "Dentist",
  "location": "Los Angeles",
  "maxItems": 200,
  "extendOutputFunction": "($, record) => {\\n    return {};\\n}",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call pajoe/simple-yellowpages-scraper-usa --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=pajoe/simple-yellowpages-scraper-usa",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Simple YellowPages Scraper (USA)",
        "description": "Extract addresses, phone numbers, business categories, and names from Yellow Pages US listings. A flexible Yellow Pages API for crawling and downloading complete contact details.",
        "version": "0.0",
        "x-build-id": "Bxyfa1oOOVQbpAjbo"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/pajoe~simple-yellowpages-scraper-usa/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-pajoe-simple-yellowpages-scraper-usa",
                "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/pajoe~simple-yellowpages-scraper-usa/runs": {
            "post": {
                "operationId": "runs-sync-pajoe-simple-yellowpages-scraper-usa",
                "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/pajoe~simple-yellowpages-scraper-usa/run-sync": {
            "post": {
                "operationId": "run-sync-pajoe-simple-yellowpages-scraper-usa",
                "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": [
                    "search",
                    "location"
                ],
                "properties": {
                    "search": {
                        "title": "Search",
                        "type": "string",
                        "description": "Query to search on Yellow Pages"
                    },
                    "location": {
                        "title": "Location",
                        "type": "string",
                        "description": "Location to search entries in"
                    },
                    "startUrls": {
                        "title": "Start URLs",
                        "type": "array",
                        "description": "List of URLs that will be crawled.",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "maxItems": {
                        "title": "Max items",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum number of outputted results"
                    },
                    "extendOutputFunction": {
                        "title": "Extend output function",
                        "type": "string",
                        "description": "A function which result will get merged with the default result"
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "In this case the best option is usually no proxy. Otherwise US or UK proxies work best."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
