↑ ↓ to move ↵ to open

Monitors

Run an endpoint on a schedule and hear when a field changes.

A monitor runs an endpoint on a schedule, compares the fields you choose with the last run, and emails you when they change. It works with every endpoint, on every platform and for any website. Monitors are in beta.

You can also make and manage monitors in the console under Monitors.

Create one

HTTP
POST https://data.upscrape.com/monitorsAuthorization: Bearer UPSCRAPE_API_KEYContent-Type: application/jsonIdempotency-Key: watch-stripe-company-page
JSON
{  "name": "Stripe on LinkedIn",  "capability": "linkedin.company.get",  "input": {"url": "https://www.linkedin.com/company/stripe"},  "interval_seconds": 86400,  "comparator": {"paths": ["/followers", "/employee_count"]},  "monthly_credit_limit": 40}
FieldRequiredWhat it does
capability, inputYesThe endpoint to run and its input, as in Run an endpoint.
interval_secondsNoHow often it runs: from 3,600 (every hour) to 2,592,000 (every 30 days). Every 6 hours if you leave it out.
comparator.pathsNoThe fields to watch, as paths into the endpoint's data, such as /followers.
monthly_credit_limitNoThe most the monitor may spend in a month. It pauses before going over.
nameNoA name for you; the endpoint's name if you leave it out.

Every change needs an Idempotency-Key header: create, update, delete, pause, resume and run now. A repeat returns the first result and never starts or charges a second run; a change sent without one is refused with invalid_input.

The website tools come with sensible fields to watch: web.extract watches the fields you asked for, and web.markdown watches the page's text, leaving out timings. Send paths to choose your own.

How changes are found

  • The first successful run is the baseline. It never counts as a change.

  • After that, each run is compared with the last good one, on the paths you chose.

  • The order of keys in an object doesn't matter; a value's type does.

  • A list is compared in order. If its items have a stable ID, name it in array_keys and items are matched by it instead:

JSON
{  "paths": ["/items"],  "array_keys": {"/items": "/place_id"}}
  • A field that is missing is reported as not comparable, never as deleted.

  • A failed run never moves the baseline.

  • When an endpoint is updated in a way that changes its output, the monitor takes a new baseline instead of reporting a change.

What it costs

Each run is an ordinary call, charged once at the endpoint's price when it succeeds. Failed runs, skipped runs, comparisons and emails cost nothing. Only one run of a monitor happens at a time; a run that falls due while the last is still going is skipped.

Responses include an estimate of the next 30 days. A monitor pauses itself before it would pass its monthly_credit_limit, and when your balance runs out; resume it once there are credits.

Emails

Emails go to the person who made the monitor: when a watched field changes, when runs keep failing, when they recover, and when the monitor pauses itself. A run of failures sends one email, not one per run.

The endpoints

Method and pathWhat it does
GET /monitorsList your monitors.
POST /monitorsCreate one.
GET /monitors/{id}One monitor.
PATCH /monitors/{id}Change it.
DELETE /monitors/{id}Delete it.
POST /monitors/{id}/runRun it now.
POST /monitors/{id}/pause, /resumePause or resume it.
GET /monitors/{id}/runs, /runs/{run_id}Its runs.
GET /monitors/{id}/changes, /changes/{change_id}The changes it found.

Lists come in pages; follow the cursor in each response. A key needs monitors:read to read and monitors:write to change, plus execute for the endpoint it runs.

Limits

  • During the beta, an account can have two monitors. Write to us if you need more.

  • Runs are kept for 90 days; the data each run saw, and its differences, for 30 days. The current baseline of an active monitor is always kept.

Something missing or unclear? Ask the team that builds the endpoints.