Skip to main content

kleinanzeigen

PyPI version Python PyPI downloads CI Ruff Checked with mypy License: MIT

Browse kleinanzeigen.de listings from Python, your terminal, or an AI assistant. Search by keyword, location, radius, and price, and fetch full ad details: price, seller, description, images, and status.

One package, three ways to use it:

What it is Use it for
Async client Kleinanzeigen, an asyncio Python library returning typed pydantic models Scripts, scrapers, alerts, data pipelines
CLI The kleinanzeigen command, with tables, live progress, and --json output Quick searches and shell scripting
MCP server The kleinanzeigen-mcp command, a stdio MCP server Letting Claude or other MCP clients search for you

All three share the same core: kleinanzeigen.de's Android JSON API over HTTPX. No browser, Selenium, Playwright, or account needed.

Installation

Requires Python 3.14 or later.

As a library in your project:

uv add kleinanzeigen    # or: pip install kleinanzeigen

As standalone kleinanzeigen and kleinanzeigen-mcp commands:

uv tool install kleinanzeigen    # or: pipx install kleinanzeigen

Async client

async with Kleinanzeigen() as ka:
    result = await ka.search(SearchParams(query="fahrrad", pages=2))
    for listing in result.listings:
        print(listing.title, listing.price, listing.url)

Kleinanzeigen returns frozen pydantic models (SearchResult, ListingDetail) and supports per-page iteration and a caller-owned HTTP session. See docs/library.md for the full API: methods, SearchParams, options, and error handling.

CLI

# Keyword search, all pages by default
kleinanzeigen search -q 'fahrrad' -l 'Berlin' --radius 5

# Limit to one category, by name or id
kleinanzeigen search -q 'velo' --category 'Fahrräder & Zubehör'

# Price range, first page only, as JSON
kleinanzeigen search -q 'iphone' --min-price 100 --max-price 500 --pages 1 --json

# Only listings published since a date
kleinanzeigen search -q 'sofa' -l 'Hamburg' --published-after 2026-11-01

# Full details for one ad, by ID or URL
kleinanzeigen get 123456789
Command Description
search Keyword search. Options: -q/--query (required), --category (id or name), -l/--location, --radius, --min-price, --max-price, --page, --pages (default 0 = all), --published-after, --json
categories [-q QUERY] List category IDs and paths for --category; -q filters by name or path; --json prints the same shape as the MCP tool
get URL_OR_ID Show price, location, seller, description, details, and image links. Exits with status 1 if the ad is gone

Searches show a live progress spinner and a results table with clickable titles in terminals that support links. With --json, the CLI prints the same JSON shape as the MCP server and shows no progress spinner, so output can go straight into jq.

Run kleinanzeigen --help or kleinanzeigen <command> --help to see every option.

MCP server

kleinanzeigen-mcp gives MCP clients (Claude Desktop, Claude Code, Cursor, and others) access to kleinanzeigen.de over the stdio transport. Once it is connected, you can ask things like "find used road bikes under 400 EUR within 10 km of Leipzig posted this week".

After installing the commands (uv tool install kleinanzeigen), add the server to your client config:

{
  "mcpServers": {
    "kleinanzeigen": {
      "command": "kleinanzeigen-mcp"
    }
  }
}

Or run it with uvx, without installing it first:

{
  "mcpServers": {
    "kleinanzeigen": {
      "command": "uvx",
      "args": ["--from", "kleinanzeigen", "kleinanzeigen-mcp"]
    }
  }
}

Tools

Tool Description Returns
search Keyword search; query is required, category optionally limits to one category (id or German name) Search response
list_categories Category IDs and paths; query filters by name or path, empty lists the full tree List of Category (id, name, parent_id, path)
get_listing Full details for one ad by URL or ID (url_or_id) ListingDetail, or {"error": "listing not found or removed"}

Development

uv sync                 # set up .venv
uv run pytest           # offline API mapping and CLI tests
pre-commit run -a       # ruff lint and format

Run the CLI from the checkout:

uv run kleinanzeigen search -q 'fahrrad' --pages 1

The included .mcp.json registers a kleinanzeigen-dev server that runs uv run kleinanzeigen-mcp. MCP clients that support project-level config can load it straight from this checkout.

The CLI demo GIF in assets/ is recorded with vhs; regenerate it with vhs assets/cli-demo.tape from the repo root.

Acknowledgements

Based on ebay-kleinanzeigen-api, adapted to work without a browser.

Metadata

Release files for kleinanzeigen 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kleinanzeigen 0.4.0
File Size Uploaded Provenance Actions
kleinanzeigen-0.4.0.tar.gz 68.5 kB With provenance Details for kleinanzeigen-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kleinanzeigen 0.4.0
File Interpreter ABI Platform Actions
kleinanzeigen-0.4.0-py3-none-any.whl Python 3 none any Details for kleinanzeigen-0.4.0-py3-none-any.whl

Total release size: 91.1 kB

Release files / kleinanzeigen-0.4.0.tar.gz

Download URL kleinanzeigen-0.4.0.tar.gz
Size 68.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7f7ab83fe688f85225ffce49409672f1cb3cfb414f3360a80f20175de2ccb05b
BLAKE2b-256 checksum
How to use checksums
f976eabd3e732d3aaf4d7eba29c2113c58ee02cc4a9064cbf05a7cc90dd01c86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / kleinanzeigen-0.4.0-py3-none-any.whl

Download URL kleinanzeigen-0.4.0-py3-none-any.whl
Size 22.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3b3b60566fc3c925476148463782602c66ab3cc135258c18e4b666b8e91a0213
BLAKE2b-256 checksum
How to use checksums
8136474c0a65ad8bc8d065f773f88c607e0ac223ebe3df33ee9932578eccdda4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Security for kleinanzeigen 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for kleinanzeigen-0.4.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page