Skip to content

Latest commit

Β 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›’ ShopBot β€” Multi-Platform Stock Tracker

Real-time stock & price monitoring for Flipkart and Amazon β€” with Telegram alerts and a live web dashboard.

Live Web App: satiricalguru.github.io/ShopBot

Python FastAPI Playwright License


✨ Features

Feature Description
Multi-platform Supports Flipkart and Amazon product URLs
Instant Check Paste any URL and get stock status in seconds
Price Extraction Automatically extracts the current selling price
Watchlist Add products to monitor continuously in the background
Real-time Updates WebSocket-powered live status β€” no refresh needed
Check History Log of all checks with timestamps and prices
Telegram Alerts Get notified the moment a product comes back in stock
Pincode Delivery Check Flipkart deliverability for a specific pincode
Modern UI Dark luxury-tech design, fully responsive

πŸš€ Quick Start

git clone https://github.com/satiricalguru/ShopBot.git
cd ShopBot
chmod +x start.sh
./start.sh

Then open http://localhost:8000 in your browser.


Screenshots

image

πŸ“ Project Structure

ShopBot/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ app.py              # FastAPI server (REST + WebSocket)
β”‚   β”œβ”€β”€ monitor.py          # Platform router (Flipkart + Amazon)
β”‚   β”œβ”€β”€ amazon_monitor.py   # Amazon scraper
β”‚   β”œβ”€β”€ notifier.py         # Telegram notification handler
β”‚   └── requirements.txt
β”œβ”€β”€ frontend/
β”‚   └── index.html          # Single-page web app (no build step)
β”œβ”€β”€ .env.example            # Environment variable template
β”œβ”€β”€ .gitignore
β”œβ”€β”€ start.sh                # One-command launcher
└── README.md

βš™οΈ Configuration

Telegram Notifications (optional)

No .env editing needed. Open the app at http://localhost:8000, click βš™οΈ Settings, and paste your credentials there. They are saved permanently to settings.json (gitignored) and survive server restarts.

Field Where to get it
Bot Token Message @BotFather β†’ /newbot β†’ copy the token
Chat ID Message your bot, then visit https://api.telegram.org/bot<TOKEN>/getUpdates

Telegram is optional. The app works without it β€” you just won't receive push notifications.

Static Hosting & Custom Backend

If you are using the live GitHub Pages app at satiricalguru.github.io/ShopBot or any static server, you will need to point the frontend to your running backend:

  1. Open the app and click the βš™οΈ Settings icon in the top header.
  2. Under Server Connection, set the Backend API URL to your deployed backend instance (e.g. https://your-backend.onrender.com or http://localhost:8000 if running the backend locally).
  3. Click Save Settings. The app will reload and establish connection with your custom server automatically.

The only thing in .env is the default check interval:

CHECK_INTERVAL=30

πŸ›  Manual Setup

If you prefer not to use start.sh:

python3 -m venv venv
source venv/bin/activate        # Windows: venv\Scripts\activate
pip install -r backend/requirements.txt
playwright install chromium
cp .env.example .env            # Only needed to customise CHECK_INTERVAL
cd backend
uvicorn app:app --reload --port 8000

Then open http://localhost:8000 and add your Telegram credentials via βš™οΈ Settings.


πŸ” How It Works

  1. Playwright (headless Chromium) navigates to the product page
  2. For Flipkart: checks for "Add to Cart" / "Buy Now" buttons (in-stock) and "Notify Me" / "Sold Out" text (out-of-stock). Optionally checks pincode-level deliverability.
  3. For Amazon: reads the #availability span and checks for #add-to-cart-button visibility
  4. Results β€” including price, image, and platform β€” are returned over HTTP + WebSocket
  5. If the product is in stock and Telegram is configured, an alert is sent immediately with the platform name

⚠️ Notes

  • Amazon anti-bot: Amazon aggressively blocks headless browsers. Checks may occasionally fail with a CAPTCHA notice β€” this is expected. Reduce watchlist frequency or use it for one-off checks.
  • Credentials: Telegram token and chat ID are entered via the Settings UI and saved to settings.json (gitignored). They are never stored in .env or committed to git.
  • CORS: allow_origins=["*"] is set for local development. Restrict this if you deploy the backend publicly.
  • Data persistence: watchlist and history are in-memory and reset on server restart. Settings (credentials + interval) persist across restarts via settings.json.

πŸ—Ί Roadmap

  • Persistent watchlist (SQLite / JSON)
  • Meesho support
  • Browser extension mode
  • Price history chart

πŸ“ License

MIT β€” see LICENSE

Developed by Satirical Guru , Claude & Antigravity .


About

ShopBot is a real-time stock and price tracker for Flipkart and Amazon πŸ›’βš‘ Featuring a sleek dark-themed dashboard, it helps you monitor availability, track price changes, and receive instant Telegram alerts when products come back in stock or prices drop.

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages