KleinSniper is a Rust-based marketplace analyzer that scrapes Kleinanzeigen.de for interesting offers, detects price anomalies, and sends Telegram notifications about deals.
- 🔍 Scrapes all pages of Kleinanzeigen search results
- 💰 Calculates average price and standard deviation
- 📉 Detects underpriced items based on configurable thresholds
- 📦 Normalizes offer models by keywords
- 📊 Saves offer statistics to SQLite
- 📬 Sends alerts via Telegram bot
- ⚙️ Configurable via
config.json - 🗑 Automatically removes outdated or deleted offers from the database
- Loads your search configuration from
config.json - Periodically scrapes the search result pages for each configured model
- Filters offers by price range and keywords
- Computes average price & standard deviation for each model
- Compares each offer to model stats — if a deal is found:
- sends notification via Telegram
- saves to database and marks as notified
- Prunes offers that no longer exist on the marketplace
- Rust (stable)
- Telegram bot token and chat ID
- Kleinanzeigen search knowledge 😎
Edit the config.json:
{
"telegram_bot_token": "your-bot-token",
"telegram_chat_id": 123456789,
"check_interval_seconds": 60,
"models": [
{
"query": "rog ally",
"category_id": "k0",
"deviation_threshold": 0.2,
"min_price_delta": 100,
"min_price": 240,
"max_price": 800,
"match_keywords": ["z1 extreme", "extreme"]
},
{
"query": "rog ally",
"category_id": "k0",
"deviation_threshold": 0.2,
"min_price_delta": 100,
"min_price": 200,
"max_price": 800,
"match_keywords": ["z1"]
}
]
}deviation_threshold— percent below average price to trigger notificationmin_price_delta— absolute price delta below average to trigger notificationmatch_keywords— filters only offers containing these words
Once the bot is running, send these commands:
/ping– check bot status/status– show system status/last– show last offer/top5– show top 5 cheapest offers/avg– show average prices per model/refresh– manually trigger scraping/uptime– show uptime/help– show commands list/config– show cconfig
├── main.rs
├── config/ # config loader and model configs
├── scraper/ # HTML fetcher (with pagination handling)
├── parser/ # Extracts offer details from HTML
├── analyzer/ # Computes statistics, detects deals
├── normalizer/ # Normalizes model titles based on keywords
├── notifier/ # Telegram integration
└── storage/ # SQLite logic (offers, stats, notified)
git clone https://github.com/yourname/klein-sniper
cd klein-sniper
cargo run --releaseMake sure
config.jsonis in the root directory.
Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) – You may use, share, and adapt the code for non-commercial purposes as long as you provide attribution. See the LICENSE file for more details.