Skip to main content
changeTracking compares a page with the last time your API key read it. It tells you if the page is new, same or changed, and for a change it returns a diff.

Make a request

Get an API key in the Quickstart. Change tracking needs one, because Stophy compares the page with what that API key read before. Send changeTracking as an object. This request reads a page that changes on every read, to show a change.

Read the response

The first read of a page has nothing to compare with. It returns new, with previousScrapeAt set to null and no diff.
Send the same request again. The page has changed, so you get changed, the time of the previous read, and a unified diff of the Markdown.
When nothing changed, changeStatus is same and there is no diff. Every read replaces the stored one, so the next call compares with this call.

Options

With json mode, changeTracking.json holds each field with its previous and current value, and a field with no earlier value has null as previous. With no schema or prompt, the model compares the main facts of the page, such as its title, price and status.

What is compared

A read is compared with the last read of the same URL with the same location.country, onlyMainContent, includeTags, excludeTags and actions. Change any of them and you start a new history. The comparison is kept for 30 days after the last read.

Limits and errors

  • Without an API key, the call returns 400 invalidRequest with the message formats: changes needs an API key, so the page can be compared with what that key read before. Send the call with your API key, or leave changes out.
  • A diff is cut at 20,000 characters.
  • The page is always read live, never from a stored copy, whatever maxAge says.

Price

$1 per 1,000 pages with `git-diff`. With `json` mode, add $3 per 1,000 pages when it returns something.