A Telegram chatbot that helps you set price alerts for amazon products. The bot checks the price of your watchlisted products every day and sends you an alert message when it reaches the target price. After adding a product to the watchlist you recieve a product price chart every 30 days until the product reaches its target price. It is deployed on Replit and developed using the pyTelegramBotAPI, ScraperAPI and Google Sheets API.
-
Telegram Bot API
The Bot API is an HTTP-based interface created for developers to build bots for Telegram.
-
ScraperAPI
This version of TrackrBot improves over the last one by using ScraperAPI which provides anti-bot detection and IP geolocation which helps scrape amazon without being blocked.
-
Google Sheets API
This API is used to record price changes for a product in Google Sheets which is used to create a product price chart every 30 days.
-
pyTelegramBotAPI
A simple, but extensible Python implementation for the Telegram Bot API.
* User sends a URL to the bot.
* Bot validates the URL and then sends it to ScraperAPI.
* ScraperAPI returns a response object which is then parsed using BeautifulSoup.
* Bot displays the product name and price then asks the user for a price alert.
* On success the details are added to the Replit Database which is a simple key value store.
* Checks if any new products are added to the Replit DB and then adds them to Google Sheets.
* Checks if any products are deleted from the Replit DB and then deletes them from Google Sheets.
* Scrapes amazon for every product in the Replit DB and updates the sheet with the current price.
* If current price <= target price it sends the user a price alert on telegram.
* If a product column has 30 price values on Google Sheets it sends a price chart to the user.
Contributions, issues and feature requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
- GitHub
-
Fork this repository on GitHub and clone it on your local machine.
$ git clone https://github.com/<your-username>/trackrBot.git
-
Create your Feature Branch (git checkout -b feature/AmazingFeature)
-
Commit your Changes (git commit -m 'Add some AmazingFeature')
-
Push to the Branch (git push origin feature/AmazingFeature)
-
Open a Pull Request
-
- Recommended: Replit
- Fork this project on Replit. This saves you the trouble of setting up the environment and installing the libraries.
Currently this project uses the free tier of ScraperAPI which only provides a 1000 requests a month. If you like this project consider making a donation at Buy Me a Coffee so I can buy the paid plan which costs $29.
Features I plan to add once I'm able to switch to the paid plan:
- Increasing the watchlist capacity from 3 to 30 products.
- Increasing the number of times the bot checks amazon for change in price of a product from 1 to 24 times a day.
- Making the price chart feature more customisable.