Skip to content

HasData/amazon-price-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Requests dotenv

Amazon Product Price Tracker

HasData_bannner

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.

Watch the video

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.

Quick Start

pip install -r requirements.txt

Create .env

HASDATA_API_KEY=your_api_key_here
BOT_TOKEN=telegram_bot_token
BOT_CHAT_ID=telegram_chat_id

Run the main file:

python src/main.py

Workflow

Read 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

Project Structure

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

Requirements

  • Python 3.10+
  • A HasData API key
  • Telegram BOT ID (optional)
  • Telegram CHAT ID (optional)

Install dependencies:

pip install -r requirements.txt

Configuration

Create .env in the project root,

HASDATA_API_KEY=your_api_key_here
BOT_TOKEN=telegram_bot_token
BOT_CHAT_ID=telegram_chat_id

The scripts load this variable automatically with python-dotenv.

Scripts

Run

src/main.py

Notes

  • 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.

Why This Repo Exists

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.

Use Cases

  • Market tracking
  • Price changes report
  • Tutorial material for building a brand monitoring tool
  • Notifying when prices drop

License

This project is licensed under the MIT License. See LICENSE.

About

Track Amazon product prices automatically using HasData Scraper API. Monitor multiple ASINs, save historical price data to CSV, and get instant Telegram alerts when prices drop below your threshold. Built with Python, easy to configure and run.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages