A Telegram bot that scrapes Jumia, Konga and Jiji concurrently to find the cheapest product prices in Nigeria using Playwright and Llama 4
# Price Comparison Bot π€
A Telegram bot that autonomously scrapes Jumia, Konga, and Jiji in parallel
and uses an LLM to find you the cheapest price for any product in Nigeria.
## How it works
1. User sends `/start` in Telegram
2. Clicks the **Search Product** button
3. Types a product name (e.g. `crocs`, `iphone 14`, `standing fan`)
4. The bot concurrently scrapes all three platforms using Playwright
5. Raw scraped data is passed to Llama 4 via Groq API
6. The LLM extracts prices, compares them, and returns the cheapest option
## Tech Stack
- **python-telegram-bot** β Telegram bot framework
- **Playwright** β headless browser scraping with JavaScript rendering
- **LangChain + Groq** β LLM pipeline using Llama 4 Scout
- **asyncio TaskGroup** β concurrent scraping across all three platforms simultaneously
## Project Structure
Price-Comparison-Bot/
βββ darkseid.py # Telegram bot handlers and conversation flow
βββ scraper_agent.py # Playwright scraper + LangChain analysis pipeline
βββ .env.example # Environment variable template
βββ requirements.txt # Python dependencies
βββ README.md
## Setup
**1. Clone the repo**
```bash
git clone
github.com
cd Price-Comparison-Bot
```
**2. Install dependencies**
```bash
pip install -r requirements.txt
playwright install chromium
```
**3. Set up environment variables**
```bash
cp .env.example .env
```
Then edit `.env` and add your actual keys:
- `GROQ_API_KEY` β from console.groq.com
- `DARKSEID_API_TOKEN` β from @BotFather on Telegram
**4. Run the bot**
```bash
python darkseid.py
```
Or run the scraper directly from the CLI:
```bash
python scraper_agent.py "standing fan"
```
## Usage
| Command | Description |
|---|---|
| `/start` | Launch the bot and show the search button |
| `/cancel` | Cancel an active search |
## Notes
- Chromium must be installed on your system. On Arch/CachyOS: `sudo pacman -S chromium`
- Scraping takes 15β30 seconds per searc β¦