# Yellow Pages Australia Scraper (`datafoundry/ypau`) Actor

Extract business listings from Yellow Pages Australia, including company website, email, phone, address, suburb, city and industry. Ideal for lead generation, market research and building targeted business databases.

- **URL**: https://apify.com/datafoundry/ypau.md
- **Developed by:** [Trent](https://apify.com/datafoundry) (community)
- **Categories:** Lead generation, Automation, Developer tools
- **Stats:** 18 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / 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.

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

## Yellow Pages Australia Scraper (Apify Actor)

Scrapes business listings from [Yellow Pages Australia](https://www.yellowpages.com.au) by search query and location. Built for the Apify platform.

### Input

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| **what** | string | Yes | Business type or keyword (e.g. `plumber`, `electrician`) |
| **where** | string | Yes | Location (e.g. `Sydney NSW` or suburb/postcode) |
| **maxResults** | integer | No | Max listings to scrape (1–10,000, default: 100) |
| **maxPages** | integer | No | Max search pages to load (optional cap) |
| **proxyConfiguration** | object | No | Apify Proxy or custom proxies (recommended for production) |

### Output

Each dataset item is one business with:

- `BusinessName` – Company name
- `CompanyWebsite` – Website URL (normalized)
- `Email` – Email if available
- `Phone` – Phone number
- `Address` – Full address
- `City` – City (parsed)
- `Suburb` – Suburb (parsed)
- `Industry` – Category/industry
- `ListingUrl` – Yellow Pages listing URL

### Run locally

```bash
pip install -r requirements.txt
python -m src.main
```

Set input via Apify CLI or by providing input when running on the Apify platform.

### Deploy to Apify

1. Create a new **Python** actor on Apify.
2. Set the start command to `src/main.py` (or use default Python actor layout).
3. Add `requirements.txt` and ensure dependencies are installed.
4. Connect this repo or paste the code; run and download results from the Dataset tab.

### Notes

- Uses `httpx` + BeautifulSoup (no browser).
- Supports pagination until `maxResults` or no more pages.
- Deduplicates by business name + phone.
- Optional Apify Proxy via `Actor.create_proxy_configuration()`.

# Actor input Schema

## `what` (type: `string`):

Business type or keyword to search for, e.g. "plumber", "electrician".

## `where` (type: `string`):

Location to search in, e.g. "Sydney NSW" or a suburb/postcode.

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

Maximum number of business listings to scrape (1–10,000).

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

Optional limit on number of search result pages to load. Leave empty for no limit.

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

Use Apify Proxy or your own proxies. Recommended for production.

## Actor input object example

```json
{
  "what": "plumber",
  "where": "Sydney NSW",
  "maxResults": 100
}
```

# 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 = {
    "what": "plumber",
    "where": "Sydney NSW"
};

// Run the Actor and wait for it to finish
const run = await client.actor("datafoundry/ypau").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 = {
    "what": "plumber",
    "where": "Sydney NSW",
}

# Run the Actor and wait for it to finish
run = client.actor("datafoundry/ypau").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 '{
  "what": "plumber",
  "where": "Sydney NSW"
}' |
apify call datafoundry/ypau --silent --output-dataset

```

## MCP server setup

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

```

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/GdpoOcWTYmFqUEviX/builds/D2wpP7hHo9aqZRsjX/openapi.json
