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. SendchangeTracking 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 returnsnew, with previousScrapeAt set to null and no diff.
changed, the time of the previous read, and a unified diff of the Markdown.
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 samelocation.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 invalidRequestwith the messageformats: 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
maxAgesays.
Price
$1 per 1,000 pages with `git-diff`. With `json` mode, add $3 per 1,000 pages when it returns something.Related
- Monitors run a read on a schedule and call you when a page changes.
- Website change digest builds a daily summary of changes.
- Freshness and caching explains
maxAgeand stored copies. - Product reads a price in a fixed shape.