Feedback and high-quality pull requests are highly welcome!
kleinanzeigen-bot is a command-line application to publish, update, delete, and republish listings on kleinanzeigen.de.
- Automated Publishing: Publish new listings from YAML/JSON configuration files
- Smart Republishing: Automatically republish listings at configurable intervals to keep them at the top of search results
- Bulk Management: Update or delete multiple listings at once
- Download Listings: Download existing listings from your profile to local configuration files
- Extend Listings: Extend ads close to expiry to keep watchers/savers and preserve the monthly ad quota
- Browser Automation: Uses Chromium-based browsers (Chrome, Edge, Chromium) for reliable automation
- Flexible Configuration: Configure defaults once, override per listing as needed
The use of this program could violate the terms of service of kleinanzeigen.de applicable at the time of use. It is your responsibility to ensure the legal compliance of its use. The developers assume no liability for any damages or legal consequences. Use is at your own risk. Any unlawful use is strictly prohibited.
Die Verwendung dieses Programms kann unter Umständen gegen die zum jeweiligen Zeitpunkt bei kleinanzeigen.de geltenden Nutzungsbedingungen verstoßen. Es liegt in Ihrer Verantwortung, die rechtliche Zulässigkeit der Nutzung dieses Programms zu prüfen. Die Entwickler übernehmen keinerlei Haftung für mögliche Schäden oder rechtliche Konsequenzen. Die Nutzung erfolgt auf eigenes Risiko. Jede rechtswidrige Verwendung ist untersagt.
-
The following components need to be installed:
- Chromium, Google Chrome, or Chromium-based Microsoft Edge browser
-
Open a command/terminal window
-
Download and run the app by entering the following commands:
-
On Windows:
curl -L https://github.com/Second-Hand-Friends/kleinanzeigen-bot/releases/download/latest/kleinanzeigen-bot-windows-amd64.exe -o kleinanzeigen-bot.exe kleinanzeigen-bot --help
-
On Linux:
curl -L https://github.com/Second-Hand-Friends/kleinanzeigen-bot/releases/download/latest/kleinanzeigen-bot-linux-amd64 -o kleinanzeigen-bot chmod 755 kleinanzeigen-bot ./kleinanzeigen-bot --help
-
On macOS:
curl -L https://github.com/Second-Hand-Friends/kleinanzeigen-bot/releases/download/latest/kleinanzeigen-bot-darwin-amd64 -o kleinanzeigen-bot chmod 755 kleinanzeigen-bot ./kleinanzeigen-bot --help
-
- The following components need to be installed:
- Docker
- Bash (on Windows e.g. via Cygwin, MSys2 or git)
- X11 - X Window System display server (on Windows e.g. Portable-X-Server)
Running the docker image:
-
Ensure the X11 Server is running
-
Run the docker image:
X11_DISPLAY=192.168.50.34:0.0 # replace with IP address of workstation where X11 server is running DATA_DIR=/var/opt/data/kleinanzeigen-bot # path to config # /mnt/data is the container's default working directory docker run --rm --interactive --tty \ --shm-size=256m \ -e DISPLAY=$X11_DISPLAY \ -v $DATA_DIR:/mnt/data \ ghcr.io/second-hand-friends/kleinanzeigen-bot \ --help
-
The following components need to be installed:
- Chromium, Google Chrome, or Chromium-based Microsoft Edge browser
- Python 3.10 or newer
- pip
- git client
-
Open a command/terminal window
-
Clone the repo using
git clone https://github.com/Second-Hand-Friends/kleinanzeigen-bot/
-
Change into the directory:
cd kleinanzeigen-bot -
Install the Python dependencies using:
pip install pdm pdm install
-
Run the app:
pdm run app --help
-
The following components need to be installed:
- Docker
- git client
- Bash (on Windows e.g. via Cygwin, MSys2 or git)
- X11 - X Window System display server (on Windows e.g. Portable-X-Server)
-
Clone the repo using
git clone https://github.com/Second-Hand-Friends/kleinanzeigen-bot/
-
Open the cloned directory in a Bash terminal window and navigate to the docker subdirectory
-
Execute
bash build-image.sh -
Ensure the image is built:
$ docker image ls REPOSITORY TAG IMAGE ID CREATED SIZE second-hand-friends/kleinanzeigen-bot latest c31fd256eeea 1 minute ago 590MB python 3-slim 2052f0475488 5 days ago 123MB
Running the docker image:
-
Ensure the X11 Server is running
-
Run the docker image:
X11_DISPLAY=192.168.50.34:0.0 # replace with IP address of workstation where X11 server is running DATA_DIR=/var/opt/data/kleinanzeigen-bot # path to config # /mnt/data is the container's default working directory docker run --rm --interactive --tty \ --shm-size=256m \ -e DISPLAY=$X11_DISPLAY \ -v $DATA_DIR:/mnt/data \ second-hand-friends/kleinanzeigen-bot \ --help
Usage: kleinanzeigen-bot COMMAND [OPTIONS]
Commands:
publish - (re-)publishes ads
verify - verifies the configuration files
delete - deletes ads
update - updates published ads
download - downloads one or multiple ads
extend - extends active ads that expire soon (keeps watchers/savers and does not count towards the monthly ad quota)
update-check - checks for available updates
update-content-hash – recalculates each ad's content_hash based on the current ad_defaults;
use this after changing config.yaml/ad_defaults to avoid every ad being marked "changed" and republished
create-config - creates a new default configuration file if one does not exist
diagnose - diagnoses browser connection issues and shows troubleshooting information
--
help - displays this help (default command)
version - displays the application version
Options:
--ads=all|due|new|changed|<id(s)> (publish) - specifies which ads to (re-)publish (DEFAULT: due)
Possible values:
* all: (re-)publish all ads ignoring republication_interval
* due: publish all new ads and republish ads according the republication_interval
* new: only publish new ads (i.e. ads that have no id in the config file)
* changed: only publish ads that have been modified since last publication
* <id(s)>: provide one or several ads by ID to (re-)publish, like e.g. "--ads=1,2,3" ignoring republication_interval
* Combinations: You can combine multiple selectors with commas, e.g. "--ads=changed,due" to publish both changed and due ads
--ads=all|new|<id(s)> (download) - specifies which ads to download (DEFAULT: new)
Possible values:
* all: downloads all ads from your profile
* new: downloads ads from your profile that are not locally saved yet
* <id(s)>: provide one or several ads by ID to download, like e.g. "--ads=1,2,3"
--ads=all|<id(s)> (extend) - specifies which ads to extend (DEFAULT: all)
Possible values:
* all: extend all eligible ads in your profile
* <id(s)>: provide one or several ads by ID to extend, like e.g. "--ads=1,2,3"
* Note: kleinanzeigen.de only allows extending ads within 8 days of expiry; ads outside this window are skipped.
--ads=changed|<id(s)> (update) - specifies which ads to update (DEFAULT: changed)
Possible values:
* changed: only update ads that have been modified since last publication
* <id(s)>: provide one or several ads by ID to update, like e.g. "--ads=1,2,3"
--force - alias for '--ads=all'
--keep-old - don't delete old ads on republication
--config=<PATH> - path to the config YAML or JSON file (DEFAULT: ./config.yaml)
--logfile=<PATH> - path to the logfile (DEFAULT: ./kleinanzeigen-bot.log)
--lang=en|de - display language (STANDARD: system language if supported, otherwise English)
-v, --verbose - enables verbose output - only useful when troubleshooting issuesNote: The output of
kleinanzeigen-bot helpis always the most up-to-date reference for available commands and options.
Limitation of download: It's only possible to extract the cheapest given shipping option.
All configuration files can be in YAML or JSON format.
On first run, the app may ask which installation mode to use. In non-interactive environments (CI/headless), it defaults to portable mode and will not prompt.
The --config and --logfile flags override only their specific paths. They do not change the chosen installation mode or other mode-dependent paths (downloads, state files, etc.).
-
Portable mode (recommended for most users, especially on Windows):
- Stores config, logs, downloads, and state in the current directory
- No admin permissions required
- Easy backup/migration; works from USB drives
-
System-wide mode (advanced users / multi-user setups):
- Stores files in OS-standard locations
- Cleaner directory structure; better separation from working directory
- Requires proper permissions for user data directories
OS notes (brief):
- Windows: System-wide uses AppData (Roaming/Local); portable keeps everything beside the
.exe. - Linux: System-wide follows XDG Base Directory spec; portable stays in the current working directory.
- macOS: System-wide uses
~/Library/Application Support/kleinanzeigen-bot(and related dirs); portable stays in the current directory.
The main configuration file (config.yaml) is required to run the bot. It contains your login credentials and controls all bot behavior.
Quick start:
# Generate a config file with all defaults
kleinanzeigen-bot create-config
# Or specify a custom location
kleinanzeigen-bot --config /path/to/config.yaml publishMinimal config.yaml:
# yaml-language-server: $schema=https://raw.githubusercontent.com/Second-Hand-Friends/kleinanzeigen-bot/main/schemas/config.schema.json
login:
username: "your_username"
password: "your_password"📖 Complete Configuration Reference →
Full documentation including timeout tuning, browser settings, ad defaults, diagnostics, and all available options.
Each ad is defined in a separate YAML/JSON file (default pattern: ad_*.yaml). These files specify the title, description, price, category, images, and other ad-specific settings.
Quick example (ad_laptop.yaml):
# yaml-language-server: $schema=https://raw.githubusercontent.com/Second-Hand-Friends/kleinanzeigen-bot/main/schemas/ad.schema.json
active: true
title: "Gaming Laptop - RTX 3060"
description: |
Powerful gaming laptop in excellent condition.
Includes original box and charger.
category: "Elektronik > Notebooks"
price: 450
price_type: NEGOTIABLE
images:
- "laptop/*.jpg" # Relative to ad file location (or use absolute paths); glob patterns supported📖 Complete Ad Configuration Reference →
Full documentation including automatic price reduction, shipping options, category IDs, and special attributes.
By default a new browser process will be launched. To reuse a manually launched browser window/process, you can enable remote debugging. This is useful for debugging or when you want to keep your browser session open.
For detailed instructions on setting up remote debugging with Chrome 136+ security requirements, see Browser Troubleshooting - Using an Existing Browser Window.
If you encounter browser connection problems, the bot includes a diagnostic command to help identify issues:
For binary users:
kleinanzeigen-bot diagnoseFor source users:
pdm run app diagnoseThis command will check your browser setup and provide troubleshooting information. For detailed solutions to common browser connection issues, see the Browser Connection Troubleshooting Guide.
Please read CONTRIBUTING.md before contributing code. Thank you!
- DanielWTE/ebay-kleinanzeigen-api (Python) API interface to get random listings from kleinanzeigen.de
- f-rolf/ebaykleinanzeiger (Python) Discord bot that watches search results
- r-unruh/kleinanzeigen-filter (JavaScript) Chrome extension that filters out unwanted results from searches on kleinanzeigen.de
- simonsagstetter/Feinanzeigen (JavaScript) Chrome extension that improves search on kleinanzeigen.de
- Superschnizel/Kleinanzeigen-Telegram-Bot (Python) Telegram bot to scrape kleinanzeigen.de
- tillvogt/KleinanzeigenScraper (Python) Webscraper which stores scraped info from kleinanzeigen.de in an SQL database
- TLINDEN/Kleingebäck (Go) kleinanzeigen.de Backup
All files in this repository are released under the GNU Affero General Public License v3.0 or later.
Individual files contain the following tag instead of the full license text:
SPDX-License-Identifier: AGPL-3.0-or-later
This enables machine processing of license information based on the SPDX License Identifiers that are available here: https://spdx.org/licenses/.