# Páginas Amarillas Spain (España) Scraper – B2B Leads (`nestdata/paginas-amarillas-spain-scraper`) Actor

Scrape Páginas Amarillas Spain (paginasamarillas.es) business leads: phones, WhatsApp links, emails, websites, social media and GPS coordinates. Export to CSV, JSON or Excel.

- **URL**: https://apify.com/nestdata/paginas-amarillas-spain-scraper.md
- **Developed by:** [Nest](https://apify.com/nestdata) (community)
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 business 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

## Páginas Amarillas Scraper

Extract data from thousands of **Páginas Amarillas Spain (`paginasamarillas.es`)** businesses in seconds.

Unlike basic directory scrapers, this Actor **automatically enriches every lead**: it visits each company's official website to extract **contact emails** and **social media profiles (Instagram, Facebook, LinkedIn)**, and analyzes phone numbers to generate **direct WhatsApp chat links (`wa.me`)**.

***

### 🚀 Key Features

- **Phone & WhatsApp Detection**: Identifies Spanish mobile numbers (starting with `6` or `7`) and automatically generates direct `[https://wa.me/34](https://wa.me/34)...` links ready for outreach. Also detects secondary mobile numbers hidden inside the business description.
- **Email & Social Media Enrichment**: Crawls the business's official website to capture contact emails, Instagram, Facebook, and LinkedIn profiles.
- **Web Design & SEO Agency Filters**: Easily filter businesses that **do NOT have a website** (`onlyWithoutWebsite`) or detect outdated websites running on insecure `http://` connections (`web_insegura_http`).
- **Full Address & Geolocation**: Extracts street address, postal code, city, province, and exact GPS coordinates (`latitud`, `longitud`).
- **Business Insights**: Captures category, description, review count, star rating, client seniority, and whether the listing is a paid ad (`es_anuncio_pago`).

***

### 🛠️ How to Use

1. Go to [paginasamarillas.es](https://www.paginasamarillas.es/) and search for any business sector and city (e.g., *"Clínicas dentales en Madrid"* or *"Restaurantes en Barcelona"*).
2. Copy the **URL** from your browser's address bar and paste it into the **Search URL (`searchUrl`)** input field.
3. Set the maximum number of leads you want to extract in **Max Leads (`maxItems`)**.
4. Click **Start** and download your data in **Excel, CSV, JSON, or HTML**.

***

### 📊 Sample Output

Here is an example of a single enriched lead generated by this Actor (using fictional company data):

```json
{
  "nombre": "Clínica Dental Sonrisa Perfecta S.L.",
  "telefono": "+34910001122",
  "tiene_whatsapp_movil": true,
  "link_whatsapp": "https://wa.me/34600123456",
  "otros_telefonos_en_texto": "600123456",
  "emails": "info@sonrisaperfecta-ejemplo.es, citas@sonrisaperfecta-ejemplo.es",
  "instagram": "https://www.instagram.com/sonrisaperfecta_ejemplo/",
  "facebook": "https://www.facebook.com/sonrisaperfecta.ejemplo/",
  "linkedin": "https://www.linkedin.com/company/clinica-sonrisa-perfecta-ejemplo",
  "tiene_web": true,
  "web": "http://www.sonrisaperfecta-ejemplo.es",
  "web_insegura_http": true,
  "es_anuncio_pago": true,
  "antiguedad_cliente": "+10 años con",
  "num_opiniones": 14,
  "estrellas": 5,
  "categoria": "Clínicas dentales",
  "calle": "Calle de Alcalá, 100 Local B",
  "codigo_postal": "28009",
  "localidad": "Madrid",
  "provincia": "MADRID",
  "latitud": 40.42347,
  "longitud": -3.67631,
  "descripcion": "Especialistas en implantología avanzada, ortodoncia invisible y estética dental. Más de 15 años cuidando de tu salud bucodental. Urgencias y citas por WhatsApp en el 600 123 456.",
  "ficha_paginas_amarillas": "https://www.paginasamarillas.es/f/madrid/clinica-dental-sonrisa-perfecta_000000000_000000001.html"
}
```

***

### 📋 Output Fields Reference

| Field | Description |
| :--- | :--- |
| `nombre` | Official business name |
| `telefono` | Main phone number |
| `tiene_whatsapp_movil` | `true` if a Spanish mobile number (`6xx` or `7xx`) was detected |
| `link_whatsapp` | Direct `[https://wa.me/34](https://wa.me/34)...` link ready to open chat |
| `otros_telefonos_en_texto` | Additional phone numbers extracted from the description text |
| `emails` | Contact emails scraped from the company's official website |
| `instagram` / `facebook` / `linkedin` | Social media links found on the company's website |
| `tiene_web` | `true` if the business has an external website |
| `web` | Clean official website URL (UTM tracking parameters removed) |
| `web_insegura_http` | `true` if the website uses insecure `http://` instead of `https://` |
| `es_anuncio_pago` | `true` if the business is paying for ads on Páginas Amarillas |
| `antiguedad_cliente` | Years advertised on Páginas Amarillas (if shown) |
| `num_opiniones` / `estrellas` | Total review count and star rating (1 to 5) |
| `categoria` | Business activity / category |
| `calle` / `codigo_postal` / `localidad` / `provincia` | Full physical address details |
| `latitud` / `longitud` | Exact GPS map coordinates |
| `descripcion` | Business description text |
| `ficha_paginas_amarillas` | Direct URL to the Páginas Amarillas listing |

***

### 🇪🇸 Guía en Español: Extractor de Leads de Páginas Amarillas

Extrae miles de empresas y clientes potenciales (leads B2B) de **Páginas Amarillas España (`paginasamarillas.es`)** y descárgalos en **Excel o CSV**.

#### ¿Qué diferencia a este Scraper?

- **Enriquecimiento automático de Emails y Redes Sociales**: El bot entra automáticamente en la web de cada negocio para extraer sus correos electrónicos de contacto, Instagram, Facebook y LinkedIn.
- **Detección de WhatsApp**: Identifica teléfonos móviles españoles (empezados en 6 o 7), incluso si están escritos dentro de la descripción del anuncio, y genera el enlace directo `[https://wa.me/34](https://wa.me/34)...`.
- **Filtros para Agencias de Marketing y Diseño Web**: Puedes marcar la opción para extraer **solo empresas sin página web** o localizar negocios con webs antiguas sin certificado SSL (`http://`).

#### ¿Cómo funciona?

1. Entra en [paginasamarillas.es](https://www.paginasamarillas.es/) y haz cualquier búsqueda (ej. *"Clínicas dentales en Madrid"* o *"Fontaneros en Valencia"*).
2. Copia el enlace (URL) de tu navegador y pégalo en el primer campo (**Search URL / URL de búsqueda**).
3. Elige cuántas empresas quieres descargar en **Max Leads** y pulsa el botón verde **Start**.

# Actor input Schema

## `searchUrl` (type: `string`):

EN: Search on paginasamarillas.es, copy the URL from your browser and paste it here. | ES: Busca en paginasamarillas.es, copia la URL y pégala aquí.

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

EN: Maximum number of businesses to download. | ES: Número máximo de negocios que quieres descargar.

## `scrapeEmailsAndSocials` (type: `boolean`):

EN: Visits each business website to find emails, Instagram, Facebook, and LinkedIn. | ES: Visita la web de cada negocio para buscar correos, Instagram, Facebook y LinkedIn.

## `onlyWithoutWebsite` (type: `boolean`):

EN: Saves only businesses that do not have their own website (ideal for agencies). | ES: Guarda solo negocios que no tienen web propia (ideal para agencias).

## `filterProvince` (type: `string`):

EN: Optional. E.g., Madrid, Las Palmas. Case and accent insensitive. | ES: Opcional. Ej: Madrid, Las Palmas. No distingue mayúsculas ni tildes.

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

EN: Páginas Amarillas blocks datacenter IPs. Keep Spanish Residential proxy enabled. | ES: Páginas Amarillas bloquea IPs de datacenter. Usa proxy residencial de España.

## Actor input object example

```json
{
  "searchUrl": "https://www.paginasamarillas.es/search/clinica-dental/all-ma/madrid/all-is/madrid/all-ba/all-pu/all-nc/1",
  "maxItems": 50,
  "scrapeEmailsAndSocials": true,
  "onlyWithoutWebsite": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "ES"
  }
}
```

# Actor output Schema

## `results` (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 = {
    "searchUrl": "https://www.paginasamarillas.es/search/clinica-dental/all-ma/madrid/all-is/madrid/all-ba/all-pu/all-nc/1",
    "maxItems": 50,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "ES"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("nestdata/paginas-amarillas-spain-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 = {
    "searchUrl": "https://www.paginasamarillas.es/search/clinica-dental/all-ma/madrid/all-is/madrid/all-ba/all-pu/all-nc/1",
    "maxItems": 50,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "ES",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("nestdata/paginas-amarillas-spain-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 '{
  "searchUrl": "https://www.paginasamarillas.es/search/clinica-dental/all-ma/madrid/all-is/madrid/all-ba/all-pu/all-nc/1",
  "maxItems": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "ES"
  }
}' |
apify call nestdata/paginas-amarillas-spain-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nestdata/paginas-amarillas-spain-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/whzsgNt21MktERaTr/builds/elCVO3YZqLucwNNuI/openapi.json
