# Kleinanzeigen Scraper (Kleinanzeigen.de Anzeigen) (`mdcurt/kleinanzeigen-scraper`) Actor

Scrape kleinanzeigen.de search results and ad details as clean JSON: price, VB/fixed/free, location and postal code, posting date, shipping, images, category, attributes and the public seller profile. Search by term and city or paste any results URL. Pay per ad, incremental mode for monitoring.

- **URL**: https://apify.com/mdcurt/kleinanzeigen-scraper.md
- **Developed by:** [Matthew Curtis](https://apify.com/mdcurt) (community)
- **Categories:** E-commerce, AI
- **Features:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.96 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
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

## Kleinanzeigen Scraper (Kleinanzeigen.de Anzeigen)

Scrape **kleinanzeigen.de** — Germany's largest classifieds site — into clean JSON. Search by term and city, paste any results or category URL, or look up single ads. One record per ad with price, VB/fixed/free, postal code and locality, posting date, shipping, images, category, attributes and the public seller profile. Pay only per ad; an incremental mode makes scheduled monitoring cheap.

*Deutsche Beschreibung weiter unten.*

### What it does

- **Search** any term (`fahrrad`, `iphone 13`, `wohnung mieten`) across all of Germany or in a city, district or postal code (`Berlin`, `Pankow`, `80331`). The location is resolved with Kleinanzeigen's own lookup, so it accepts the same spellings the site does.
- **Paste URLs**: any kleinanzeigen.de results page (search, category such as `/s-fahrraeder/c217`, or a filtered search you built in the browser), a single ad URL (`/s-anzeige/…`) or a bare ad id.
- **Details on** (default): every ad is opened and returns full attributes (e.g. `Zustand`, `Typ`), category path, all image URLs, shipping info and the seller's public profile (display name, private/commercial, active since, badges, PRO store).
- **Details off**: result-page data only (title, price, location, date, first image) — 25 ads per request, ideal for price monitoring.
- **Incremental mode**: pass the `id` values you already have in `knownIds`; they are skipped without a request and a result page made entirely of known ads stops pagination.
- **Fast first result**: a single-ad lookup returns in about 1.5 s; searches push their first record within 2–4 s and stream records as they are parsed.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `queries` | string\[] | `["fahrrad"]` | Search terms, kleinanzeigen.de results/category URLs, ad URLs or ad ids. Several entries share `maxItems` evenly. |
| `location` | string | `""` (all Germany) | City, district or postal code for search terms (`Berlin`, `Pankow`, `80331`, `Hamburg`). Not applied to pasted URLs — those already carry their own location. |
| `maxItems` | integer | `50` | Maximum ad records in total (1–2000). Kleinanzeigen serves 25 ads per page and at most 50 pages per search. |
| `fetchDetails` | boolean | `true` | Open each ad for the full record. Turn off for cheap, fast listing-only runs. |
| `knownIds` | string\[] | `[]` | Ad ids to skip (incremental mode, see below). |
| `proxyConfiguration` | object | Apify Proxy (datacenter) | Proxy settings. Datacenter proxies work; switch to residential if `SUMMARY.blocked` > 0. |

Example (agent-style one-record lookup):

```json
{ "queries": ["https://www.kleinanzeigen.de/s-anzeige/carver-drift-fully-mountainbike-54-cm-rahmenhoehe-27-5-zoll/3551132231-217-5412"], "maxItems": 1 }
```

Example (search):

```json
{ "queries": ["e bike", "rennrad"], "location": "München", "maxItems": 100, "fetchDetails": true }
```

### Output

One record per ad in the default dataset (`kind` is `detail` or `listing`):

```json
{
  "id": "3551132231",
  "url": "https://www.kleinanzeigen.de/s-anzeige/carver-drift-fully-mountainbike-54-cm-rahmenhoehe-27-5-zoll/3551132231-217-5412",
  "title": "Carver Drift Fully Mountainbike 54 cm Rahmenhöhe 27,5 Zoll",
  "price": 1150,
  "currency": "EUR",
  "priceText": "1.150 € VB",
  "priceType": "negotiable",
  "oldPrice": null,
  "adType": "offer",
  "location": "56564 Neuwied",
  "zip": "56564",
  "locality": "Neuwied",
  "postedAt": "2026-10-25",
  "description": "Ich verkaufe mein Carver Drift Fully, das mit einigen neuen Komponenten ausgestattet wurde und …",
  "shippingPossible": true,
  "shippingText": "+ Versand ab 23,99 €",
  "directBuy": true,
  "isTopAd": false,
  "imageCount": 3,
  "images": ["https://img.kleinanzeigen.de/api/v1/prod-ads/images/54/54f7dd85-…?rule=$_59.JPG"],
  "category": "Fahrräder & Zubehör",
  "categoryPath": ["Auto, Rad & Boot", "Fahrräder & Zubehör"],
  "attributes": { "Art": "Herren", "Typ": "Mountainbikes", "Zustand": "Sehr Gut" },
  "features": [],
  "seller": {
    "name": "Privater Anbieter",
    "type": "private",
    "since": "2026-08-23",
    "url": "https://www.kleinanzeigen.de/s-bestandsliste.html?userId=165846056",
    "badges": ["TOP Zufriedenheit"],
    "storeName": null,
    "storeUrl": null
  },
  "kind": "detail",
  "source": { "query": "fahrrad", "location": "Berlin" },
  "scrapedAt": "2026-10-25T01:39:03.031Z"
}
```

Field notes: `price` is a number in EUR (`0` for "Zu verschenken", `null` for "VB" without an amount); `priceType` is `fixed`, `negotiable` (VB), `free` or `unknown`; `oldPrice` is the crossed-out previous price when the seller reduced it; `postedAt` is an ISO date, with time (Europe/Berlin offset) when the result page showed "Heute"/"Gestern"; `description` is a snippet of up to 300 characters — open `url` for the full text; `isTopAd` marks paid "TOP" placements. Listing records (`fetchDetails: false`) carry the same core fields without `category`, `attributes`, `features`, `shippingText` and the seller profile.

A `SUMMARY` record in the key-value store reports queries, the resolved location, result totals, records pushed, duplicates and known ids skipped, blocked pages, inferred rate limit, p95 latency, time to first record and compute seconds.

### Pricing

Pay per event: **$0.005 per run start** plus **$0.0012 per ad record**. A single-ad lookup costs about $0.006; 1,000 ads with full details cost $1.21. Listing-only runs cost the same per record but use ~25× fewer requests, so they finish in seconds. No subscription, no minimum.

### Monitoring recipe (incremental mode)

1. Run once with your search, e.g. `{"queries": ["rennrad"], "location": "Köln", "maxItems": 200}`.
2. Store the `id` values of the dataset.
3. Schedule the same input plus `"knownIds": [...those ids...]` every hour. Known ads are skipped before any detail request, and as soon as a whole result page is already known the Actor stops paginating — a quiet hour costs one or two page requests and $0 in records. New ads arrive with full details, newest first.

Pair it with a webhook or the [Dataset Diff & Alert Monitor](https://apify.com/mdcurt/dataset-diff-monitor) Actor to get notified about new or repriced ads; the monitor runs this Actor on a schedule and sends only the added or changed ads to Slack, Discord, Telegram or a webhook.

### Speed

Measured from the live tests (datacenter proxy, 512 MB): first record after 1.4–4.2 s; ~210 ad records per minute with details on at the Actor's adaptive concurrency (starts at 2, grows to 6 while the error rate stays under 2 %); ~600 records per minute with details off. Request timeouts adapt to the observed latency, and a 429 pause is inferred from the server's `Retry-After` instead of blind backoff.

### Limitations

- Kleinanzeigen shows at most 50 pages (~1,250 ads) per search. Narrow by location or category URL for more.
- Sorting, price range and radius filters are not offered as inputs because kleinanzeigen.de's robots.txt disallows those URL forms; filter the output instead or paste a category URL.
- `description` is a 300-character snippet; full text, phone/e-mail contact and the seller's ad count are not scraped. Phone numbers and e-mail addresses that sellers type into titles or descriptions are redacted.
- Ads that disappear between the result page and the detail fetch are returned with listing data only.
- Datacenter proxies currently work; if the SUMMARY shows `blocked` > 0, switch `proxyConfiguration` to a residential group.

### Changelog

- **1.0.0** (2026-10-25) — first release: search by term + location, results/category/ad URLs, details on/off, incremental `knownIds`, AIMD concurrency, adaptive timeouts, SUMMARY record.

***

## Kleinanzeigen Scraper – Anzeigen von kleinanzeigen.de als JSON

Dieser Actor liest **kleinanzeigen.de** aus: Suchergebnisse und Anzeigendetails als sauberes JSON. Suche nach Begriff und Ort, Einfügen beliebiger Ergebnis- oder Kategorie-URLs oder Abfrage einzelner Anzeigen. Pro Anzeige ein Datensatz mit Preis, VB/Festpreis/zu verschenken, PLZ und Ort, Einstelldatum, Versand, Bildern, Kategorie, Details und dem öffentlichen Anbieterprofil. Bezahlt wird nur pro Anzeige; der Inkrementalmodus macht regelmäßiges Beobachten günstig.

### Funktionen

- **Suche** nach beliebigen Begriffen (`fahrrad`, `iphone 13`, `wohnung mieten`) deutschlandweit oder in Stadt, Stadtteil oder PLZ (`Berlin`, `Pankow`, `80331`). Der Ort wird über die Ortssuche von Kleinanzeigen aufgelöst.
- **URLs einfügen**: jede Ergebnisseite (Suche, Kategorie wie `/s-fahrraeder/c217`, im Browser gefilterte Suche), eine einzelne Anzeige (`/s-anzeige/…`) oder nur die Anzeigen-ID.
- **Details an** (Standard): jede Anzeige wird geöffnet; Ergebnis sind alle Details (z. B. `Zustand`, `Typ`), Kategoriepfad, alle Bild-URLs, Versandinfo und das öffentliche Anbieterprofil (Anzeigename, privat/gewerblich, aktiv seit, Abzeichen, PRO-Shop).
- **Details aus**: nur Daten der Ergebnisseite (Titel, Preis, Ort, Datum, erstes Bild) – 25 Anzeigen pro Abruf, ideal für Preisbeobachtung.
- **Inkrementalmodus**: bekannte `id`-Werte in `knownIds` übergeben; sie werden ohne Abruf übersprungen, und eine Ergebnisseite nur aus bekannten Anzeigen beendet das Blättern.
- **Schnelles erstes Ergebnis**: Einzelabfrage in ca. 1,5 s; Suchen liefern den ersten Datensatz nach 2–4 s und streamen weiter.

### Eingabe

| Feld | Typ | Standard | Beschreibung |
|---|---|---|---|
| `queries` | string\[] | `["fahrrad"]` | Suchbegriffe, Ergebnis-/Kategorie-URLs, Anzeigen-URLs oder Anzeigen-IDs. Mehrere Einträge teilen sich `maxItems` gleichmäßig. |
| `location` | string | `""` (ganz Deutschland) | Stadt, Stadtteil oder PLZ für Suchbegriffe. Gilt nicht für eingefügte URLs. |
| `maxItems` | integer | `50` | Maximale Anzahl Anzeigen insgesamt (1–2000). Kleinanzeigen zeigt 25 Anzeigen pro Seite und höchstens 50 Seiten. |
| `fetchDetails` | boolean | `true` | Jede Anzeige öffnen. Aus = günstige, schnelle Listenabfrage. |
| `knownIds` | string\[] | `[]` | Zu überspringende Anzeigen-IDs (Inkrementalmodus). |
| `proxyConfiguration` | object | Apify Proxy (Datacenter) | Proxy-Einstellungen. Datacenter-Proxys funktionieren; bei `SUMMARY.blocked` > 0 auf Residential wechseln. |

### Ausgabe

Pro Anzeige ein Datensatz (Beispiel oben): `id`, `url`, `title`, `price` (Zahl in EUR, `0` bei „Zu verschenken“, `null` bei „VB“ ohne Betrag), `priceType` (`fixed`, `negotiable`, `free`, `unknown`), `oldPrice`, `adType` (`offer`/`wanted`), `location`, `zip`, `locality`, `postedAt`, `description` (Ausschnitt bis 300 Zeichen), `shippingPossible`, `shippingText`, `directBuy`, `isTopAd`, `imageCount`, `images[]`, `category`, `categoryPath[]`, `attributes{}`, `seller{name,type,since,url,badges,storeName,storeUrl}`, `source`, `scrapedAt`. Ein `SUMMARY`-Eintrag im Key-Value-Store fasst den Lauf zusammen.

### Preis

Pay per Event: **0,005 $ pro Start** plus **0,0012 $ pro Anzeige**. Eine Einzelabfrage kostet rund 0,006 $, 1.000 Anzeigen mit Details 1,21 $. Kein Abo, kein Minimum.

### Beobachten (Inkrementalmodus)

1. Einmal mit der Suche laufen lassen, z. B. `{"queries": ["rennrad"], "location": "Köln", "maxItems": 200}`.
2. Die `id`-Werte des Datensatzes speichern.
3. Dieselbe Eingabe plus `"knownIds": [...]` stündlich planen. Bekannte Anzeigen werden vor jedem Detailabruf übersprungen; ist eine ganze Ergebnisseite bekannt, hört der Actor auf zu blättern – eine ruhige Stunde kostet ein bis zwei Seitenabrufe und 0 $ an Datensätzen.

In Kombination mit dem [Dataset Diff & Alert Monitor](https://apify.com/mdcurt/dataset-diff-monitor) kommen neue oder umgepreiste Anzeigen direkt per Slack, Discord, Telegram oder Webhook.

### Einschränkungen

- Höchstens 50 Seiten (~1.250 Anzeigen) pro Suche; für mehr nach Ort oder Kategorie-URL eingrenzen.
- Sortierung, Preisspanne und Umkreis werden nicht als Eingabe angeboten, weil die robots.txt von kleinanzeigen.de diese URL-Formen ausschließt; stattdessen Ausgabe filtern oder Kategorie-URL einfügen.
- `description` ist ein Ausschnitt von 300 Zeichen; Volltext, Telefon/E-Mail und Anzeigenzahl des Anbieters werden nicht erfasst. In Titel oder Text getippte Telefonnummern und E-Mail-Adressen werden entfernt.
- Zwischen Ergebnisseite und Detailabruf gelöschte Anzeigen werden nur mit Listendaten zurückgegeben.

# Actor input Schema

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

What to scrape. Each entry is either a free-text search term (e.g. "fahrrad", "iphone 13", "wohnung mieten"), a kleinanzeigen.de results URL (any search or category page you copied from the browser), a single ad URL (…/s-anzeige/…) or a bare ad id. Several entries share maxItems evenly. Returns one record per ad.

## `location` (type: `string`):

City, district or postal code to search in, e.g. "Berlin", "Pankow", "80331" or "Hamburg". Resolved with Kleinanzeigen's own location lookup. Leave empty for all of Germany. Only applies to search terms, not to pasted URLs.

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

Maximum number of ad records to return in total (1–2000). Kleinanzeigen shows 25 ads per page and at most 50 pages per search. A run returns the first record within a few seconds; expect roughly 150–300 records per minute with details on.

## `fetchDetails` (type: `boolean`):

On (default): open every ad and return full attributes, category, all image URLs, shipping info and the public seller profile (name, private/commercial, active since, badges). Off: return the lighter result-page data only (title, price, location, date, first image) — about 25× fewer requests, good for monitoring.

## `knownIds` (type: `array`):

Ad ids you already have. They are skipped without a detail request, and when a whole result page consists of known ads the search stops paginating — so a scheduled run only pays for new ads. Feed it the `id` values from your last dataset.

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

Apify Proxy settings. Datacenter proxies work for kleinanzeigen.de; switch to a residential group if the SUMMARY record reports blocked pages.

## Actor input object example

```json
{
  "queries": [
    "fahrrad"
  ],
  "location": "Berlin",
  "maxItems": 50,
  "fetchDetails": true,
  "knownIds": [],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `ads` (type: `string`):

One record per kleinanzeigen.de ad: id, url, title, price, currency, priceType, oldPrice, adType, location/zip/locality, postedAt, description snippet, shipping, images\[], category, attributes, seller (public profile) and source.

## `summary` (type: `string`):

SUMMARY record: queries, resolved location, result totals, records pushed, duplicates and known ids skipped, blocked pages, inferred rate limit, p95 latency, time to first record and compute seconds.

# 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": [
        "fahrrad"
    ],
    "location": "Berlin",
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("mdcurt/kleinanzeigen-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": ["fahrrad"],
    "location": "Berlin",
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("mdcurt/kleinanzeigen-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": [
    "fahrrad"
  ],
  "location": "Berlin",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call mdcurt/kleinanzeigen-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,mdcurt/kleinanzeigen-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/a9ccAJ5J8OjxG3qad/builds/H4Z5onqbdTR3ChP3p/openapi.json
