# Kleinanzeigen Scraper (`barking_kelp/kleinanzeigen-scraper`) Actor

- **URL**: https://apify.com/barking_kelp/kleinanzeigen-scraper.md
- **Developed by:** [9839_ser](https://apify.com/barking_kelp) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.20 / 1,000 ads

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

## Kleinanzeigen Scraper & Monitor — eBay Kleinanzeigen API for Germany classifieds data

Scrape **kleinanzeigen.de** (formerly eBay Kleinanzeigen), Germany's largest classifieds site, without a browser and without login. Get search results, full ad details, seller profiles, seller ratings and view counts as clean JSON, CSV or Excel — or run it on a schedule as a **Kleinanzeigen monitor** that only returns new ads.

### What you can do with it

- **Reselling & arbitrage** — find underpriced iPhones, consoles, bikes or furniture as soon as they are posted.
- **Price monitoring** — track market prices for a model or category, get notified about price drops.
- **Lead generation** — collect commercial sellers and shops in a category or city.
- **Real estate** — watch rental and sale listings (Immobilien) in your city.
- **Cars** — monitor Autos listings by price range and location.
- **Market research** — export whole categories for analysis.

### Main features

#### Bypass the 1,250 result limit

Kleinanzeigen shows at most 50 pages × 25 = **1,250 results per search**, even when the site says "20,000 results". With **Bypass 1,250 result limit** on (default), the scraper automatically splits the search into price ranges (0–100,000 €, then halves) until each part has fewer than 1,250 results, and still collects ads without a price. A search for `iphone 13` with `maxItems: 5000` returns 5,000 unique ads.

The split only happens when you ask for more than 1,250 results, so small runs are not slowed down.

#### Monitoring mode + Telegram / Slack / email alerts

Turn on **Monitoring mode** and schedule the actor (e.g. every 15 minutes). It remembers seen ad IDs in a named key-value store and **outputs only ads that are new since the last run**. The first run saves the current state as a baseline and outputs the newest ads; a second run right after outputs nothing.

Optionally, **Also output price changes** emits known ads whose price changed, with `change: {kind: "price_changed", oldPrice, newPrice}`.

Connect the run to **Apify integrations** (Telegram, Slack, email, webhooks, Make, Zapier, n8n) to get a message for every new ad.

#### Any input you have

- **Keywords** with filters (the filters apply to keywords only; start URLs keep the filters they already contain): category, city or PLZ + radius, price range, private/commercial, offered/wanted, shipping, "Direkt kaufen", sort, posted within N days, exclude TOP ads.
- **Start URLs** — paste any search URL from your browser; all filters in it are kept. Ad URLs, seller URLs (`/s-bestandsliste.html?userId=...`) and shop URLs (`/pro/...`) work too.
- **Ad IDs** — the "Anzeigen-ID" of an ad.
- **Seller IDs** — get the seller profile plus all their active ads.

### Input

| Field | Description | Default |
|---|---|---|
| `searchQueries` | Keywords, one search each | `["iphone 13"]` |
| `startUrls` | Search / ad / seller / shop URLs | — |
| `adIds` | Ad IDs | — |
| `sellerIds` | Seller user IDs | — |
| `category` | Category ID or name (`173`, `Smartphones`, `Autos`) | — |
| `location`, `radiusKm` | City or PLZ, radius in km | — |
| `minPrice`, `maxPrice` | Price range in € | — |
| `sellerType` | `all` / `private` / `commercial` | `all` |
| `adType` | `offered` / `wanted` / `all` | `offered` |
| `shippingOnly`, `directBuyOnly` | Only ads with shipping / "Direkt kaufen" | `false` |
| `sort` | `newest` / `price_asc` / `price_desc` / `relevance` | `newest` |
| `postedWithinDays` | Only ads from the last N days (0 = all) | `0` |
| `excludeTopAds` | Skip promoted (TOP) ads | `false` |
| `maxItems` | Max ads for the whole run | `100` |
| `maxItemsPerQuery` | Max ads per keyword / URL / seller | — |
| `bypassResultLimit` | Split searches to get past 1,250 results | `true` |
| `includeDetails` | Open every ad: full description, attributes, all images, seller | `false` |
| `includeSellerRating` | Seller rating, reviews and badges | `false` |
| `includeViewCount` | View counter (fetching it adds 1 view) | `false` |
| `maxImages` | Max image URLs per ad | `20` |
| `monitoringMode` | Output only new ads between runs | `false` |
| `monitoringStoreName` | Separate monitoring state per watch | derived from input |
| `trackPriceChanges` | Also output price changes | `false` |
| `proxyConfiguration` | Proxy (residential DE recommended) | Apify Residential DE |
| `maxConcurrency`, `maxRetries` | Parallel requests, retries per request | `10`, `5` |

Example:

```json
{
  "searchQueries": ["iphone 13"],
  "location": "Berlin",
  "radiusKm": 20,
  "maxPrice": 400,
  "sellerType": "private",
  "maxItems": 500,
  "includeDetails": true,
  "includeSellerRating": true
}
```

### Output

Every record has a `type`: `ad` or `seller`. All fields are always present (`null` when unknown), so CSV and Excel columns stay stable. Dataset views: **Overview**, **Details**, **Sellers**.

```json
{
  "type": "ad",
  "adId": "3515324623",
  "url": "https://www.kleinanzeigen.de/s-anzeige/apple-iphone-13-gruen-265-gb-speicher/3515324623-173-7291",
  "title": "Apple iPhone 13 grün -> 265 GB Speicher",
  "price": 250.0,
  "currency": "EUR",
  "priceType": "NEGOTIABLE",
  "priceText": "250 € VB",
  "adType": "OFFERED",
  "isTopAd": false,
  "postedAt": "2026-11-03T16:20:00+01:00",
  "postedAtText": "Heute, 16:20",
  "createdAt": null,
  "location": { "postalCode": "87789", "city": "Woringen", "district": null, "locationId": "7291", "state": "Bayern", "latitude": null, "longitude": null },
  "category": { "id": "173", "name": "Smartphones", "path": ["Elektronik", "Smartphones"] },
  "shipping": { "available": true, "priceFrom": 6.19, "directBuy": true, "pickupOnly": false },
  "imageCount": 5,
  "images": ["https://img.kleinanzeigen.de/api/v1/prod-ads/images/...?rule=$_57.JPG"],
  "description": "Ich verkaufe hier mein Apple iPhone 13 ...",
  "attributes": { "Marke": "Apple", "Modell": "iPhone 13", "Zustand": "Sehr Gut" },
  "seller": {
    "userId": "161447978", "name": "Eunike", "type": "private", "activeSince": "2026-03-27",
    "isPro": false, "badges": [], "profileUrl": "https://www.kleinanzeigen.de/s-bestandsliste.html?userId=161447978",
    "shopUrl": null, "rating": { "average": 0.0, "stars": 0.0, "reviewCount": 0 }
  },
  "viewCount": null,
  "searchQuery": "iphone 13",
  "sourceUrl": "https://www.kleinanzeigen.de/s-sortierung:neuste/anzeige:angebote/iphone-13/k0",
  "scrapedAt": "2026-11-03T15:58:28Z",
  "detailsScraped": true,
  "change": null,
  "error": null
}
```

Without `includeDetails`, ads contain everything visible on the search page (title, price, location, date, a description snippet, first image, shipping flags, TOP/Pro markers). Ad IDs or URLs that no longer exist (or fail after all retries) return a free record with `type: "error"` and `error: "not_found"` / `"request_failed"`, so you can see which inputs are gone.

Seller records (`type: "seller"`) contain `userId`, `name`, `sellerType`, `activeSince`, `responseTime`, `followers`, `isPro`, `badges`, `rating`, `activeAdsCount` and `profileUrl`. `activeAdsCount` is null when `maxItems` stopped the crawl before all of the seller's ads were listed.

The key-value store record **OUTPUT** holds a run summary: results on site vs. scraped per query, number of price splits, new items in monitoring mode, error records, blocked requests and retries.

### Pricing

Pay per event — you pay only for what you get:

| Event | Price |
|---|---|
| Actor start | $0.005 per run |
| Ad in the dataset | $0.0012 |
| Ad details — ad page opened and parsed | +$0.001 per ad |
| Seller profile / unique seller rating | $0.001 |

The ad page is opened (and the ad-details event charged) when **Scrape ad details** is on, for every ad you give by **Ad ID or ad URL**, and when **Include seller rating** is on (the seller id comes from the ad page). Seller ratings are charged once per unique seller; in Sellers mode the seller record already covers it.

Examples:

- **1,000 results ≈ $1.2**
- **1,000 results with details ≈ $2.2**
- Monitoring every 15 minutes with ~20 new ads per run ≈ $0.03 per run.

Platform usage is included. Set **Maximum cost per run** in the run options to cap the spend; the actor stops cleanly when the limit is reached.

### How to set up monitoring

1. Fill in a keyword (or paste a search URL) and the filters you need.
2. Turn on **Monitoring mode (only new ads)**. Optionally set a **Monitoring store name** if you have several watches with similar input, and turn on **Also output price changes**.
3. Save the task and run it once — this saves the baseline.
4. Go to **Schedules → Create new**, choose the task and an interval (e.g. `*/15 * * * *`).
5. In the task's **Integrations** tab add Telegram, Slack, email or a webhook triggered on "Run succeeded" — or use Make / Zapier / n8n to send each new dataset item.

Monitoring always sorts by newest and stops paginating after two pages without new ads, so frequent runs are cheap.

### FAQ

**Is scraping Kleinanzeigen legal?**
The actor only collects publicly available data that anyone can see without logging in. It does not log in, does not send messages and does not collect phone numbers or other contact details. You are responsible for using the data in line with GDPR and the site's terms — e.g. do not store personal data you don't need.

**Do I need a proxy?**
kleinanzeigen.de is protected by Akamai. Small runs may work without a proxy, but for reliable results use **Apify Residential proxies from Germany** (the default). The actor uses browser-like TLS fingerprints, sticky sessions and automatic retries on fresh sessions when a page is blocked.

**Why does the site say 20,000 results but I only got 1,250?**
Turn on **Bypass 1,250 result limit** and set `maxItems` above 1,250.

**What are TOP ads?**
Promoted ads that appear on every result page regardless of sort. They're marked with `isTopAd: true`; use **Exclude promoted (TOP) ads** to skip them. Monitoring mode skips them automatically.

**Why is `postedAt` sometimes only a date?**
The site shows "Heute/Gestern, HH:MM" for recent ads and only a date for older ones. Bumped ads show the bump time.

**Is it an official eBay Kleinanzeigen API?**
No. It's an unofficial scraper of the public website that gives you API-like JSON output.

### Developer notes

- Stack: Python 3.12, Scrapy with `scrapy-impersonate` (curl_cffi, Chrome TLS fingerprint), Apify SDK (request queue, pay-per-event charging).
- Ad pages come in two layouts (the legacy HTML with `BelenConf`, and a newer Astro layout with JSON props); both are parsed to the same output.
- Run tests: `pip install -r requirements-dev.txt && pytest`.
- Run locally: put input in `storage/key_value_stores/default/INPUT.json` and run `python -m src`.

# Actor input Schema

## `searchQueries` (type: `array`):

Keywords, e.g. 'iphone 13'. Each keyword is a separate search. The filters below apply to these keywords.

## `startUrls` (type: `array`):

Any Kleinanzeigen search, ad or seller URL copied from the browser (search results, /s-anzeige/..., /s-bestandsliste.html?userId=..., /pro/...). Filters in a search URL are preserved.

## `adIds` (type: `array`):

Ad IDs (the 'Anzeigen-ID' on the ad page). Each ad page is opened.

## `sellerIds` (type: `array`):

User IDs from /s-bestandsliste.html?userId=... Outputs the seller profile plus all their ads.

## `category` (type: `string`):

e.g. 173, 'Smartphones', 'Handy & Telekom' or 'Autos'. Resolved via the site's category tree.

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

City or PLZ, e.g. 'Berlin' or '10115'. Resolved via the site's location suggestions.

## `radiusKm` (type: `integer`):

Only with a location. The site supports 0, 5, 10, 20, 30, 50, 100, 150 or 200 km; other values are rounded to the nearest one.

## `minPrice` (type: `integer`):

Minimum price in euros.

## `maxPrice` (type: `integer`):

Maximum price in euros.

## `sellerType` (type: `string`):

Private or commercial sellers.

## `adType` (type: `string`):

Offers, wanted ads or both.

## `shippingOnly` (type: `boolean`):

Only ads with 'Versand möglich'.

## `directBuyOnly` (type: `boolean`):

Only ads that can be bought directly.

## `sort` (type: `string`):

Result order. Monitoring mode always uses 'Newest'.

## `postedWithinDays` (type: `integer`):

0 = no limit. With sort=newest the crawl stops paginating once older ads appear.

## `excludeTopAds` (type: `boolean`):

TOP ads are promoted ads shown on every result page.

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

Maximum number of ads in the dataset for the whole run.

## `maxItemsPerQuery` (type: `integer`):

Maximum number of ads per keyword, search URL or seller.

## `bypassResultLimit` (type: `boolean`):

Kleinanzeigen shows max 1,250 results per search. When on, the search is split into price ranges automatically (only when you ask for more than 1,250 results).

## `includeDetails` (type: `boolean`):

Open each ad: full description, all attributes, all images, seller info. Charged as an extra event.

## `includeSellerRating` (type: `boolean`):

Seller rating (stars, reviews) and badges. Needs the ad page, so ad details are scraped too. Charged once per unique seller.

## `includeViewCount` (type: `boolean`):

Note: fetching the counter increments it by 1.

## `maxImages` (type: `integer`):

Full-size image URLs per ad (0 = none).

## `monitoringMode` (type: `boolean`):

Remembers seen ad IDs between runs (named key-value store) and outputs only new ones. Use with Schedules. The first run saves the current state as the baseline.

## `monitoringStoreName` (type: `string`):

Separate state per watch (lowercase letters, digits, dashes). Default is derived from the search input.

## `trackPriceChanges` (type: `boolean`):

Also output known ads whose price changed; the 'change' field tells new ads from price changes.

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

Residential proxies from Germany work best (the site is protected by Akamai).

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

Parallel requests (also the number of sticky proxy sessions).

## `maxRetries` (type: `integer`):

Retries per request on blocks or network errors (each on a fresh proxy session).

## Actor input object example

```json
{
  "searchQueries": [
    "iphone 13"
  ],
  "radiusKm": 0,
  "sellerType": "all",
  "adType": "offered",
  "shippingOnly": false,
  "directBuyOnly": false,
  "sort": "newest",
  "postedWithinDays": 0,
  "excludeTopAds": false,
  "maxItems": 100,
  "bypassResultLimit": true,
  "includeDetails": false,
  "includeSellerRating": false,
  "includeViewCount": false,
  "maxImages": 20,
  "monitoringMode": false,
  "trackPriceChanges": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "DE"
  },
  "maxConcurrency": 10,
  "maxRetries": 5
}
```

# Actor output Schema

## `overview` (type: `string`):

Ads with the main fields.

## `details` (type: `string`):

Ads with description, attributes, seller and rating.

## `sellers` (type: `string`):

Seller profiles (Sellers mode).

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

Per-query totals on site, scraped counts, split ranges and blocked requests.

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

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

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

```

## MCP server setup

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