Companion code for a YouTube video showing how to track amazon product prices with HasData HasData Amazon Products API.
Tutorial project: Track prices for amazon products. Save data as a CSV file, then send a notification to the user when the product becomes cheap enough to purchase.
This repository runs main.py to do the following:
- Read the settings files, where user inputs the products to track
- Uses HasData Amazon Scraper to find the product prices the user wants to track.
- Saves the results in the repo output/product_data.csv
- Sends a notification if the price drops below a threshold defined by the settings/price_threshold.txt.
- Repeats the scan every hour.
pip install -r requirements.txtCreate .env
HASDATA_API_KEY=your_api_key_here
BOT_TOKEN=telegram_bot_token
BOT_CHAT_ID=telegram_chat_idRun the main file:
python src/main.pyRead Input from Settings folder
|
v
Scrape all amazon products listed in settings
|
v
Save their price in output/product_data.csv
|
v
If the price drops below a pre-defined threshold, alert the user on Telegram
|
v
Check price changes every hour
extract-emails-from-google-search/
|-- assets/
|-- banner.png
|-- youtube-preview.png
|-- output/
|-- product_data.csv
|-- settings/
|-- price_threshold.txt
|-- shipping_location.txt
|-- target_asins.txt
|-- src/
|-- __init__.py
|-- api.py
|-- main.py
|-- telegram_bot.py
|-- utils.py
|-- .env
|-- .gitignore
|-- LICENSE
|-- README.md
|-- requirements.txt
- Python 3.10+
- A HasData API key
- Telegram BOT ID (optional)
- Telegram CHAT ID (optional)
Install dependencies:
pip install -r requirements.txtCreate .env in the project root,
HASDATA_API_KEY=your_api_key_here
BOT_TOKEN=telegram_bot_token
BOT_CHAT_ID=telegram_chat_idThe scripts load this variable automatically with python-dotenv.
- Results depend on what Amazon expose at request time.
- API usage depends on your HasData account and quota.
- Telegram Bot might not have 100% uptime.
This project is meant to be extra material for a YouTube tutorial, and for anyone to copy change the settings and use it for themselves.
- Market tracking
- Price changes report
- Tutorial material for building a brand monitoring tool
- Notifying when prices drop
This project is licensed under the MIT License. See LICENSE.