How UniFi Stock Watcher works

What the app reads from the Ubiquiti Store and how often, how it goes easy on the store, how its alerts reach you, and how it updates itself safely.

What each check reads

The Ubiquiti Store (store.ui.com) builds its pages from public data, the same data your browser loads when you open the store. UniFi Stock Watcher reads that data directly. It needs no login and no API key, and it doesn't scrape the pages you see.

A check reads the store's 8 category pages, which between them list the whole catalog: about 500 products. For each product's variants they give the stock status (available, sold out or coming soon), the price, and the store's own restock date when it has one. That's 8 requests a check, whether you watch one product or fifty.

Each check is compared with the one before. The first check after you click Start watching sets the baseline. After that, any product whose stock changes shows up in the Store changes feed, and a product on your watch list that comes back in stock alerts you.

A few products aren't on any category page, and Ubiquiti renames and moves products now and then. A watched product the category pages don't list is looked up on its own page. The store often answers that with a redirect, which the app follows. It then matches the product by its current address, its former addresses or its product ID. When none of those match, the app marks the product delisted rather than guess.

Categories get renamed too. Category requests follow the store's redirects, and once a day the app looks for new categories carrying products its list misses. Every night, an automated check runs against the real store on GitHub, so a change in the store's data is caught the day it happens.

How often, and going easy on the store

The app checks every minute by default. Settings → Watching sets anything from every 15 seconds to once an hour, and Check now (F5) checks at once.

The command-line watcher, UnifiStockWatcher-cli.exe, works the same way.

How alerts work

When a product you watch comes back in stock, the app:

You can switch each of these off in Settings → Alerts. Either way, the product's card turns green with an Open in store button, and the icon in the notification area gets a green dot.

Each return to stock alerts once. A product that's already in stock when the app starts doesn't alert again, but one that came back while the app was closed does. Alerts that arrive within a few seconds of each other share one notification, which opens the app's window.

On your phone

Settings → Alerts on your phone sends every alert to your phone too, through the service you choose:

Your PC sends the alert when it finds the product, so it has to be on and watching. A service that's busy or can't be reached is tried twice more over about 25 seconds. Send a test shows what the service answered. The address or key stays in the settings file on your PC, and the app's log only ever names the service, never the address.

The Settings tab: how often to check, the store, the alert switches and Start with Windows
Settings: how often to check, the store and the alerts. Changes take effect at once.

Per-product alerts and price changes

The watch list and history

Add products… opens the store's live catalog. Search it, filter it by category, and tick the products you want. It lists sold-out products, with how long each has been out. Tick Include products in stock to see everything.

The Add products dialog: the store's catalog with check boxes, category, price and stock status, sold-out products showing how long they've been out
Add products: the live catalog, with how long each sold-out product has been out.

Each card on your list shows the product's stock and price. For a sold-out product, it also shows the store's restock estimate and how long it's been out, like back ~7 Nov · sold out 13 days. ⋯ on a card has Check now, Copy link, Mute alerts and Remove, and double-clicking a card opens the product's page. Settings → Watch list exports your list and imports it again.

Below the list are two views. Store changes is a live feed of every product coming into or going out of stock anywhere in the store, and Activity shows what the watcher did.

History records changes, not checks. It logs each time a watched product goes in or out of stock or changes price, and every stock change anywhere in the store. It keeps the latest 5,000 events, and drops store-wide ones first when it's full. You can search it, and Export CSV… saves what the list shows, as a file that opens in Excel with € and £ intact.

The History tab: stock changes with times, products and prices
History: every change, for your products or the whole store.

All of it stays on your PC, in %APPDATA%\UniFi Stock Watcher, or beside the program for the portable copy.

The pictures are from the app's demo mode: real product names with made-up stock, prices and dates.

Signed in-app updates

Once a day, the app asks GitHub for the latest release's latest.json. It's a small manifest naming the version, and the size and SHA-256 hash of each download. You can turn the check off in Settings → Updates.

  1. The manifest is signed with the project's Ed25519 key. The app checks the signature against the public key built into it, and ignores a manifest whose signature doesn't match.
  2. Only a newer version is offered. The app never goes back a version.
  3. Nothing is downloaded until you click Install. The download has to match the signed size and hash, or it's deleted.
  4. Then it installs. An installed copy runs the new installer silently, which waits for the app to close and then starts the new version. A portable copy unzips the new version to a temporary folder and swaps its program files in place, never the watch list beside them. If the swap fails, everything is put back and the old version starts again.

Separately, the installer and both programs are code-signed by James Cupps, which is the publisher Windows names. Before a release is published, its exact files are installed, started, and updated to from the previous release on a fresh Windows machine on GitHub. Only the release's own signing step can use the signing key.

What leaves your PC

The app reads the store's public catalog, and asks GitHub once a day for updates. It sends nothing about you, your watch list or your PC anywhere. Alerts on your phone go only to the service you choose, with the product's name, price and link.

Back to UniFi Stock Watcher: download it, see more screenshots, and install it with Scoop.

The source, the full README and every release are on GitHub.

More tools from James Cupps