# Paginegialle B2B (`data2b/paginegialle-b2b`) Actor

Extract precise Italian business data from paginegialle.it. This  Actor uses an optimized API to fetch Multisearch JSON, capturing names, addresses, phones, websites, emails, social links, ratings, & categories. With pagination, rate limiting, & unique ID deduplication, it ensures reliable data.

- **URL**: https://apify.com/data2b/paginegialle-b2b.md
- **Developed by:** [DATA2B](https://apify.com/data2b) (community)
- **Categories:** Automation, Lead generation, Developer tools
- **Stats:** 5 total users, 0 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

$500.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#rental-actors

## 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

## PagineGialle B2B

[![Apify Actor](https://img.shields.io/badge/Apify-Actor-blue)](https://apify.com)
[![Python Version](https://img.shields.io/badge/Python-3.12-blue)](https://www.python.org/downloads/release/python-3120/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

A powerful and robust Apify actor for extracting detailed business data from the Italian Yellow Pages website, PagineGialle.it. It is designed to bypass anti-scraping measures, automatically handle full pagination, and provide structured data for business analysis, marketing, or lead generation.

### Key Features

- **Multi-Category & Multi-City Scraping**: Launch complex searches for multiple business categories across several cities in a single run.
- **Smart Automatic Pagination**: The actor automatically detects the total number of result pages for each search and scrapes all of them, ensuring comprehensive data collection.
- **Residential Proxy Support**: Seamlessly integrates with Apify's residential proxies (`useProxy`) to avoid blocks and bypass anti-scraping measures, which is **essential** for getting complete results from PagineGialle.
- **Results Filtering**: Refine your data collection by choosing to keep only businesses that have an email address or a phone number listed.
- **High Concurrency**: Configure the number of parallel requests (`maxConcurrency`) to optimize scraping speed according to your needs.
- **Rich, Structured Data**: Extracts a wide range of data fields, including contact information, GPS coordinates, social media links, user ratings, and more.
- **Stable Environment**: Built on a stable version of Python (3.12) to ensure reliability and compatibility.

### How to Use

1. **Go to the Actor** on the Apify platform.
2. Click the **"Start"** button.
3. **Configure your search** in the "Input" tab.
   - Add the desired categories (e.g., `ristoranti`, `hotel`).
   - Add the desired cities (e.g., `roma`, `milano`).
4. **Enable Proxies**: For complete results, it is highly recommended to leave the `useProxy` option checked (`true`). Without it, the website will likely only return the first page of results.
5. **Run the Actor** and wait for the run to finish.
6. **Retrieve your data** from the dataset's "Output" tab.

### Input Configuration

The actor accepts the following parameters:

| Parameter | Type | Description | Default Value |
| :--- | :--- | :--- | :--- |
| `categories` | Array | A list of business categories to search for. | `["ristoranti"]` |
| `cities` | Array | A list of cities in which to perform the searches. | `["roma"]` |
| `useProxy` | Boolean | **Recommended.** Uses Apify's residential proxies to avoid being blocked. | `true` |
| `maxConcurrency`| Integer | The number of simultaneous requests to speed up scraping. | `5` |
| `filterByEmail`| Boolean | If checked, only results containing an email address will be kept. | `false` |
| `filterByPhone`| Boolean | If checked, only results containing a phone number will be kept. | `false` |

### Output Schema

Each record in the output dataset will represent a single business and will have the following structure:

| Field | Type | Description |
| :--- | :--- | :--- |
| `businessName` | String | The common name of the business. |
| `address` | String | The full street address of the business. |
| `phoneNumber` | String | The primary contact phone number. |
| `website` | String | The URL of the business's official website. |
| `email` | String | The contact email address. |
| `rating` | Number | The average user rating (out of 5). |
| `reviews_count` | Integer| The total number of user reviews. |
| `whatsapp` | String | The WhatsApp business number, if available. |
| `facebook` | String | The URL of the official Facebook page. |
| `instagram` | String | The URL of the official Instagram profile. |
| `twitter` | String | The URL of the official Twitter profile. |
| `latitude` | String | The geographic latitude. |
| `longitude` | String | The geographic longitude. |
| `zip_code` | String | The postal code. |
| `city` | String | The city where the business is located. |
| `province` | String | The province (e.g., RM for Rome). |
| `opening_hours`| String | A JSON string representing the opening hours schedule. |
| `description` | String | A short description of the business activity. |
| `category` | String | The category term used for the search. |
| `scraped_city` | String | The city term used for the search. |
| `unique_id` | String | A unique identifier for the business listing. |
| `timestamp` | String | The UTC timestamp of when the data was scraped. |

### License

This project is licensed under the MIT License.

# Actor input Schema

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

Enter one or more categories to search for (e.g., ristoranti, hotel).

## `cities` (type: `array`):

Enter one or more cities to search in (e.g., roma, milano).

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

The maximum number of pages to scrape for each search. The scraper will stop if it runs out of results before reaching this limit.

## `useProxy` (type: `boolean`):

Recommended. Use Apify Proxy to avoid being blocked and to scrape all pages.

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

The maximum number of requests to run in parallel.

## `filterByEmail` (type: `boolean`):

If checked, only results containing an email address will be returned.

## `filterByPhone` (type: `boolean`):

If checked, only results containing a phone number will be returned.

## Actor input object example

```json
{
  "categories": [
    "ristoranti"
  ],
  "cities": [
    "roma"
  ],
  "maxPages": 8,
  "useProxy": true,
  "maxConcurrency": 5,
  "filterByEmail": false,
  "filterByPhone": false
}
```

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("data2b/paginegialle-b2b").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("data2b/paginegialle-b2b").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call data2b/paginegialle-b2b --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=data2b/paginegialle-b2b",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/7evDUNodmsxNEDhCy/builds/jRZR9lcXFTEskc8c9/openapi.json
