# Europe Business Directory Scraper (gelbeseiten.de) (`accommodating_aptitude/europages`) Actor

Pulls publicly listed business profiles from the European (German) B2B directory gelbeseiten.de with company name, country/city, industry, contact details and link. Switched to this open alternative because europages.com is fully closed in robots.txt (see README).

- **URL**: https://apify.com/accommodating_aptitude/europages.md
- **Developed by:** [Korhan Coşan Ergün](https://apify.com/accommodating_aptitude) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 80.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 1,000 business founds

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

## Europe Business Directory Scraper (gelbeseiten.de instead of europages.com)

The task description pointed at europages.com (a European B2B company
directory). **Verified on 9 November 2026:** the robots.txt of
europages.co.uk/.com/.es/.de and the sibling brand wlw.de (all part of the
Visable group) contains **`Disallow: /`** for the generic
`User-agent: *` — meaning all paths are completely closed to generic bots
(like ours). `Allow: /` is granted only to large, named search engine/AI
bots (Googlebot, bingbot, YandexBot, ChatGPT-User, PerplexityBot, etc.),
and even for those the company profile/search pages are specifically
disallowed (`Disallow: /*/companies/`, `Disallow: */cpid-*`,
`Disallow: /*/search/`). Per the task's "respect robots.txt" rule, no
bypass was attempted.

### Other alternatives ruled out (tested 9 November 2026)

| Site | Result |
|---|---|
| kompass.com | DataDome bot protection → HTTP 403 on a plain request |
| b2bhint.com | Cloudflare "Sorry, you have been blocked" |
| www.yell.com | Cloudflare "Attention Required" |
| cylex-uk.co.uk | Cloudflare "Attention Required" |
| opencorporates.com | robots.txt is permissive, but the ToS "Prohibited use" section explicitly forbids scraping |

### The alternative chosen: gelbeseiten.de

Germany's established business directory ("Gelbe Seiten" = Yellow Pages;
Germany is an EU member — so it falls within the scope of a "European
company directory").

**robots.txt (verified 9 November 2026):** for the generic
`User-agent: *`, only `/starteintrag/selbstedition/`, `/subscriberId=`,
`/mobileadserver`, `/regionaleAnzeigen/`, `/suche`, `/Suche` and `/prg` are
disallowed. This actor uses NONE of them; it discovers business detail
pages (`/gsbiz/<uuid>`) through the official sitemap announced in
robots.txt (`sitemap_index_detailseite.xml`) — the site itself offers those
pages up for discovery.

### Data source and method

Every business detail page contains a `schema.org/LocalBusiness` JSON-LD
block (fetched with plain `httpx` and parsed with `json.loads`; no
JavaScript needed). The sitemap XML files are treated as untrusted external
input and parsed with `defusedxml.ElementTree` (XXE protection).

**PII note:** the phone number and website are corporate contact details
published publicly for commercial purposes by the business ITSELF — not
private data about natural persons (this is the B2B/business-directory
standard; europages, kompass and others publish the same kind of corporate
data). No personal names are collected in the records.

### Input

| Field | Description |
|---|---|
| `maxItems` | Maximum number of business records |
| `sitemapShardIndex` | Index of the sitemap shard to start from (each shard contains only a few businesses, so shards are crawled consecutively) |

### Output (each record)

```json
{
  "id": "4734d032-2758-47c1-83c8-e992ff0428cd",
  "title": "Forstbetriebsleitung",
  "link": "https://www.gelbeseiten.de/gsbiz/4734d032-2758-47c1-83c8-e992ff0428cd",
  "date": null,
  "source_url": "https://www.gelbeseiten.de/sitemap_detailseite__alle_8.xml.gz",
  "scraped_at": "2026-11-10T00:46:08Z",
  "source": "gelbeseiten.de",
  "country": "DE",
  "city": "Adelsheim",
  "category": "Forstwirtschaftsbetrieb",
  "products": ["Forstwirtschaftsbetrieb"],
  "contact_phone": "06261 84-10 70",
  "contact_website": null
}
```

`sample_output.json` contains **12 records** taken from a real local run
(9 sitemap shards were crawled).

### Pricing (PPE)

A `business-found` event is fired for every business found.

### Local run

```bash
cd ~/rua/products/apify/europages
mkdir -p storage/key_value_stores/default
cat > storage/key_value_stores/default/INPUT.json <<'EOF'
{"maxItems": 12, "sitemapShardIndex": 1}
EOF
APIFY_LOCAL=1 python3 main.py
## output: storage/datasets/default/*.json
```

### Known limitations

- Niche difference: gelbeseiten.de is a local/regional business directory
  (Germany only), not a multinational B2B product catalogue like
  europages. The "products" field is most often a single keyword/industry
  label, not a detailed product list as on europages.
- Each sitemap shard contains only a few businesses (1–10 observed); large
  collections require crawling many shards (the actor does this
  automatically, capped at 40 shards).
- On some detail pages the LocalBusiness JSON-LD cannot be found (the
  listing may have been removed/deactivated) — those records are skipped.

# Actor input Schema

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

Maximum number of business records

## `sitemapShardIndex` (type: `integer`):

Which shard (sitemap_detailseite__alle_N.xml.gz) from gelbeseiten.de's sitemap_index_detailseite.xml to start from. Because each shard contains only a few businesses (observed: ~1-10), several shards are crawled consecutively until maxItems is reached.

## Actor input object example

```json
{
  "maxItems": 20,
  "sitemapShardIndex": 1
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing all records found in this run.

# 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("accommodating_aptitude/europages").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("accommodating_aptitude/europages").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 '{}' |
apify call accommodating_aptitude/europages --silent --output-dataset

```

## MCP server setup

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

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/bqUKBXjaS9SGPz3HG/builds/riUSQ4GCI3QfdBj6C/openapi.json
