Amazon Price Monitor Telegram Bot manual
Set up and use the delivered Python program to add Amazon products and request price checks through your Telegram bot.
Who it is for: It is for people with basic command-line familiarity who want to manage a small private list of Amazon URLs via Telegram. You need to be able to install and keep a Python program running.
Setup time: First setup: approximately 20-40 minutes, excluding Telegram bot creation.
What it does
- Reads the Telegram token from the BOT_TOKEN variable and the chat ID from the CHAT_ID variable.
- Starts a polling Telegram bot when you run the Python file with valid configuration.
- Accepts the /add command with a URL containing /dp/ followed by a 10-character ASIN and a numeric threshold.
- Keeps an in-memory watchlist containing an ASIN, URL, generic name, threshold, and initially empty last price.
- Lists current watchlist entries with /list and deletes an ASIN with /remove.
- With /check, downloads each stored URL, looks for a price using the HTML selectors in the source code, and replies only for entries where it finds a price.
- The source-file header declares support for Amazon IT, DE, FR, ES, and UK; however, /add only checks the URL's /dp/ASIN pattern.
What it does not do
- It does not start the automatic hourly monitoring loop in the delivered version: monitor_loop is defined, but main does not call it.
- It does not save the watchlist to a file, database, or cloud service; entries disappear when the process restarts.
- It does not retrieve or use the actual Amazon product title for added entries: responses use the generic name Prodotto followed by the ASIN.
- It does not purchase products, manage carts, or guarantee that an extracted price is available, correct, or applicable to your account.
- It does not apply access control to Telegram commands; the code does not filter authorised users or chats.
Requirements
- Python 3 and pip: They are needed to create an isolated environment, install requirements.txt, and run telegram-bot-amazon-monitor.py.
- Terminal or shell: You need it to run installation commands, set variables, and start the program.
- Telegram account and Telegram bot: Create the bot with @BotFather using Telegram's standard procedure and keep its token private.
- BOT_TOKEN: This is the Telegram bot token. The program will not start if the placeholder value remains.
- CHAT_ID: This is your Telegram chat ID. The program requires it at startup even though the automatic loop is not started by the delivered file.
- Internet connection while using the bot: The bot uses Telegram polling and /check requests the stored URL's page. If you use hosting or an always-on device, check the relevant provider's pricing and terms.
Step-by-step setup
- Extract the archive into a dedicated folder. Download the purchased ZIP file and extract it. Keep the four delivered files together: README.md, README.en.md, requirements.txt, and telegram-bot-amazon-monitor.py. Do not look for a file to copy named .env.example: the README mentions it, but it is not included in the delivered archive.
- Choose the guide in your language. README.md is in Italian. README.en.md is in English. requirements.txt is a technical list with no reading language; telegram-bot-amazon-monitor.py contains Italian comments and user-facing Telegram messages.
- Check Python and open a terminal in the extracted folder. Open a terminal in the folder containing requirements.txt. Confirm that Python 3 is available before continuing.
- Create and activate a virtual environment. A virtual environment keeps the bot libraries separate from other Python installations. On Linux or macOS, run these commands from the extracted folder.
- Install the delivered dependencies. With the virtual environment active, install the included requirements.txt exactly as supplied. It declares python-telegram-bot, aiohttp, beautifulsoup4, lxml, and python-dotenv.
- Create the bot and obtain the two required values. Create a bot with @BotFather using Telegram's usual procedure and obtain its token. Obtain your chat ID as well; the delivered README points to @userinfobot for this. Never post a token in a public chat, ticket, or shared screenshot.
- Create the .env file manually. In the same folder as telegram-bot-amazon-monitor.py, create a plain-text file named .env. The program loads this file through python-dotenv when that library is installed. Replace the placeholders with your own values and do not publish them.
- Start the program. With .env in place and the virtual environment active, start the file. If BOT_TOKEN or CHAT_ID is missing or begins with the YOUR_ placeholder, the program stops before connecting and prints a configuration error.
- Add a product with a URL and threshold. Open your bot's Telegram chat. Send /add followed by an Amazon URL containing /dp/ and a 10-character ASIN, then a threshold using a decimal point. The program stores the entry only in the running process's memory.
- Run the first manual check. Send /check in the bot chat. The bot confirms that checking is under way and, for each entry where it can read a price, sends the price and threshold. If an entry has no price line, see Troubleshooting.
Daily use
Start the process whenever you need the bot
Run python3 telegram-bot-amazon-monitor.py with the virtual environment active. The process must remain running for the bot to receive polling commands.
Add only URLs in the recognised pattern
Use /add with a URL containing /dp/ followed by a 10-character uppercase-letter-or-number ASIN and a numeric threshold, such as 29.99.
Review the watchlist
Send /list to see added ASINs and thresholds. The list shows the generic name assigned by the program rather than the Amazon page title.
Request a check when you need one
Send /check to query the URLs in the watchlist. A price response is sent only when the HTTP request succeeds and one of the source-code selectors identifies a price.
Remove an item you no longer need
Send /remove followed by the ASIN shown in /list. The bot confirms removal if it finds that ASIN in the current watchlist.
Rebuild the list after a restart
Because the watchlist exists only in memory, add back the URLs you want to check after stopping or restarting the program.
Practical cases
Personal check for a wishlist item
You want to occasionally inspect an Amazon product's price without manually searching for the page each time.
- Start the program with BOT_TOKEN and CHAT_ID configured.
- Send /add with a URL in the /dp/ASIN pattern and a decimal-point threshold.
- Send /check whenever you want to refresh the check.
- Open the product page to verify the actual price and terms.
You receive in the bot chat the price the program can read for that URL and its comparison with the chosen threshold.
Small private list for one authorised person
You manage a few URLs for your own internal use and want product entries and thresholds in the same Telegram chat.
- Keep the bot and its chat private.
- Add each product with /add.
- Use /list to review current ASINs and thresholds.
- Use /remove to delete an item you no longer need.
- Add entries again after a process restart if you still want them in use.
You obtain a temporary in-memory watchlist managed through the four delivered commands.
Manual comparison of several URLs
You have a few products with valid URLs and want to request an update at the same time, without assuming that automatic alerts are active.
- Enter URLs with /add, one at a time.
- Use /list to confirm that the ASINs and thresholds are present.
- Send /check.
- Compare the responses received and verify the web pages before acting.
You obtain bot responses for the URLs for which the program can retrieve a price.
Technical verification after moving computers
You moved the four delivered files to another computer and want to verify that the environment and configuration work.
- Create a fresh virtual environment and install requirements.txt.
- Create .env again with your private values.
- Start the program and confirm that it does not display the configuration error.
- Add a valid test URL and send /check.
You obtain a practical check of startup, command handling, and the price-reading attempt without using example credentials.
Tips
- Keep BOT_TOKEN only in your .env file or your system's environment-variable manager; never put it in a README, screenshot, or public repository.
- Use the bot privately and do not share access with unauthorised people: the delivered code does not apply user or chat filters to commands.
- Before adding many entries, test one URL with /check and confirm that the bot can return a price.
- Use product URLs that clearly contain /dp/ and a 10-character ASIN; other patterns are rejected by /add.
- Write the threshold with a decimal point, for example 29.99, because the command converts the value using Python float.
- Keep important URLs and thresholds somewhere else too, because the program does not preserve the watchlist after a restart.
- Do not treat an extracted price as confirmation of stock, promotion, tax, delivery, or final price; always check the product page before making a decision.
- Use /check responsibly and comply with the queried website's terms of service, robots.txt, and request limits.
- Keep the Python environment current and reinstall the delivered dependencies when moving the project to another computer.
- If you choose an always-on server or Raspberry Pi, protect access to the device and check the provider's costs and terms where applicable.
Troubleshooting
The program prints ERRORE DI CONFIGURAZIONE at startup and exits.
BOT_TOKEN or CHAT_ID is absent, empty, or begins with the YOUR_ placeholder. Create or correct .env in the program folder with real BOT_TOKEN and CHAT_ID values, or set both system environment variables. Then restart the command.
The guide mentions .env.example, but the package does not contain it.
The delivered archive contains README.md, README.en.md, requirements.txt, and telegram-bot-amazon-monitor.py; .env.example was not delivered. Manually create a .env file in the same folder as the program and enter BOT_TOKEN and CHAT_ID, one variable per line.
Python says that telegram, aiohttp, bs4, dotenv, or another library is missing.
Dependencies were not installed into the Python interpreter used to start the program. Activate the virtual environment created for the project and rerun pip install -r requirements.txt before starting the file.
The bot says that the Amazon URL is invalid.
The /add command looks for /dp/ followed by a 10-character ASIN made of uppercase letters or digits. Use a product URL that explicitly contains /dp/<10_CHARACTER_ASIN> and send it as the first /add argument.
After /check, I receive the checking message but no price for a product.
The code sends no response for that entry if the HTTP request does not return status 200 or none of its price selectors finds a value on the page. Check that the URL normally opens, that the computer has a connection, and that the page format has not changed. Try again later without needlessly increasing requests.
The /add command does not work with a threshold written using a comma.
The program converts the second argument directly with float and does not handle a decimal comma or non-numeric text. Enter a number using a decimal point, for example 29.99.
After restarting the program, /list no longer shows products I added.
watchlist is an in-memory dictionary and the program does not implement persistent storage. Add the URLs again with /add after each restart, and keep a separate record of important URLs and thresholds.
No automatic alerts arrive after an hour.
monitor_loop contains a 3600-second wait, but the delivered main function does not start monitor_loop. In the delivered version, use /check for a manual check. Do not assume automatic alerts are active unless the program's behaviour has been changed and safely verified.
Another person can use the bot commands.
The command handlers do not check the Telegram user or the originating chat. Keep the bot's use private and do not share access. Do not use it for sensitive data or in situations requiring access control.
Limits to know
- The package provides no Telegram user-authentication system, so it is not suitable for open sharing or handling confidential data.
- The price is extracted from HTML using a small set of selectors; different pages, blocks, failed requests, or website changes can prevent a result.
- The displayed price and threshold are informational. They are not a guarantee of availability, discount, final price, sales terms, or economic value.
- The automatic alert loop is not started by the delivered file; the bot behaviour that can be used as delivered is manual checking through /check.
- The watchlist does not persist after the process stops or restarts.
- When querying websites, comply with terms of service, robots.txt, request limits, and applicable rules. Do not use the program to bypass blocks or restrictions.
- Do not publish tokens, chat IDs, or other personal data. If you use the bot for other people, provide a suitable privacy notice and do not collect passwords, card details, or unnecessary data.
Frequently asked questions
Which package files are Italian and which are English?
README.md is Italian and README.en.md is English. requirements.txt is a technical dependency list; telegram-bot-amazon-monitor.py has Italian code comments and bot messages.
Where is .env.example?
It is not present in the delivered archive despite being mentioned in the README. Create a .env file yourself in the program folder with BOT_TOKEN and CHAT_ID.
Which URL pattern does /add accept?
The code accepts a URL containing /dp/ followed by a 10-character uppercase-letter-or-number ASIN. The command does not explicitly validate the Amazon domain.
Does the bot really send automatic alerts?
The source contains a function for hourly checks and Telegram sends, but the main function does not start it. With the delivered file, use /check for manual checking.
Why does the list not show the product title?
When you add an entry, the program saves the name as Prodotto followed by the ASIN. A function that could read a page title is not called in the command flow.
Do I need to leave a computer switched on?
The Python process must be running to receive and handle commands. The README suggests an always-on server or Raspberry Pi, but check provider pricing and terms if you choose external infrastructure.