# PaginasAmarillas.es Scraper (`memo23/paginasamarillas-es-scraper`) Actor

Scrape paginasamarillas.es (Spain Yellow Pages) into structured business rows: name, phone, email when listed, website, address, hours, rating. Keyword plus city, nationwide category, or a Spain PA search or profile URL. HTTP only, no browser. JSON or CSV out. $5 per 1,000 listings.

- **URL**: https://apify.com/memo23/paginasamarillas-es-scraper.md
- **Developed by:** [Muhamed Didovic](https://apify.com/memo23) (community)
- **Categories:** Lead generation, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 listings

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?

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

## PaginasAmarillas.es Scraper

<p align="center"><img src="https://raw.githubusercontent.com/muhamed-didovic/muhamed-didovic.github.io/main/assets/logo-paginasamarillas-es.png" alt="PaginasAmarillas.es Scraper logo" width="160" /></p>

Turn a Páginas Amarillas search into structured Spanish business rows: name, phone, email when listed, website, address, hours, rating, and profile link.

Keyword + city, nationwide category, or a paginasamarillas.es URL. JSON or CSV out.

This is **paginasamarillas.es** (Spain). It is not the LATAM Páginas Amarillas sites (.com.mx, .com.ar, .com.co, …), [PagesJaunes.fr](https://apify.com/memo23/pagesjaunes-scraper-cheerio), or [PagineGialle](https://apify.com/memo23/paginegialle-scraper).

### Why Use This Scraper?

- Phone and address on the search card
- Profile pass for rating, hours, and extra website/email when listed
- About 30 businesses per page
- HTTP first. Opens a browser only when Incapsula challenges the request

### Overview

Built for sales teams, agencies, and researchers who need Spanish **business** leads from Páginas Amarillas.

Every start type becomes **one dataset row per listing**. A keyword search and a `/f/{city}/{slug}_{id}_*.html` profile emit the same flat shape. Rows are de-duplicated by listing id.

### Supported Inputs

#### Search terms and locations

| Field | Example |
| --- | --- |
| `searchTerms` | `["restaurantes"]`, `["fontaneros", "abogados"]` |
| `locations` | `["Madrid"]`, `["Barcelona"]`, `["Valencia"]` |

Every term is searched in every location. Leave `locations` empty for a nationwide category search.

#### URL types

| URL type | Pattern | Example |
| --- | --- | --- |
| Search | `/search/{what}/all-ma/{city}/all-is/{city}/.../{page}` | `https://www.paginasamarillas.es/search/restaurantes/all-ma/madrid/all-is/madrid/all-ba/all-pu/all-nc/1?what=restaurantes&where=madrid` |
| Nationwide | `/search/{what}/all-ma/all-pr/all-is/all-ci/.../1` | `https://www.paginasamarillas.es/search/electricistas/all-ma/all-pr/all-is/all-ci/all-ba/all-pu/all-nc/1` |
| Profile | `/f/{city}/{slug}_{id}_{pad}.html` | `https://www.paginasamarillas.es/f/madrid/la-daniela-cuchilleros_195495346_000000002.html` |

**Unsupported:** paginasamarillas.com.mx / .com.ar / .com.co and other LATAM hosts. Spain `.es` only.

### Use Cases

| Audience | What they take from a run |
| --- | --- |
| Sales and outreach | Phone + website + email (when listed) by trade and city |
| Agencies | Cross-joined term × city lists in one dataset |
| Local SEO | Category, rating, and the Páginas Amarillas profile URL |
| Researchers | Hours and coordinates when the profile publishes them |

### How It Works

1. Cross-join `searchTerms` × `locations` (or nationwide if no city), plus any paginasamarillas.es URLs.
2. Fetch the search page (about 30 businesses).
3. Page with the last path segment in parallel, stopping at `maxItems` or `maxPages`.
4. Read name, phone, website, and address from the search card.
5. Optionally open the profile for rating, hours, and extra contact fields.
6. De-duplicate by listing id and push one row per business.

<p align="center"><img src="https://raw.githubusercontent.com/muhamed-didovic/muhamed-didovic.github.io/main/assets/how-it-works-paginasamarillas-es.png" alt="How the PaginasAmarillas.es scraper turns a search into business rows" width="800" /></p>

### Input Configuration

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `searchTerms` | array | one of the start types | What you would type into Páginas Amarillas |
| `locations` | array | no | Spanish city / province. Empty = nationwide |
| `startUrls` | array | one of the start types | Search or profile URL |
| `maxItems` | integer | no | Default 50. Free users capped at 50. |
| `scrapeDetails` | boolean | no | Default true. Rating, hours, extra contact. |
| `maxPages` | integer | no | Default 20. |
| `maxConcurrency` | integer | no | Default 5. |
| `proxy` | object | no | Default is Apify residential. The site is behind Incapsula. |

#### Example input

```json
{
  "searchTerms": ["restaurantes"],
  "locations": ["Madrid"],
  "maxItems": 50
}
```

### Output Overview

One flat row per business. Contact and address fields sit at the top level. `searchTerm` tells you which input produced the row. Email is present only when Páginas Amarillas publishes one.

### Output Samples

Search: restaurantes in Madrid, with profile enrich.

```json
{
  "listingId": "195495346",
  "name": "La Daniela Cuchilleros",
  "phone": "913662018",
  "email": null,
  "website": "http://www.tabernadeladaniela.com",
  "street": "Calle de los Cuchilleros, 9",
  "postalCode": "28005",
  "city": "Madrid",
  "rating": 4,
  "paginasAmarillasUrl": "https://www.paginasamarillas.es/f/madrid/la-daniela-cuchilleros_195495346_000000002.html"
}
```

### Key Output Fields

**Identity:** `listingId`, `slug`, `name`, `paginasAmarillasUrl`, `isPremium`

**Contact:** `phone`, `phones`, `fax`, `email`, `website`, `social`

**Place:** `address`, `street`, `postalCode`, `city`, `region`, `country`, `latitude`, `longitude`

**Directory:** `category`, `categories`, `rating`, `reviewCount`, `hours`, `description`, `images`, `logo`, `reviews`

**Provenance:** `searchTerm`, `scrapedAt`

### Pricing

| Event | When | Rate |
| --- | --- | --- |
| Actor start | Once per run, per GB of memory | $0.005 |
| Listing | Each unique business in the dataset | $0.005 ($5 / 1k) |
| Contact phone | Row has a phone | $0.002 |
| Contact email | Row has an email | $0.05 |

Phone and email are billed only when Páginas Amarillas publishes that field. A miss is free. Phone is common on the search card. Email is uncommon.

### FAQ

**Will every row have an email?** No. Phone is common. Inbox is only on some profiles. Phone and email are billed as extra events only when the field is present.

**What does scrapeDetails add?** Rating, hours, and extra website/email when the profile has them. Phone and address are already on many search cards.

**Do I need a proxy?** Yes on Apify. The site is behind Incapsula and blocks many datacenter IPs. Residential is the default.

**Does it scrape LATAM Páginas Amarillas?** No. Spain paginasamarillas.es only.

### Support

- Issues: [Actor Issues](https://console.apify.com/actors/H3YVGEYcFJbKuD2bU/issues)
- Author site: <https://muhamed-didovic.github.io/>
- Email: <muhamed.didovic@gmail.com>

### Additional Services

Bulk provincia sweeps, scheduled refreshes, or a private API wrapper: <muhamed.didovic@gmail.com>

### Explore More Scrapers

Directory cousins: [Herold.at](https://apify.com/memo23/herold-at-scraper), [PagineGialle](https://apify.com/memo23/paginegialle-scraper), [local.ch](https://apify.com/memo23/local-ch-scraper), [Gelbe Seiten](https://apify.com/memo23/gelbeseiten-scraper), [Yellow Pages US](https://apify.com/memo23/yellow-pages-us-scraper), [Yellow Pages Canada](https://apify.com/memo23/yellowpages-ca-scraper), [Canada411](https://apify.com/memo23/canada411-scraper), and [PagesJaunes.fr](https://apify.com/memo23/pagesjaunes-scraper-cheerio). More actors on [memo23](https://apify.com/memo23) and [didovic](https://apify.com/didovic).

### 🤖 For AI Agents & LLM Apps

Compact reference for AI agents calling this actor via the [Apify MCP server](https://mcp.apify.com) or the Apify API (actor: `memo23/paginasamarillas-es-scraper`).

**Purpose:** Extract PaginasAmarillas.es business listings (name, phone, email when listed, website, split address, hours) by keyword + city or URL.

**Minimal input:**

```json
{
  "searchTerms": ["restaurantes"],
  "locations": ["Madrid"],
  "maxItems": 10
}
```

**Output:** one dataset row per business — `listingId`, `slug`, `name`, `phone`, `phones`, `fax`, `email`, `website`, `social`, `address`, `street`, `postalCode`, `city`, `region`, `country`, `latitude`, `longitude`, `category`, `categories`, `rating`, `reviewCount`, `hours`, `description`, `images`, `logo`, `reviews`, `isPremium`, `paginasAmarillasUrl`, `searchTerm`, `scrapedAt`.

**Behaviors an agent should know:**

- Always set `maxItems`. Free users are capped at 50.
- `searchTerms` without `locations` runs a nationwide category search.
- `startUrls` work on their own (paginasamarillas.es only).
- Email is often empty. Phone is usually on the search card.
- Each listing is $0.005. A phone on the row is $0.002. An email is $0.05. Start is $0.005 per GB.
- Spain `.es` only. Not LATAM Páginas Amarillas.
- Cloud runs need the default residential proxy (Incapsula).

### ⚠️ Disclaimer

This Actor is an independent tool and is not affiliated with, endorsed by, or sponsored by Páginas Amarillas, Solocal, or Bee Digital. All trademarks mentioned are the property of their respective owners.

The scraper reads publicly listed Spanish business data from paginasamarillas.es. Users are responsible for ensuring their use complies with Páginas Amarillas Terms of Service, applicable data-protection law (GDPR / LOPDGDD), and any contractual obligations of their own organization.

### SEO Keywords

paginas amarillas scraper, paginasamarillas.es scraper, scrape paginasamarillas.es, Spanish yellow pages scraper, paginas amarillas API, Spanish business listings scraper, Spain phone email scraper, Madrid leads scraper, Apify paginas amarillas, Spanish restaurant leads, Barcelona business scraper, local SEO Spain data, paginas amarillas email scraper, Spanish directory scraper

# Actor input Schema

## `searchTerms` (type: `array`):

What you would type into Páginas Amarillas, e.g. <b>restaurantes</b>, <b>fontaneros</b>, <b>abogados</b>. One row per term. Every term is searched in every city below. Leave cities empty for a nationwide category.

## `locations` (type: `array`):

Spanish city or province, e.g. <b>Madrid</b>, <b>Barcelona</b>, <b>Valencia</b>. Empty = nationwide.

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

Stop after this many unique businesses across the whole run. Free plan is capped at 50.

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

Examples: <code>https://www.paginasamarillas.es/search/restaurantes/all-ma/madrid/all-is/madrid/all-ba/all-pu/all-nc/1?what=restaurantes\&where=madrid</code> or <code>https://www.paginasamarillas.es/f/madrid/la-daniela-cuchilleros\_195495346\_000000002.html</code>.

## `scrapeDetails` (type: `boolean`):

Opens the profile for rating, hours, and extra website/email when listed. Phone and address are already on many search cards. Turn off to skip the extra profile requests.

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

Each search page is about 30 businesses. Page N is the last path segment.

## `maxConcurrency` (type: `integer`):

How many pages and profiles to load at the same time.

## `proxy` (type: `object`):

On by default. PaginasAmarillas.es is behind Incapsula; a residential proxy is how cloud runs get listings.

## Actor input object example

```json
{
  "searchTerms": [
    "restaurantes"
  ],
  "locations": [
    "Madrid"
  ],
  "maxItems": 50,
  "scrapeDetails": true,
  "maxPages": 20,
  "maxConcurrency": 5,
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "ES"
  }
}
```

# Actor output Schema

## `overview` (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 = {
    "searchTerms": [
        "restaurantes"
    ],
    "locations": [
        "Madrid"
    ],
    "proxy": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "ES"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("memo23/paginasamarillas-es-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 = {
    "searchTerms": ["restaurantes"],
    "locations": ["Madrid"],
    "proxy": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "ES",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("memo23/paginasamarillas-es-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 '{
  "searchTerms": [
    "restaurantes"
  ],
  "locations": [
    "Madrid"
  ],
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "ES"
  }
}' |
apify call memo23/paginasamarillas-es-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,memo23/paginasamarillas-es-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/H3YVGEYcFJbKuD2bU/builds/NV6BcFWD3OpAfsnQR/openapi.json
