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

# 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), -l/--location, --radius, --min-price, --max-price, --page, --pages (default 0 = all), --published-after, --json
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 Search response
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.3.1

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.3.1
File Size Uploaded Provenance Actions
kleinanzeigen-0.3.1.tar.gz 65.8 kB With provenance Details for kleinanzeigen-0.3.1.tar.gz

Built distribution (wheel)

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

Total release size: 86.4 kB

Release files / kleinanzeigen-0.3.1.tar.gz

Download URL kleinanzeigen-0.3.1.tar.gz
Size 65.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2ebdb1736295911d962491a742a391ccf5cfb2403c2a47dbf09ae4cc4a3595ba
BLAKE2b-256 checksum
How to use checksums
a72979850fa65d65ffb00903e7a27d2543bc4742439ee436a90bef7daa70c83a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 14, 2026.

Transparency log

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

Download URL kleinanzeigen-0.3.1-py3-none-any.whl
Size 20.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
37e012bbbd79b2b710055ad9faca9262eb2019f6fd20c50f75f3175a5ea52f4b
BLAKE2b-256 checksum
How to use checksums
e002d4ace2587d2052bd64012449ce9004d3c975e6b5aa78df78144fc05c8100
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 14, 2026.

Transparency log

Security for kleinanzeigen 0.3.1

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.3.1.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 14, 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