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
- 01
Scrape one product
~2hCreate 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.
- 02
Store price history
~1.5hStore 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.
- 03
Schedule runs
~1hUse 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.
- 04
Send alerts
~2hAfter 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.
- 05
Handle failures
~2hRetry 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.
- 06
Add a history report
~1.5hAdd 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.
- 07
Test it
~2hWrite 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.
Resources
Ready to build this?
Get a GitHub repo and start building. Your AI reviewer checks each step as you go.
Tech stack