DEV Community

Benjamin Garcia
Benjamin Garcia

Posted on Originally published at usewrit.app

A price tracker for any online store: get an alert when the price drops

This guide first appeared on usewrit.app. I build Writ, the tool used in the steps below.

Amazon has a whole ecosystem of price-history trackers. Most other stores have none. If the sofa is on Wayfair, the TV on Best Buy, the shoes on Nike, the listing on eBay or the part in a small specialist shop, you are left refreshing the page.

This guide shows how to track the price of a product on any online store and get an alert when it drops, with the same setup whatever the store.

How a price tracker works

Every price tracker does the same three things. It reads the price from the product page, it compares the reading with the previous one, and it tells you when a condition is met: the price drops, falls below a target, or the item comes back in stock.

Store-specific trackers do this for one site, using what they know about its pages. A general tracker does it for any page by letting you point at the price.

Track a price on any store with Writ

  1. Paste the product URL, from any store.
  2. Point at the price (and, if you like, the stock status next to it).
  3. Set your condition: any change, or a price below the threshold you would pay.
  4. Pick where the alert goes: email, SMS, WhatsApp, Signal, Pushover or a webhook.

Writ reads the price on your schedule, keeps every reading with the value before and after, and alerts you only when your condition matches. On the Free plan a product page can be checked every 5 minutes, or every 15 minutes when it needs a browser, and you start with 1,000 free credits, no card.

The steps are the same for Walmart, Wayfair, Best Buy, eBay, Macy's, Nike, Etsy or a one-person shop: what changes from store to store is only how the price reaches the page.

Walmart, Wayfair, Best Buy, eBay and other stores

Store pages fall into three kinds, and knowing which one you face saves credits:

  • The price is in the page. The cheapest case: a check without a browser reads it, for 0.5 credits in the cloud.
  • The price appears after scripts run. Common on large retail sites. The page needs a browser check (5 credits in the cloud), which runs less often.
  • The price depends on you. Member prices, a store or ZIP code chosen in your account, a business account. Attach a persona so Writ checks the page as you, signed in, and sees the price you would pay.

On your own computer with Writ Desktop, checks of every kind cost 0 credits while it is on and connected. In the cloud they keep running when your computer is off.

If you are writing your own tracker instead, the same split applies: requests plus a selector covers the first kind, the second needs a headless browser, and the third needs a signed-in session you keep alive yourself.

Price drops, targets and back-in-stock alerts

Most people want one of three alerts. "Tell me when it changes" is the simplest and the noisiest. "Tell me when it is under my target" is usually what you mean. "Tell me when it is back in stock" watches the availability label instead of the number. Watch both on the same product page and you hear about the drop and the restock.

Keep a price history

Every reading lands in a dataset with the time and the value before and after. Read it in the Data explorer, export it, or call it from your own code. After a few weeks you know whether a "sale" is a real low or the usual price with a crossed-out number above it.

Tracking many products, or a whole category

For a handful of products, one monitor each is enough. For a catalog, use an API that returns many products in one call. The Writ marketplace has ready-made ones, such as Walmart Canada products and offers or Amazon price history from camelcamelcamel; for any other store, turn the site into an API once and schedule it.

Do something with the drop

An alert is a start. A price change in Writ is a trigger, so it can also post to your team's channel through a webhook, update a spreadsheet, or start a workflow, such as re-pricing your own listing when a competitor moves. Conditions, a cooldown and an optional approval step keep it inside limits you set.

Be a polite visitor

A price rarely needs checking more than a few times an hour; once a day is plenty for most purchases. Watch pages you are allowed to access, use your own account where a sign-in is needed, and follow each store's terms.

Top comments (0)