# YP Business Directories Scraper — 136 Country Yellow Pages (`hamza325/yp-business-directories-scraper`) Actor

136 country Yellow Pages directories, one Actor — Woomar's YP network (businesslist.\*, *yp.com, *yello.*, yelu.*). Seven tasks: search, category, city, company profiles, category tree, city list, auto from a link. Profiles add hours, manager, products, reviews. Verified, phone, no-website filters.

- **URL**: https://apify.com/hamza325/yp-business-directories-scraper.md
- **Developed by:** [Hamza Abbad](https://apify.com/hamza325) (community)
- **Categories:** Business, 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 $0.20 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## YP Business Directories Scraper

Companies from **Woomar's YP network** — YP for *Yellow Pages*: 136 country business directories run by
one operator, under names that follow a handful of patterns (`businesslist.co.ke`, `japanyello.com`,
`polandyp.com`, `yelu.in`). One input covers all of them. Name a keyword, or paste a link from the
directory you picked — a category, a city, a company, the category tree or the city list — and the same
dataset comes back: contacts, addresses, opening hours, coordinates, categories, pictures, products and
reviews.

The network is operated by **Woomar** (woomar.com) — Global Business Directory LLC, Casper, Wyoming,
United States — which describes itself as running country-focused business networks, listing services
for business owners and Data Hubs for market research across 130+ countries. This Actor reads the public
side of those networks; the paid Data Hub subscriptions are a different product.

### What you can scrape

Two ways in: name a keyword (the search), or paste a link from the directory you picked. The Actor
recognises the page and runs the matching task.

| Starting point | What you get |
|---|---|
| **A keyword search** | One row per company matching the words, optionally in one city — the directory's own search, not a filtered guess |
| A company's page | That one company in full: contacts, hours, manager, employees, description, categories, pictures, products with prices, reviews |
| A category page | One row per company in that category — name, address, phone, badges, map coordinates, picture count, link |
| A category page narrowed to a city | The same company rows, for that city only |
| A city page | The same company rows, for that city only |
| The category directory | One row per category, with the group it sits under and how many companies it holds |
| The city list | One row per city, with how many companies it holds |

A page number inside a pasted link is honoured, so a long listing can be read a slice at a time: paste
`/category/general-business/2` with **Maximum pages per list** at 4 and the run reads pages 2-5. A search
is the one task with no link to paste — the words are not part of any page address — so put them in
**Search keywords** and the country in **Country**.

#### Countries covered

Every directory the network runs, linked to its own website. The *Country* list carries the same entries;
a country name or a hostname works in the input too.

**Africa** — [Algeria](https://www.algeriayp.com), [Benin](https://www.beninyp.com), [Botswana](https://www.localbotswana.com), [Cameroon](https://www.businesslist.co.cm), [Chad](https://www.chadyp.com), [Djibouti](https://www.djiboutiyp.com), [DR Congo](https://www.congoyp.com), [Ethiopia](https://www.ethyp.com), [Gabon](https://www.yelu.ga), [Ghana](https://www.ghanayello.com), [Ivory Coast](https://www.yelloci.com), [Kenya](https://www.businesslist.co.ke), [Lesotho](https://www.lesothoyp.com), [Libya](https://www.libyayp.com), [Madagascar](https://www.madayp.com), [Malawi](https://www.malawiyp.com), [Mali](https://www.maliyp.com), [Mauritania](https://www.mauritaniayp.com), [Mauritius](https://www.yelo.mu), [Morocco](https://www.yelo.ma), [Mozambique](https://www.mozambiqueyp.com), [Namibia](https://www.namibiayp.com), [Niger](https://www.nigeryp.com), [Nigeria](https://www.businesslist.com.ng), [Rwanda](https://www.rwandayp.com), [Senegal](https://www.yelu.sn), [Seychelles](https://www.seychellesyp.com), [South Africa](https://www.yellosa.co.za), [Sudan](https://www.sudanyp.com), [Tanzania](https://www.tanzapages.com), [Togo](https://www.togoyp.com), [Tunisia](https://www.tunisiayp.com), [Uganda](https://www.yellow.ug), [Zambia](https://www.zambiayp.com), [Zimbabwe](https://www.zimbabweyp.com)

**Asia** — [Armenia](https://www.armeniayp.com), [Azerbaijan](https://www.azerbaijanyp.com), [Bangladesh](https://www.bangladeshyp.com), [Brunei](https://www.bruneiyp.com), [Cambodia](https://www.cambodiayp.com), [China](https://www.chinayello.com), [Georgia](https://www.georgiayp.com), [Hong Kong](https://www.yelo.hk), [India](https://www.yelu.in), [Indonesia](https://www.indonesiayp.com), [Japan](https://www.japanyello.com), [Kazakhstan](https://www.kazakhstanyp.com), [Kyrgyzstan](https://www.yelo.com.kg), [Laos](https://www.laosyp.com), [Malaysia](https://www.businesslist.my), [Maldives](https://www.maldivesyp.com), [Myanmar](https://www.myanmaryp.com), [Nepal](https://www.nepalyp.com), [Pakistan](https://www.businesslist.pk), [Philippines](https://www.businesslist.ph), [Singapore](https://www.yelu.sg), [South Korea](https://www.southkoreayp.com), [Sri Lanka](https://www.lankayp.com), [Taiwan](https://www.taiwanyello.com), [Thailand](https://www.thaiyello.com), [Uzbekistan](https://www.uzbekistanyp.com), [Vietnam](https://www.vietnamyello.com)

**Europe** — [Albania](https://www.albaniayp.com), [Austria](https://www.austriayp.com), [Belarus](https://www.yelo.by), [Belgium](https://www.belgiumyp.com), [Croatia](https://www.croatiayp.com), [Cyprus](https://www.cypindex.com), [Estonia](https://www.estoniayp.com), [Finland](https://www.yellofi.com), [Iceland](https://www.yelu.is), [Ireland](https://www.irelandyp.com), [Lithuania](https://www.imoniukontaktai.lt), [Luxembourg](https://www.luxyello.com), [Malta](https://www.maltayp.com), [Netherlands](https://www.yelu.nl), [Norway](https://www.yelono.com), [Poland](https://www.polandyp.com), [Portugal](https://www.portugalyp.com), [Romania](https://www.romaniayp.com), [Slovakia](https://www.slovakiayp.com), [Slovenia](https://www.sloveniayp.com), [Sweden](https://www.swedyello.com), [Switzerland](https://www.swissyello.com), [Turkey](https://www.turkishyello.com), [United Kingdom](https://www.yelu.uk)

**Middle East** — [Bahrain](https://www.bahrainyellow.com), [Egypt](https://www.egyptyello.com), [Emirates](https://www.yello.ae), [Iran](https://www.iranyell.com), [Israel](https://www.israeliyp.com), [Jordan](https://www.jordanyp.com), [Kuwait](https://www.kuwaityello.com), [Lebanon](https://www.yelleb.com), [Oman](https://www.omanyp.com), [Qatar](https://www.qataryello.com), [Saudi Arabia](https://www.saudiayp.com), [Syria](https://www.syriayp.com), [Yemen](https://www.yemenyp.com)

**North America** — [Bahamas](https://www.bahamasindex.com), [Barbados](https://www.barbadosindex.com), [Belize](https://www.yelu.bz), [Cayman Islands](https://www.caymanlist.com), [Costa Rica](https://www.yelu.cr), [Cuba](https://www.yellocu.com), [Dominican Republic](https://www.yelu.do), [El Salvador](https://www.elsalvadoryp.com), [Grenada](https://www.grenadaindex.com), [Guadeloupe](https://www.guadeloupeindex.com), [Guatemala](https://www.gtyello.com), [Honduras](https://www.yelu.hn), [Jamaica](https://www.jamaicaindex.com), [Martinique](https://www.martiniqueindex.com), [Mexico](https://www.yelo.com.mx), [Nicaragua](https://www.yelu.com.ni), [Panama](https://www.yelupa.com), [Puerto Rico](https://www.puertoricoindex.com), [Saint Lucia](https://www.saintluciaindex.com), [Trinidad and Tobago](https://www.tntyellow.com)

**South America** — [Argentina](https://www.arempresas.com), [Bolivia](https://www.boliviayp.com), [Brazil](https://www.brazilyello.com), [Chile](https://www.yelu.cl), [Colombia](https://www.yelu.com.co), [Ecuador](https://www.yelu.ec), [Guyana](https://www.guyanaindex.com), [Paraguay](https://www.yeloparaguay.com), [Peru](https://www.peruyello.com), [Suriname](https://www.surinamyp.com), [Uruguay](https://www.yelu.uy), [Venezuela](https://www.venezuelayello.com)

**Australia** — [Australia](https://www.australiayp.com), [Fiji](https://www.fijiyp.com), [New Zealand](https://www.businesslist.nz), [Papua New Guinea](https://www.pngyp.com)

**USA** — [Florida](https://www.floridanegocio.com)

### Why this Actor

- **All 136 directories, one Actor.** No other Actor on Apify covers this network beyond a handful of
  countries — most of them by hand, one website per Actor. Here the country is a dropdown: the same
  input and the same row shape work for every one of them.
- **Seven tasks, not one.** Keyword search, category sweep, city sweep, a list of company profiles, the
  category tree, the city list, and a pasted link that the Actor recognises and routes itself.
- **Two levels of detail.** Listing rows are quick to collect at scale; full profiles add opening hours,
  manager, employees, description, website, photo gallery, products with prices and reviews. You choose
  per run.
- **Lead-grade filters.** Keep only verified businesses, only ones with a phone number, or only the ones
  with no website at all — a ready shortlist for outreach.
- **Long listings, a slice at a time.** A link that starts at page 2 continues from page 2 for `maxPages`
  pages, so a 3,000-company category can be read across several runs without re-reading page 1.
- **The directory's own index, if you want to plan.** Its category tree and city list come back as rows
  with their sizes, so a sweep is planned from the site's numbers instead of a guess.
- **Duplicate-free and bounded.** A company filed under several categories is reported once; a run
  returns a useful sample quickly (200 rows) and sweeps a whole directory only when asked (`0`).
- **Honest failures.** A link the Actor does not collect is refused with a sentence saying what to paste
  instead; a country or category that matches nothing fails with the real list rather than an empty
  dataset. Masked phone numbers are emitted as published, flagged `phoneMasked`, never reconstructed.

### Quick start

1. Pick the directory in **Country** — `Kenya — www.businesslist.co.ke`.
2. Choose **Search — companies matching a keyword** under *What to scrape*, and type the trade in
   **Search keywords** — `hotel`, `hardware`, `printing`.
3. Press **Start**.

The dataset fills with one row per company the directory's own search returns. When you already have a
page open, paste its address into **URL** instead — a category, a city, a company or the directory
itself — and the Actor follows the link, reading the country from its hostname.

### Tutorial: a real workflow

Say you are building a supplier list for one trade in one country, then want to see the same trade
across a region, and finally a handful of the companies in full.

#### 1. Search one country

```json
{ "startMode": "search", "country": "Kenya", "searchQuery": "hotel" }
```

One row per hotel the directory's own search returns, in its own order, with the contacts and the map it
prints on the card:

```json
{
  "recordType": "companyCard",
  "companyId": 103441,
  "name": "Batton Contractors Ltd.",
  "city": "Nairobi",
  "country": "Kenya",
  "phone": "+254-202420234",
  "hasWebsite": true,
  "url": "https://www.businesslist.co.ke/company/103441/Batton_Contractors_Ltd"
}
```

Add `"city": "Nairobi"` to keep it local. A keyword that matches exactly one company comes back as that
company's full profile.

#### 2. Keep the search local to one city

```json
{ "startMode": "search", "country": "Kenya", "searchQuery": "hotel", "city": "Nairobi" }
```

Add a city and the directory itself narrows the answer, so the rows are the city's own matches rather
than a list filtered afterwards.

#### 3. Read a category instead, when the trade is the filter

```json
{ "pageUrl": "https://www.businesslist.co.ke/category/general-business" }
```

For a trade the search phrases badly — printing, plumbing, freight — a category is the cleaner scope: one
row per company listed under it, with the badges the card prints. The link's own country is what the run
reads, and this directory files 17,107 companies under *General Business* across 856 pages.

```json
{
  "recordType": "companyCard",
  "companyId": 103441,
  "name": "Batton Contractors Ltd.",
  "city": "Nairobi",
  "phone": "+254-202420234",
  "verified": true,
  "yearsInBusiness": 21,
  "establishedYear": 2005,
  "sourceCategory": "General Business",
  "sourcePage": 1,
  "url": "https://www.businesslist.co.ke/company/103441/batton-contractors"
}
```

Paste a category page already narrowed to a city and the same rows come back for that city only. A page
number carried by the link picks the slice, so a sweep can be split across runs.

#### 4. Fetch the ones worth a call in full

```json
{ "includeDetails": true }
```

With the same search or category scope, every company is read from its own page as well. That is where a
profile's own fields appear — hours, manager, website, products, reviews:

```json
{
  "recordType": "companyProfile",
  "companyId": 103441,
  "name": "Batton Contractors Ltd.",
  "city": "Nairobi",
  "country": "Kenya",
  "phone": "+254-202420234",
  "websiteUrl": "http://www.battoncontractors.co.ke/",
  "manager": "Tom Msando.",
  "employees": "1-5",
  "establishedYear": 2005,
  "address": "P.O. Box: 52806-00200 Nairobi City Square., Kenya",
  "openingHours": [
    { "day": "Monday", "hours": "8:00am-6:00pm" },
    { "day": "Saturday", "hours": "9:00am-1:00pm" },
    { "day": "Sunday", "hours": "Closed" }
  ],
  "categories": ["General Business"]
}
```

#### 5. Re-read one company later

```json
{ "startMode": "company", "companyUrls": ["https://www.businesslist.co.ke/company/103441"] }
```

A profile link is enough and names its own country. Bare ids work too when **Country** says which
directory they belong to — `{"companyUrls": ["103441"], "country": "Kenya"}` — which is the shape a
previous run's `companyId` column has.

#### 6. Plan the next sweep from the directory's own index

```json
{ "startMode": "categories", "country": "Kenya" }
```

```json
{ "recordType": "category", "categoryId": 1455, "name": "General Business",
  "group": "Business services", "count": 3117,
  "url": "https://www.businesslist.co.ke/category/general-business" }
```

`cities` does the same for the city list. Every label, slug and id here can be pasted straight into
*Categories*, or into *City* when it is a city, to scope a companies run.

#### 7. Sweep a whole directory

```json
{ "startMode": "companies", "country": "Kenya", "maxItems": 0, "maxPages": 0 }
```

Every company that directory lists, one row each, deduplicated across its categories. Leaving *Fetch full
profiles* off is what keeps a sweep like this quick; with it on, every company is also read from its own
page.

### Input

| Field (key) | What it does | Default |
|---|---|---|
| **URL** (`pageUrl`) | A link from any directory in the network, when you already have one. Leave it empty to run one of the tasks instead. | a category link |
| **Country** (`country`) | The one directory this run reads — every country the network covers, with its hostname. Required unless the URL or the profile links name the country. | Kenya |
| **Search keywords** (`searchQuery`) | What you are looking for: one keyword or phrase, sent to that directory's own search. | — |
| **City** (`city`) | Optional, one city: keeps a search local, narrows a category listing, or is what the Location task reads. | — |
| **What to scrape** (`startMode`) | `auto` — from the pasted URL — or an explicit task: `search`, `companies`, `location`, `company`, `categories`, `cities`. | `auto` |
| **Categories** (`categories`) | Companies runs only: labels, URL slugs or ids. Empty takes the link's category, or every category. | from the link |
| **Company links or ids** (`companyUrls`) | Company task, required: profile links, or ids together with *Country*. | — |
| **Fetch full profiles** (`includeDetails`) | Read every company from its own page — hours, manager, website, pictures, products, reviews. One more page per company. | `false` |
| **Verified listings only** (`verifiedOnly`) | Keep the companies the directory marks as verified. | `false` |
| **Only listings with a phone number** (`withPhoneOnly`) | Drop companies that publish no phone. | `false` |
| **Only listings with no website** (`withoutWebsiteOnly`) | Keep companies with no website at all — the outreach shortlist. | `false` |
| **Maximum rows** (`maxItems`) | Row cap for the whole run; `0` collects everything. | `200` |
| **Maximum pages per list** (`maxPages`) | Page cap for each category or city listing; `0` pages every list to its end. | `0` |
| **Delay between pages** (`requestDelayMs`) | Pause between two pages, in milliseconds. | `250` |
| **Retries per page** (`maxRequestRetries`) | Retries before a page that fails is given up on. | `4` |
| **Proxy configuration** (`proxyConfiguration`) | Optional. A refused request is retried through Apify Proxy on its own; this field pins a proxy for the whole run. | none |
| **Debug: include raw source record** (`debugIncludeRaw`) | Adds the parsed source record to each row. | `false` |

The tasks below `auto` exist for runs with no link to paste; they take their scope from these fields
instead.

**The three filters cut the bill, not just the noise.** They decide on each company before its own page
is opened, because the listing already says whether it is verified, has a phone and has a website — so a
filtered-out lead costs nothing extra. The run's message reports how many rows the filters dropped, so a
sweep never looks mysteriously small.

### Output

One row kind per run. `recordType` tells them apart, and the dataset has a view per kind. Everything
the run already knows — which directory it read, which task it ran — is in the input, not repeated on
every row; a row carries what varies between rows.

**Companies**

| Column | What it holds |
|---|---|
| `name`, `companyId`, `url` | Identity, and the id that re-reads the profile |
| `address`, `city`, `country` | Where the company is; the country is the directory's own when the card prints none |
| `phone`, `phoneMasked` | The published number — masked form kept, digit for digit, when the site hides part of it |
| `hasEmail` | Whether the listing offers an enquiry form |
| `hasWebsite`, `websiteUrl` | Whether the company has a website, and — on profile rows — the address itself |
| `latitude`, `longitude` | Coordinates when the listing publishes them |
| `verified`, `membership`, `badges` | Directory badges: verified, paid membership, years listed, years trading |
| `yearsWithUs`, `yearsInBusiness`, `establishedYear` | The badge's year counts, and the establishment year |
| `rating`, `reviewsCount`, `questionsCount` | Published reviews and visitor questions, with the profile's average |
| `imageUrl`, `photosCount`, `imageUrls` | The lead picture (previewed in the Console), how many there are, and the whole gallery on profile rows |
| `productsCount`, `products` | The products and services a profile lists, with their prices |
| `reviews`, `questions` | Ratings, authors, dates, bodies, and the owner's replies |
| `openingHours` | One entry per published day, hours exactly as printed |
| `manager`, `employees`, `description` | Company facts from the profile |
| `categories`, `categorySlugs`, `keywords` | What the company is listed under, and the keywords it chose |
| `claimed`, `registeredAt`, `lastUpdatedAt` | When the listing was registered and last checked |
| `sourceCategory`, `sourcePage` | Which category and which listing page produced the row — empty for a search or a single listing |
| `recordType`, `scrapedAt` | Row kind, and when the row was built |

**Categories**

| Column | What it holds |
|---|---|
| `name`, `categoryId`, `url` | The category and the link to its listing |
| `group` | The heading it sits under in that directory |
| `count` | How many companies the directory counts in it |
| `recordType`, `scrapedAt` | Row kind, and when the row was built |

**Cities**

| Column | What it holds |
|---|---|
| `name`, `cityId`, `url` | The city and the link to its listing |
| `count` | How many companies the directory counts there |
| `recordType`, `scrapedAt` | Row kind, and when the row was built |

### Notes and limits

- **A search is a search, not a filter.** Your keywords go to the directory's own search and what it
  lists comes back, in its order. Nothing is matched afterwards, so a word the directory indexes
  differently can return companies whose name never spells it.
- **A directory that refuses a request is retried from another address, by itself.** Some of the network's
  hosts challenge certain networks with a "checking your browser" page instead of the listing. The Actor
  notices that it was refused rather than answered, switches that directory to Apify Proxy and carries on,
  so no run needs a proxy set up in advance and no country has to be avoided.
- **Four directories publish no keyword search.** DR Congo, Iceland, Laos and Lithuania answer no search
  page at all; a category, a city, a company or their own index still works there, and a search on those
  four is refused with a message saying so rather than returning an empty dataset.
- **A search has no link to share.** The words are not part of the page address, so a search cannot be
  replayed by pasting a link the way a category or a city can: the keyword and the country are the
  resume point.
- **A busy directory answers slowly, once.** When too many searches arrive in a short time the directory
  replies with an empty page instead of an error. The Actor asks again, and only an empty answer the
  second time is treated as no results.
- **Each directory has its own ids, categories and cities.** `companyId` is unique within the directory
  the run read, and category slugs differ between countries (`General_business`, `general-business`,
  `Negocio_General`) — a name the directory does not publish is reported in the run's status message,
  not fatal.
- **Bounded by default.** A run stops at 200 rows unless you set *Maximum rows* to `0`. Every page of each
  list is read by default; *Maximum pages per list* keeps a broad sweep short.
- **One row kind per run.** A companies run returns cards, or profiles when *Fetch full profiles* is on —
  never both, except that a company whose profile could not be read falls back to its card.
- **Phones are as published.** Some listings hide part of the number. The Actor keeps the masked form and
  flags it (`phoneMasked: true`) rather than guessing the missing digits.
- **No e-mail addresses.** The directories gate them behind a sign-in wall, so the row reports whether an
  enquiry form exists (`hasEmail`) and nothing more.
- **A listing card says a website exists without printing it.** The card marks the site but carries no
  link to the address, so card rows set `hasWebsite` and leave `websiteUrl` empty; profile rows carry the
  address itself, so turn *Fetch full profiles* on when you need the URLs.
- **The card's country is the directory's when it prints none.** The Spanish-language directories end the
  address at the city; the row then carries the country of the directory it came from.
- **Ratings are the sites' own.** `rating` is `0` when a profile has no review yet — that is the published
  figure, not a missing value.
- **Pictures are full-size originals**, deduplicated — the small thumbnails are dropped. `imageUrl` is the
  first of them, so a dataset previews in the Console; cards carry no picture, so it is empty there.
- **Duplicate-free across categories.** A company filed under several categories is reported once;
  `sourceCategory` names the category that produced the row.
- **Nothing to sign in to.** Every directory in the network is public, and no account is needed.
- **Failure over silence.** A link the Actor does not collect is refused with a sentence saying what to
  paste instead, an unknown country or category names the real values, and a run that finds nothing for the
  scope it was given fails with the reason.

### FAQ

**Do I need an account on the sites?** No. Every directory in the network is public and the Actor needs no
credentials.

**Where do I start?** With whatever you already have: a keyword and a country, or a page you are looking
at — a category, a city, a company, the directory itself. Paste the page's address into **URL**, or fill
the fields of the matching task under *What to scrape*.

**Which countries are covered?** All 136 linked under *Countries covered*, each on its own website. A
country name, a hostname or the list entry works in the input.

**Why did I only get 200 rows?** Because that is the default cap. Set *Maximum rows* to `0` to collect
everything.

**Why is `websiteUrl` empty on some rows?** Because that row is a listing card: the card says the company
has a website (`hasWebsite: true`) without printing the address. Turn *Fetch full profiles* on to read the
URL from the company's own page.

**Why is part of a phone number hidden?** Because the directory publishes it that way for some listings.
The Actor keeps it exactly and flags it instead of inventing the missing digits.

**Why does a row carry the directory's country rather than the company's?** Because that card prints no
country of its own, and the directory lists companies of its own country. A profile row carries the
country from the address.

**Can I collect a whole country?** Yes — choose the country, leave *Maximum rows* at `0`, and the run
reads every listing it has. A run reads one directory, so the network is covered country by country.

**Why was the link I pasted refused?** Because it is not a page one of the network's directories serves
(the sign-in page, the Data Hub, an article, or another site entirely). The message says which page to
paste instead.

**What if I have no link to paste?** Choose the task that matches what you have under *What to scrape* and
fill its fields — a keyword, a category, a city, or the ids from an earlier run.

### Contact

Bug reports, feature requests, or a custom scraper for a site not yet covered? Open an issue on the Actor's Apify Console page or message the maintainer directly there.

# Changelog

This Actor's version history is a separate document: https://apify.com/hamza325/yp-business-directories-scraper/changelog.md

# Actor input Schema

## `pageUrl` (type: `string`):

A link from any directory in the network, when you already have one. Paste it straight from the address bar: a category page, a city page, a company profile, the browse pages, or a search-results page. A listing link that already points at page 2 (`/category/General_business/2`) continues from page 2 for as many pages as `maxPages` allows, so a long listing can be split across runs — page 1 in one run, pages 2-5 in the next — without the Actor having to remember anything between them.

## `country` (type: `string`):

The directory to read. Every country the network covers is in this list, with its hostname; a hostname is accepted too.

## `searchQuery` (type: `string`):

What you are looking for, sent to the directory's own search. The site keeps its results in the browser session, so the words cannot come from a pasted link and belong here. A keyword that matches exactly one company returns that company's full profile. Four directories publish no keyword search — DR Congo, Iceland, Laos and Lithuania — and a search there is refused with a message naming the alternatives.

## `city` (type: `string`):

Optional city: keeps a search local, narrows a category listing, or is what the Location task reads. Names come from the `cities` task.

## `startMode` (type: `string`):

`auto` follows the pasted URL; the explicit tasks take their scope from these fields.

## `categories` (type: `array`):

Narrow a companies run to some categories: labels (`Cleaning equipment & Services`), URL slugs (`Cleaning_equipment_Services`) or ids from the `categories` mode. Leave empty for every category. A value that matches nothing fails the run with the real list instead of returning nothing, and categories are read from the live directory at the start of every run.

## `companyUrls` (type: `array`):

Company task, required: profile links from any directory, or bare ids — the `companyId` column of a previous run works when `Countries` names the directory it came from.

## `includeDetails` (type: `boolean`):

On: every company is read from its own page, adding opening hours, manager, employees, description, website address, categories, keywords, photos, products and reviews — one extra request per company. Off: the listing card is the row, which is roughly 20× faster and carries the name, address, phone, badges, coordinates and photo count. Profiles are always read in company mode.

## `verifiedOnly` (type: `boolean`):

Keep only companies the directory marks as verified — the badge a business earns by confirming its own details. Cheap: the listing page already carries the flag, so a rejected lead is dropped before its profile is fetched.

## `withPhoneOnly` (type: `boolean`):

Drop companies that publish no phone number. The listing page carries the number, so this costs nothing extra even without full profiles. Note that some directories publish masked numbers (`+213****4222`); those still count as a phone, and `phoneMasked` says which they are.

## `withoutWebsiteOnly` (type: `boolean`):

Keep the companies that have no website at all — the classic local-lead shortlist for web design, SEO or hosting outreach. The listing page states whether a website exists, so no profile fetch is needed to apply it.

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

Row cap for the whole run. The default keeps a run quick; 0 collects everything — the whole directory is about 13,000 companies, which takes roughly an hour in listing mode.

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

Page cap for each category or city listing (20 companies per page). 0 pages every list to its end; a small number keeps a run short and cheap. It counts the pages actually read, so with a link that starts at page 2 it walks pages 2, 3, 4 … up to this many pages — the way to continue a long listing in a later run.

## `requestDelayMs` (type: `integer`):

Pause between two pages, in milliseconds. The directories ask visitors to wait 10 seconds between pages; the default is much shorter and is fine for ordinary use — raise it for very large sweeps.

## `maxRequestRetries` (type: `integer`):

How many times a failed request is retried before it is given up on.

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

Optional. When a directory refuses a request, the Actor retries it through Apify Proxy by itself, so nothing has to be set here; use this only to pin a proxy for the whole run.

## `debugIncludeRaw` (type: `boolean`):

Add the parsed page record to every row, for debugging.

## Actor input object example

```json
{
  "pageUrl": "https://www.algeriayp.com/category/Cleaning_equipment_Services",
  "country": "Kenya",
  "searchQuery": "hotel",
  "city": "Nairobi",
  "startMode": "auto",
  "companyUrls": [
    "https://www.algeriayp.com/company/1191/EPTRC_EntrPublique_des_Travaux_Routiers_du_Centre",
    "3399"
  ],
  "includeDetails": false,
  "verifiedOnly": false,
  "withPhoneOnly": false,
  "withoutWebsiteOnly": false,
  "maxItems": 200,
  "maxPages": 0,
  "requestDelayMs": 250,
  "maxRequestRetries": 4,
  "debugIncludeRaw": false
}
```

# Actor output Schema

## `rows` (type: `string`):

Default dataset with every row the run pushed. Filter on `recordType` — or open the `companies`, `categories` and `cities` views — to read one kind at a time.

# 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 = {
    "pageUrl": "https://www.algeriayp.com/category/Cleaning_equipment_Services",
    "country": "Kenya"
};

// Run the Actor and wait for it to finish
const run = await client.actor("hamza325/yp-business-directories-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 = {
    "pageUrl": "https://www.algeriayp.com/category/Cleaning_equipment_Services",
    "country": "Kenya",
}

# Run the Actor and wait for it to finish
run = client.actor("hamza325/yp-business-directories-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 '{
  "pageUrl": "https://www.algeriayp.com/category/Cleaning_equipment_Services",
  "country": "Kenya"
}' |
apify call hamza325/yp-business-directories-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,hamza325/yp-business-directories-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/t2VT5q6nCcXBmxz8x/builds/Lt6q8YlM4JioX7xhH/openapi.json
