DEV Community

Browsa
Browsa

Posted on

A daily price check that stays quiet until something changes

Disclosure: I work on Browsa, the cloud browser used here.

A price check you have to read every morning soon becomes one you stop reading. What you actually want is a job that runs every day and only says something when a price moves.

This continues from the previous post in this series, which recorded a product-page task and saved it as a robot over three book pages.

Add a schedule and a monitor

robot = client.robots.update(
    robot_id,
    schedule={"interval_seconds": 86400, "at": "09:00", "tz": "UTC"},
    monitors=[{"field": "price", "op": "changed"}],
)
print("next run:", robot.health.next_run_at)
Enter fullscreen mode Exit fullscreen mode
next run: 2026-11-24T09:00:00Z
Enter fullscreen mode Exit fullscreen mode

field is a column from the recording's output schema. That's why the previous post recorded with output_schema: a free-text answer has no price to watch.

What the monitor compares

Each row is compared with the previous successful output for the same input, not with the row above it. I ran the robot three times by hand to check this:

run 1 (baseline):
  0 ok £47.82
  1 ok £50.10
  2 ok £53.74
  alerts so far: 0
run 2 (same pages):
  0 ok £47.82
  1 ok £50.10
  2 ok £53.74
  alerts so far: 0
run 3 (row 0 points at another book):
  0 ok £50.10
  1 ok £50.10
  2 ok £53.74
  alerts so far: 0
Enter fullscreen mode Exit fullscreen mode
  • Run 2: the prices didn't change, so there was no alert. That's the point: the job stays silent.
  • Run 3: row 0 showed a different price, but it was also a different page. A different input is a different item with no history, so it doesn't count as a price change.

I haven't shown a fired alert here, because the sandbox prices never move and I didn't want to stage one. On a real product page, the first run whose price differs from that page's previous run creates an alert with the old and new value.

The other monitor rules

op Fires when
changed the value differs from the same row's previous value
lt / gt with value the value crosses below / above the limit (once, not on every run while it stays there)
eq with value the value becomes equal to value, e.g. "sold out"
in_stock_changed the stock state flips between in stock and out of stock

lt and gt read numbers out of strings, so "£47.82" compares as 47.82.

Where alerts go

Alerts are listed with client.robots.alerts(robot_id). They can also go to your own endpoint as a signed robot.alert webhook. Setup: browsa.io/guides/robots.

Cost

Every scheduled run costs each row's credits (here, 8 per row, the same as the recorded task), and failed rows are free. Three rows once a day is 24 credits a day, so pick the interval to match how often the price really changes. A robot can run anywhere from hourly to every 30 days.

Top comments (0)