Overview
The Price Tracker Bot is a Telegram bot that monitors Amazon product prices and sends you notifications when prices drop. This guide will help you get the bot running and tracking your first product./newbotYour bot token looks like this:
123456789:ABCdefGhIjKlmNoPQRsTUVwxyZKeep it secret! Anyone with this token can control your bot.node-telegram-bot-api - Telegram bot integrationplaywright - Web scraping enginenode-cron - Automated price checkingdotenv - Environment configurationPlaywright will download Chromium browser (~100MB) during installation. This is normal and required for price scraping.
🤖 ¡Hola! Soy tu bot rastreador de precios.
*Comandos:*
📦 /add [url] - Añadir producto
🔍 /check - Revisar precios ahora
📝 /list - Ver productos en seguimiento
🗑️ /remove [url] - Eliminar producto
✏️ /edit [url_actual] [url_nueva] - Actualizar URL del producto
📊 /stats - Ver estadísticas
📈 /chart [url] - Ver gráfico del historial
❓ /help - Mostrar ayuda
prices.jsonThe bot sanitizes URLs by removing tracking parameters and query strings. It stores products by their clean URL (e.g.,
https://www.amazon.com/dp/B08N5WRWNW).How Price Monitoring Works
Once you’ve added products, the bot automatically:Every 2 Hours
Checks all tracked products for price changes using the automated cron job defined in
index.mjs:732Daily at 20:00
Sends you a summary of all tracked products with interactive buttons to view details
Instant Alerts
Notifies you immediately when any product’s price drops below its previous recorded price
Price History
Stores up to 120 price points per product for historical analysis and charting
Example: Price Drop Notification
When a price drops, you’ll receive:Quick Commands Reference
| Command | Description | Example |
|---|---|---|
/add [url] | Track a new product | /add https://amazon.com/dp/B08N5WRWNW |
/list | View all tracked products | /list |
/check | Force price check now | /check |
/remove [url] | Stop tracking a product | /remove https://amazon.com/dp/B08N5WRWNW |
/stats | View tracking statistics | /stats |
/chart [url] | View price history chart | /chart https://amazon.com/dp/B08N5WRWNW |
Data Storage
The bot stores all data inprices.json in the project root:
Next Steps
Installation Details
Learn about system requirements and advanced configuration
View Source Code
Explore the code on GitHub
Troubleshooting
Bot doesn't respond to commands
Bot doesn't respond to commands
Make sure:
- The bot is running (
npm startin terminal) - You sent
/startto register your chat - The
TELEGRAM_TOKENis correct in.env
Error: TELEGRAM_TOKEN not defined
Error: TELEGRAM_TOKEN not defined
You need to create a Then restart the bot.
.env file with your bot token:Product scraping fails
Product scraping fails
This can happen if:
- Amazon changed their page structure
- The URL is invalid
- Network/firewall blocking Playwright
index.mjs:80-109.Chromium download fails during install
Chromium download fails during install
Playwright needs to download Chromium. If it fails: