Create a Search monitor
SetPERPLEXITY_API_KEY to your API key. The Python and TypeScript examples use the Perplexity SDKs. The cURL examples use jq. 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.
Read the results
A run is one execution of a monitor. Itschanges array contains the Search results that the run kept. Get the latest run with MONITOR_ID. The first run starts asynchronously after you create the monitor. Do not send another /run request for the first run.
The two responses below show the same run. Use the IDs that your own requests return.
List runs response
List runs response
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 have an empty changes array.
Set RUN_ID to the ID of the run in data[0].id. Then get that run. The service keeps run history for 90 days.
Get run response
Get run response
confidence is the product of the judging scores that apply, from 0 to 1. The pass threshold applies to each check, not to the product. Because of this, a kept result can have a confidence score below the threshold. Compare scores within one monitor.
Each run includes usage and cost. The cost of a succeeded run stays the same no matter how many searches the run makes.
Configure your search
Put one target withtype: "search" in targets.
Queries and goals
The query sets the topic. An optionalgoal describes which results to keep. Judging runs automatically. A result must pass each check that applies to appear in changes:
- Novelty: Checks if the result adds new information.
- Legitimacy: Checks if the source is trustworthy.
- Time window: Checks if the result fits the time window of the run.
- Relevance: Checks if the result matches your instructions. This check runs only when you provide a goal.
Freshness
The freshness filter selects which pages fall in the run window.published finds newly published pages, and updated finds recently updated pages. If you select both, the filter accepts either date. Updated dates have day-level precision.
The monitor sets the run window from its schedule and from its last successful run. Before the first successful run, the window starts one schedule period before you create the monitor. This start time is at most 7 days earlier. Later windows normally start where the last successful window ended, within the lookback limit of the service. The window ends when the run starts.
Domain filters
Supply bare host names such asexample.com, without a scheme, path, or port. Each entry also covers its subdomains.
Deduplication and results
A Search monitor deduplicates normalized URLs within a run and against previously seen URLs. If you change the goal, the monitor does not replay seen URLs. When you selectupdated freshness, the monitor still deduplicates known URLs. Use Page monitoring to watch for later edits at a known URL.
The service keeps seen-URL state for 90 days and refreshes that state when the monitor sees a URL again. You can update the query and keep that history. To start with a fresh discovery history, create a new monitor.
Update your search
Replace the Search target to change the query and restrict its sources:max_results, the service resets it to 20. If you omit filters, both freshness values apply and the service removes domain restrictions. If you omit one filter, the service resets that filter to its default. An empty or null value for targets is invalid.
You can update the goal separately and leave the target unchanged. Deduplication still applies, so a goal change does not replay seen URLs.
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 competitor news
Create a daily monitor for product launches and business news about a competitor.