Ecom-Notifier is an ethical web scraping project designed to monitor price changes for a specific product on Amazon. When a price decrease is detected, the tool sends a notification to the user via the Pushover service.
- Monitor the price of a product on Amazon using its ASIN (Amazon Standard Identification Number).
- Log the current price along with a timestamp.
- Calculate the percentage difference between the current and previous prices.
- Send notifications of price decreases using Pushover.
- Uses Brightdata Web Unlocker proxy for handling web scraping.
- Python 3.12
- Brightdata Web Unlocker proxy
- Pushover account for notifications
-
Clone the repository:
git clone https://github.com/yourusername/ecom-notifier.git cd ecom-notifier
-
Create and activate a virtual environment:
python3.12 -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required dependencies:
pip install -r requirements.txt
-
Create a
.env
file in the root directory of the project and add your Brightdata and Pushover credentials:PUSHOVER_TOKEN=your_pushover_token PUSHOVER_USER=your_pushover_user PROXY=your_brightdata_proxy
-
Set the ASIN of the product you want to monitor in the
main
function withinecom_notifier.py
:if __name__ == '__main__': current_asin = "B0B46N7QQL" main(current_asin)
-
Run the script:
python ecom_notifier.py
Writes the current price to a JSON file with a timestamp.
Calculates the percentage difference between the previous and current prices.
Sends an alert message using the Pushover API.
Fetches the current price of a product from Amazon using its ASIN.
Main function to check the current price of a product, calculate the difference from the previous price, write the current price to a file, and send an alert if the price has decreased.
The script uses the loguru
library for logging. Logs are written to the console and to a rotating log file located at logs/debug.log
.
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
This project is intended for educational and ethical purposes only. Ensure you comply with Amazon's terms of service and scraping policies.