This is a bot that scrapes new entries on Kleinanzeigen and/or WG Gesucht and sends notifications via Telegram when there is a new entry. It helps you stay updated on new listings for any search query you want. I primarily used it to find new listings for apartments and shared flats and thats why wg-gesucht is also supported, but you can just use it as a Kleinazeigen bot if you want.
To use this bot, follow these steps:
- Clone the repository:
git clone https://github.com/JeremieSiller/kleinanzeigen_bot.git
- Install the dependencies using Poetry:
poetry install
- rename the
example.env
file to.env
. - Obtain a Telegram Bot token from BotFather and add it to the
.env
file underTELEGRAM_TOKEN
. - Add the url you want to scrape to the
.env
file underKLEINANZEIGEN_URL
andWG_GESUCHT_URL
(e.g.https://www.kleinanzeigen.de/s-berlin/anzeige:angebote/hertha-tickets/k0l3331
). - If you don't want to use WG Gesucht, set
WG_GESUCHT_URL
to""
. - create file to keep chats persistent:
touch chats.ids
and set the IDS_FILE_NAME variable in the.env
file to the name of the file you created (e.g.chats.ids
) - Run the bot:
poetry run python main.py
- send
/start
to your bot and it will start scraping the urls you provided and send you a message with the new listings.
- if you want to use certain filters, just add them on kleinanzeigen/wg-gesucht and copy the new url to the
.env
file.
Alternatively, you can use Docker to run the bot:
- Build the Docker image:
docker build -t telegram-scraper .
- Run the Docker container:
docker run telegram-scraper
This project is licensed under the MIT License.
This project was created as a learning experience and is not intended for production use. It is not affiliated with Kleinanzeigen or WG Gesucht.