Create a Page monitor
SetPERPLEXITY_API_KEY to your API key. The Python and TypeScript examples use the Perplexity SDKs. The cURL examples use jq.
Add one target with type: "page" for each public URL that you want to watch. When you create a monitor, its first run is due immediately. The service schedules later runs until you pause or delete the monitor. See Monitor API pricing.
200 response is a monitor, not a completed run. Set MONITOR_ID to its id for the requests below. Use an idempotency key if your application retries creation.
This example reads results through the API without a webhook. Use webhooks to receive change notifications without polling for results.
Understand the first run
When the monitor reads a page successfully for the first time, it saves a baseline and reports no change for that page. Get the first run to check its status andtarget_errors. Do not send another /run request after you create the monitor.
queued, running, or an unknown status, poll with a bounded retry policy. If the status is failed or skipped, check error. A succeeded run can still contain individual target_errors.
Set RUN_ID to data[0].id. Then get that run:
Baseline run response
Baseline run response
Read page changes
Later runs compare fetched text with the saved version of each page. The service judges each detected difference for meaningfulness before it keeps the change. Each kept change appears inchanges with type: "page_change" and a structured diff. The comparison uses the versions that the service read, not every intermediate edit.
Use the same run-history request to read later checks. A monitor that tracks release notes can return:
Page change response
Page change response
counts: {"candidates": 0, "changes": 0, "errors": 0}, changes: [], and target_errors: []. Changed text can also produce candidates that the relevance judge does not keep.
Page result fields
Errors when the service reads or processes a page are separate from changes. Each entry in
target_errors contains type: "page", url, code, and message. A failed page read keeps the saved baseline of that page. An error with the http_status code also includes status_code from the page. Other codes include invalid_url, blocked, no_content, load_failed, timeout, and fetch_unavailable.
Use code for decisions, and do not parse message. Make sure that your code accepts new error codes.
A run can succeed when some pages fail and the monitor reads other pages successfully. If all sources fail, the run status is failed. Check error and target_errors on that run.
For a succeeded Page run, use usage.fetched_urls to see how many URLs counted, not the number of configured targets. For example, a run can return one counted URL and one http_status target error. See Monitor API pricing for rates.
Configure what to track
Choose pages
Supply 1 to 10 Page targets, each with its own URL. A Page monitor checks those URLs.
The service rejects duplicate page URLs after it normalizes the scheme, host, default port, empty path, and fragment. In that check, URLs with different query strings are different URLs. When the detector reads pages, it can also deduplicate other normalized equivalents.
To change the watched pages, replace the full
targets array. Include each URL that you want to keep. The service keeps saved baselines. A Page URL with no stored baseline sets one when the monitor reads that page successfully for the first time.
Set a relevance goal
Use the goal to describe which changes you want to keep. An example goal is “New features and breaking changes in the release notes; ignore navigation and footer edits.” The goal filters detected text changes. Page judging runs automatically and uses one check. Only changes that pass judging appear inchanges:
- Meaningfulness: With a goal, the judge checks the detected text change against those instructions. For a monitor without one, the judge checks general meaningfulness.
Next steps
Pause the monitor when you finish your test. You can also change its schedule, add webhooks, or check the API reference for the full contract.Track API and pricing changes
Watch a changelog, a pricing page, and an API guide for changes that matter to you.