Help us measure site usage?

With your permission, we use self-hosted analytics to understand page usage. It is optional and does not affect the Service. Learn more.

JavaScriptadvanceddevopsAI generated

Scheduled Price Tracker with Alerts

Build a Node.js tool that watches the prices of products you want to buy and emails you when one drops below your target. On a schedule set with node-cron, it downloads each product page, finds the price with Cheerio (an HTML parser with jQuery-like selectors), stores every reading in SQLite so you can see the price history, and sends an alert with Nodemailer, only once per drop rather than every run. It's built to keep working when things go wrong: retries for network errors, clear reports when a site's layout changes, and polite request rates. Only track pages whose terms allow automated access. You'll learn web scraping, scheduling, storing time series, sending email, and building reliable automation.

Estimate
~12h
Steps
7
Completed by
0
Proposed by
codeseed.app

Node.js · Cheerio · node-cron · Nodemailer

Project roadmap

  1. 01

    Scrape one product

    ~2h

    Create a Node.js project with cheerio and a products.json config: each product has a name, URL, a CSS selector for the price, and a target price. Fetch the page with fetch (with a timeout and a descriptive user agent), load it with Cheerio, read the price text, and parse it into a number, handling currency symbols and both 1,299.99 and 1.299,99 formats. Save a copy of a page to test with. Done when: the price of a test product is read correctly.

  2. 02

    Store price history

    ~1.5h

    Store readings in SQLite (with better-sqlite3): product, price in cents, currency, time, and status (ok or failed with the reason). Add products to a table from the config. Done when: each run adds one reading per product.

  3. 03

    Schedule runs

    ~1h

    Use node-cron to run the check on a configurable schedule (for example every 6 hours), checking products one after another with a random delay of a few seconds between requests to be polite. Prevent a new run from starting while the previous one is still going. Done when: the tool runs on schedule and logs each run.

  4. 04

    Send alerts

    ~2h

    After each reading, check if the price is at or below the target. If so, and no alert was sent since the price was last above the target, send an email with Nodemailer (SMTP settings from environment variables) with the product, the old and new price, and the link. Record sent alerts so they're not repeated. Done when: a drop below the target sends exactly one email.

  5. 05

    Handle failures

    ~2h

    Retry network errors and 5xx responses up to 3 times with increasing waits, and respect 429 responses by backing off. When the selector finds nothing or the text isn't a price, record a failure saying the layout may have changed. After 3 failed runs in a row for a product, send one email warning that it needs attention. Done when: an unreachable page and a changed layout are both recorded with clear reasons.

  6. 06

    Add a history report

    ~1.5h

    Add a CLI command, history PRODUCT, that prints the product's readings with the date and price, the lowest, highest and current price, and a simple text chart of the trend. Add list, which shows every product with its current price and target. Done when: the report shows correct statistics for a tracked product.

  7. 07

    Test it

    ~2h

    Write tests with saved HTML files and a fake mail transport: price parsing for many formats, selector failures, alert rules (sent once, sent again after going back above the target), retries with a mocked fetch, and history statistics with an in-memory database. Done when: npm test passes without network access.

Ready to build this?

Get a GitHub repo and start building. Your AI reviewer checks each step as you go.

~12h · 7 steps

Tech stack

Node.jsCheerionode-cronNodemailer