# Kleinanzeigen Scraper — Germany, Numeric Price Parsed (`axery/kleinanzeigen-search-scraper`) Actor

Scrape Kleinanzeigen.de classified ads with numeric price parsed from German number format, negotiable/giveaway flags, and split postal-code-plus-city location.

- **URL**: https://apify.com/axery/kleinanzeigen-search-scraper.md
- **Developed by:** [Axery](https://apify.com/axery) (community)
- **Categories:** E-commerce, Automation, Integrations
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.01 / 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?

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

## Kleinanzeigen Search Scraper (Germany)

Scrapes classified ads from **kleinanzeigen.de** over plain HTTP — no browser, no login. The search results page has no JSON endpoint, and its JSON-LD covers only image metadata — not price, title, or location — so this Actor parses the HTML ad cards directly.

### German number format, handled correctly

Price is displayed like `"900 € VB"` — German convention, where a **dot is a thousands separator and a comma is the decimal point**, the reverse of English. A naive parse would turn `"1.500 €"` into 1.5 instead of 1500. This Actor gets the convention right and additionally recognizes two markers sellers commonly add:

```json
"price": {
  "amount": 900.0, "currency": "EUR",
  "is_negotiable": true, "is_giveaway": false,
  "raw": "900 € VB"
}
```

- `is_negotiable` — the `VB` (*Verhandlungsbasis*, "starting point for negotiation") suffix.
- `is_giveaway` — `"zu verschenken"` listings, which carry no amount at all.

### Location, split

The card shows `"85221 Dachau"` as one string. This Actor splits it:

```json
"location": { "raw": "85221 Dachau", "postal_code": "85221", "city": "Dachau" }
```

### No free-text search parameter — Kleinanzeigen routes by URL path

Like several other targets in this suite, there's no `?q=` alone. Browse kleinanzeigen.de, run the search you want, and copy the path segment:

```json
{ "categoryPaths": ["s-fahrrad/k0", "s-berlin/s-wohnung-mieten/k0l3331"] }
```

The second example shows the site's own combined keyword+location+category paths — anything you can build by searching on the site works here.

### Input

| Field | Type | Notes |
|---|---|---|
| `categoryPaths` | array | Kleinanzeigen URL path segments. |
| `maxItems` | integer | Per path. `0` = unlimited, bounded by pagination depth. |
| `incremental` | boolean | Only ads not seen in previous runs. |
| `proxyConfiguration` | object | Datacenter is normally enough — no anti-bot layer encountered. |

### Known limits

- **Card data only, no full listing page.** Title, a short description snippet, price, location and the lead image — not the full ad body or seller contact details. A second-tier "detail" Actor could add that with a per-ad fetch, following the same pattern as Bayt in this suite.
- **No structured category taxonomy in the output.** Kleinanzeigen encodes category in the URL path you provide, not in the card itself.
- **Price parsing assumes German formatting.** If Kleinanzeigen ever serves a locale variant with different number conventions, this parser would need adjusting.

### Local development

```bash
pip install -r requirements.txt
python test_local.py "s-fahrrad/k0" --max 20 --out sample_output.json
python test_local.py "s-berlin/s-wohnung-mieten/k0l3331" --max 10
```

`sample_output.json` in this folder is real output from a live run, kept so the schema can be reviewed without running anything.

# Actor input Schema

## `categoryPaths` (type: `array`):

Kleinanzeigen routes searches through URL paths. Browse kleinanzeigen.de, run the search or category you want, and copy the path after kleinanzeigen.de/ - for example 's-fahrrad/k0' for bicycles, or 's-berlin/s-wohnung-mieten/k0l3331' for a keyword-plus-location-plus-category combination the site already built for you.

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

Maximum ads to return per category path. Set to 0 for unlimited, bounded by Kleinanzeigen's own pagination depth.

## `incremental` (type: `boolean`):

Remember ad ids between runs and return only ads not seen before. You are charged only for the new rows. Ids are stored in this Actor's key-value store under seen\_ad\_ids.

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

Apify Proxy settings. Defaults to Residential - classifieds sites in this category showed real IP-reputation sensitivity during testing.

## Actor input object example

```json
{
  "categoryPaths": [
    "s-fahrrad/k0"
  ],
  "maxItems": 100,
  "incremental": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

One row per classified ad.

## `coverage` (type: `string`):

What the run asked for versus what it returned.

# 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 = {
    "categoryPaths": [
        "s-fahrrad/k0"
    ],
    "maxItems": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("axery/kleinanzeigen-search-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 = {
    "categoryPaths": ["s-fahrrad/k0"],
    "maxItems": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("axery/kleinanzeigen-search-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 '{
  "categoryPaths": [
    "s-fahrrad/k0"
  ],
  "maxItems": 100
}' |
apify call axery/kleinanzeigen-search-scraper --silent --output-dataset

```

## MCP server setup

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