# Telefonbuch.de Scraper - German Names, Addresses & Phones (`xtracto/telefonbuch-de-scraper`) Actor

Scrape the German phone directory: name, street, postcode, city and the full phone number. The site splits and salts its phone numbers in the HTML; this actor reconstructs them and cross-checks each one against the site's own markup. HTTP-only, no account.

- **URL**: https://apify.com/xtracto/telefonbuch-de-scraper.md
- **Developed by:** [Farhan Febrian Nauval](https://apify.com/xtracto) (community)
- **Categories:** Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.33 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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

## Telefonbuch.de Scraper — German Names, Addresses & Phones

Scrape Germany's phone directory: name, street, postcode, city — and the **full phone number**,
reconstructed from markup that is deliberately built to prevent exactly that.

HTTP-only, no account, no browser.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `queries` | array | *required* | `name, city` (`Schmidt, Berlin`), `name/city`, or a pasted search URL |
| `maxResultsPerQuery` | integer | `100` | Entries come 10 to a page |
| `maxPages` | integer | `10` | Stops early at the end of results |
| `maxRounds` | integer | `2` | TLS ladder repeats on a refused page |
| `proxyConfiguration` | object | RESIDENTIAL **DE** | German directory — use a German exit |

### The phone number is hidden, twice

This is what the actor is actually for. The site splits and salts its phone numbers so that the
obvious extraction returns something wrong, and it does it **two different ways on the same
results page**:

**1. Truncated `itemprop`.**

```html
<span itemprop="telephone">0162 2 13 2<span style="display:none">…</span></span>1 39
```

Reading the `itemprop` element gives `0162 2 13 2…` — 7 of 11 digits, not dialable. The rest of
the number sits in the text node *after* the span closes. The detail page truncates it the same
way, so following the link does not help.

**2. Decoy digits in hidden spans.** Other entries carry no `itemprop` at all:

```html
0<span class="hide"> 3</span>3<span class="hide"> 96</span>0…
```

Read naively that yields a 26-digit number that is simply **wrong** — and, unlike a truncated
one, it looks complete. It passes any "is the field populated?" check.

One treatment defeats both: drop every hidden span, then read the container. Each number is then
**cross-checked against the site's own `phoneTo` markup** and the comparison is reported —
`87 of 87` matched in testing, and every row carries `phoneFromComment` so you can audit it
yourself.

### Output

```jsonc
{
  "_input": "Schmidt, Berlin",
  "_source": "S1-vcard",
  "_scrapedAt": "2026-09-07T11:04:06Z",
  "_page": 1,
  "_phoneSource": "dom",              // or "comment" if the fallback was used

  "name": "Algert-Schmidt Barbara",
  "phone": "0162 2 13 21 39",
  "phones": ["0162 2 13 21 39"],      // businesses often list several
  "phoneDigits": "01622132139",
  "phoneFromComment": "0162 2 13 21 39",
  "streetAddress": "Luckenwalder Str. 78",
  "postalCode": "12629",
  "city": "Berlin",
  "searchTerm": "Schmidt", "searchLocation": "Berlin",
  "detailUrl": "https://kontakt-1.dastelefonbuch.de/…"
}
```

In a 90-entry run: **phone on 90/90**, name 89/90, detail URL 90/90.

### Known limits

| Limit | Detail |
|---|---|
| Addresses are partial | Street on ~74/90, postcode and city on ~80/90 — some entries genuinely publish a number without an address |
| German exit needed | Reachability was measured 4/4 from a DE residential exit; other geos were not tested |
| No email | The directory does not publish email addresses |
| Watch `_phoneSource` | If it starts reporting `comment` or `none` in bulk, the reconstruction has drifted and the run log warns about blank phones |

# Actor input Schema

## `queries` (type: `array`):

Searches as 'name, city' (Schmidt, Berlin), 'name/city', or a pasted dastelefonbuch.de search URL.

## `maxResultsPerQuery` (type: `integer`):

Entries come 10 to a page.

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

Paging stops early when a page returns fewer than 10 entries.

## `maxRounds` (type: `integer`):

How many times to repeat the TLS profile ladder on a refused page.

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

Queries in parallel; pages within a query stay sequential.

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

Use Apify Proxy with country DE - this is a German directory and reachability was measured 4/4 from a German residential exit.

## Actor input object example

```json
{
  "queries": [
    "Baeckerei, Muenchen"
  ],
  "maxResultsPerQuery": 100,
  "maxPages": 10,
  "maxRounds": 2,
  "maxConcurrency": 2,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "DE"
  }
}
```

# Actor output Schema

## `entries` (type: `string`):

Dataset items shown in the 'Entries' view.

## `items` (type: `string`):

Every record this run produced, with all fields, as JSON.

# 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 = {
    "queries": [
        "Schmidt, Berlin"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "DE"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("xtracto/telefonbuch-de-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 = {
    "queries": ["Schmidt, Berlin"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "DE",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("xtracto/telefonbuch-de-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 '{
  "queries": [
    "Schmidt, Berlin"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "DE"
  }
}' |
apify call xtracto/telefonbuch-de-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,xtracto/telefonbuch-de-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/bELBfQ3jXsmW2yE3i/builds/BCuANOMbgOepe9nsI/openapi.json
