# Yellow Pages Scraper (Cloud)

Get business details (Location, phone, website, etc.) from the Yellow Pages.

- Template page: [https://www.octoparse.com/template/yellow-page-scraper-cloud](https://www.octoparse.com/template/yellow-page-scraper-cloud)
- Categories: Directories, Lead Generation
- Status: `PUBLISHED`
- Run mode: `CLOUD`

## Pricing

Current price: **$0.1/1,000 lines**. Billing is based on output rows; an Octoparse subscription may be required.

## What is an Octoparse template?

An Octoparse template is a ready-to-use scraping workflow with predefined inputs and structured outputs. Use the exact parameter keys below; do not invent parameters.

## Overview

This ready-to-use template collects structured data from detail pages.

## Output

The current workflow extracts 7 fields, including `Address`, `Location`, `Name`, `Phone`, `Title`, `URL`, `Website`.

## Use Cases

- Use structured results for research, comparison, and monitoring.
- Collect rows without building the extraction workflow from scratch.
- Combine results with other templates for downstream enrichment.
- Review a representative result before starting a large batch.

## Why Octoparse

- **No coding required:** complete Company;zip code (with no space between but a semicolon), PageSize(The default value is 100) and start the template in cloud mode.
- **Flexible export:** review and export results as CSV, Excel, or JSON.

## Input

### Company;zip code (with no space between but a semicolon)

Required. MainKeys Constraints: minItems=1; maxItems=10000; items.minLength=1; items.maxLength=1111111.

### PageSize(The default value is 100)

Optional. PageSize Constraints: minimum=, maximum=100.

## How to Use

## Usage

1.  Click **Try it!**.
2.  Enter the parameter: **Company;zip code** – no space, use a semicolon between the company name and the zip code.  
    Example: `Trust GDC;63353`
3.  Click **Start** and choose your preferred mode.

## Data Fields

The template extracts the following fields:

- Name
- Location
- Title
- Address
- Phone
- Website
- URL

## Legal Notice

Web scraping is generally legal if you scrape publicly available non-personal data. What you do with the data is another question.  
Learn more in [this article](https://helpcenter.octoparse.com/en/articles/6471169-is-web-scraping-via-octoparse-legal-and-ethical).  
If you are unsure, seek professional legal advice.

## Limitations

Results depend on what the source site exposes at run time. Fields may be empty when a source page does not provide a value. The template enforces the input limits shown above.

## Tips

Use specific, valid inputs and review a representative result before starting a large batch. Remove duplicate inputs when repeated records are not needed.

## FAQ

### What do I need to enter?

Use the exact inputs and limits listed above.

### What data does this template return?

See Output Schema below; availability can vary by source record.

### How is usage billed?

See the Pricing section above for current pricing and billing details.

## Related Templates

- [Yellow Pages Scraper](https://www.octoparse.com/template/yellow-page-scraper)
- [Yellow Pages Canada Scraper (Business Listing)](https://www.octoparse.com/template/yellow-pages-canada-scraper-product-listing)
- [Yellow Pages Listing Scraper (Australia)](https://www.octoparse.com/template/yellow-pages-australia-scraper-product-listing)
- [Yellow Pages Details Scraper (Australia)](https://www.octoparse.com/template/yellow-pages-australia-scraper-product-details)
- [Yellow Pages Spain Scraper(Listing)](https://www.octoparse.com/template/paginas-amarillas-listados-scraper)

## Input Schema

```json
{
  "title": "Yellow Pages Scraper (Cloud) input",
  "description": "Input parameters configured for the current published template version.",
  "type": "object",
  "schemaVersion": 1,
  "additionalProperties": false,
  "properties": {
    "company;zip_code": {
      "title": "Company;zip code (with no space between but a semicolon)",
      "description": "MainKeys",
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1111111
      },
      "minItems": 1,
      "maxItems": 10000,
      "x-octoparse": {
        "apiEnabled": true
      }
    },
    "pageSize": {
      "title": "PageSize(The default value is 100)",
      "description": "PageSize",
      "type": "integer",
      "maximum": 100,
      "x-octoparse": {
        "apiEnabled": true
      }
    }
  },
  "required": [
    "company;zip_code"
  ]
}
```

## Input JSON Example

Example 1

```json
{
  "company;zip_code": [
    "HVAC contractor;36117",
    "HVAC contractor;30518",
    "HVAC contractor;70806",
    "HVAC contractor;30134",
    "HVAC contractor;31909"
  ],
  "pageSize": 50
}
```


## Output Schema

```json
{
  "schemaVersion": 1,
  "type": "object",
  "properties": {
    "Address": {
      "type": "string",
      "description": ""
    },
    "Location": {
      "type": "string",
      "description": ""
    },
    "Name": {
      "type": "string",
      "description": ""
    },
    "Phone": {
      "type": "string",
      "description": ""
    },
    "Title": {
      "type": "string",
      "description": ""
    },
    "URL": {
      "type": "string",
      "description": ""
    },
    "Website": {
      "type": "string",
      "description": ""
    }
  },
  "title": "Yellow Pages Scraper (Cloud) output",
  "description": "Initial output fields derived from the current published implementation. Field descriptions are maintained by Data Center; production field names and types should be refreshed from recent successful runs.",
  "additionalProperties": false
}
```

## Output Example

Example 1

```json
{
  "Address": "521 Oliver Rd  Montgomery, AL 36117",
  "Location": "36117",
  "Name": "HVAC contractor",
  "Phone": "(334) 651-0307",
  "Title": "Clark Heating, Air Conditioning & Plumbing",
  "URL": "https://www.yellowpages.com/montgomery-al/mip/clark-heating-air-conditioning-plumbing-520737214",
  "Website": "http://www.clarkcomfort.com"
}
```

## API

`POST https://openapi.octoparse.com/api/agentTools/executeTask`

This is the OpenAPI Agent Tools `executeTask` endpoint. Authenticate with a Bearer token.

Request body:

`templateName` is the template slug; `parameters` is a JSON object string whose keys match Input Schema; `taskName`, `idempotencyKey`, and `maxCollectedRows` are optional.

Obtain a token:

```http
POST https://openapi.octoparse.com/token
Content-Type: application/json

{
  "username": "YOUR_USERNAME",
  "password": "YOUR_PASSWORD",
  "grant_type": "password"
}
```

Use `data.access_token` as `Authorization: Bearer <token>`. After starting, poll `getTaskStatus` and export with `exportData`.

```json
{
  "templateName": "yellow-page-scraper-cloud",
  "taskName": "Yellow Pages Scraper (Cloud)",
  "parameters": "{\"company;zip_code\":[\"HVAC contractor;36117\",\"HVAC contractor;30518\",\"HVAC contractor;70806\",\"HVAC contractor;30134\",\"HVAC contractor;31909\"],\"pageSize\":50}"
}
```

## Python Example

```python
import json
import requests

OPENAPI_BASE = "https://openapi.octoparse.com"
ACCESS_TOKEN = "YOUR_ACCESS_TOKEN"

parameters = json.loads("{\"company;zip_code\":[\"HVAC contractor;36117\",\"HVAC contractor;30518\",\"HVAC contractor;70806\",\"HVAC contractor;30134\",\"HVAC contractor;31909\"],\"pageSize\":50}")

response = requests.post(
    f"{OPENAPI_BASE}/api/agentTools/executeTask",
    headers={
        "Authorization": f"Bearer {ACCESS_TOKEN}",
        "Content-Type": "application/json",
    },
    json={
        "templateName": "yellow-page-scraper-cloud",
        "taskName": "Yellow Pages Scraper (Cloud)",
        "parameters": json.dumps(parameters, ensure_ascii=False),
    },
    timeout=60,
)
print(response.status_code)
print(response.json())
```

## HTTP/cURL Example

```bash
curl -X POST "https://openapi.octoparse.com/api/agentTools/executeTask" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'JSON'
{
  "templateName": "yellow-page-scraper-cloud",
  "taskName": "Yellow Pages Scraper (Cloud)",
  "parameters": "{\"company;zip_code\":[\"HVAC contractor;36117\",\"HVAC contractor;30518\",\"HVAC contractor;70806\",\"HVAC contractor;30134\",\"HVAC contractor;31909\"],\"pageSize\":50}"
}
JSON
```

## MCP Setup

Connect an MCP-compatible AI client to `https://mcp.octoparse.com` using browser OAuth or an Octoparse API key. Find `yellow-page-scraper-cloud`, inspect its inputs, create a cloud task with the exact Input Schema keys, and export JSON results.

## Machine-readable Resources

- [Template contract](https://www.octoparse.com/templates/yellow-page-scraper-cloud.json)
- [Manifest](https://www.octoparse.com/templates/yellow-page-scraper-cloud-manifest.json)
