Get a monitor
curl --request GET \
--url https://api.prefetch.io/monitor/{id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.prefetch.io/monitor/{id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.prefetch.io/monitor/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.prefetch.io/monitor/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.prefetch.io/monitor/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.prefetch.io/monitor/{id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prefetch.io/monitor/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "mon_3f9a1c2b7d4e4f6a8b0c1d2e3f4a5b6c",
"name": "Competitor pricing",
"status": "active",
"schedule": {
"cron": "0 9 * * 1-5",
"timezone": "Europe/Athens",
"text": "every weekday at 9am"
},
"next_run_at": "2026-10-13T06:00:00.000Z",
"last_run_at": "2026-10-12T06:00:04.112Z",
"current_check_id": null,
"goal": "Alert me when a plan price or its included features change",
"judge_enabled": true,
"targets": [
{
"id": "tgt_8d1e0f2a3b4c5d6e",
"type": "scrape",
"urls": [
"https://example.com/pricing"
],
"scrape_options": {
"only_main_content": true,
"include_links": true,
"include_images": false,
"include_selectors": [],
"exclude_selectors": []
},
"change_tracking": {
"modes": [
"json"
],
"json_prompt": "Each plan: name, monthly price, headline features"
}
},
{
"id": "tgt_1a2b3c4d5e6f7a8b",
"type": "crawl",
"url": "https://example.com/changelog",
"crawl_options": {
"limit": 25,
"max_depth": 2,
"include_paths": [
"^/changelog/"
],
"exclude_paths": [],
"allow_subdomains": false,
"ignore_query_params": true,
"respect_robots_txt": true,
"use_sitemap": true,
"delay_ms": 0,
"concurrency": 2
},
"scrape_options": {
"only_main_content": true,
"include_links": true,
"include_images": false,
"include_selectors": [],
"exclude_selectors": []
},
"change_tracking": {
"modes": [
"markdown"
]
}
}
],
"webhook": {
"url": "https://you.example.org/hooks/prefetch",
"headers": {},
"metadata": {
"env": "production"
},
"events": [
"monitor.page",
"monitor.check.completed"
],
"secret": "whsec_4f1c9e2a7b3d8e6f0a5c1b9d2e7f3a8c4b6d0e1f9a2c5b7d"
},
"retention_days": 30,
"estimated_credits_per_check": 55,
"estimated_credits_per_month": 1155,
"last_check_summary": {
"check_id": "chk_8e2d4f6a1b3c4d5e6f7a8b9c0d1e2f3a",
"status": "completed",
"finished_at": "2026-10-12T06:01:27.930Z",
"total_pages": 19,
"same": 16,
"new": 1,
"changed": 1,
"removed": 1,
"error": 0
},
"created_at": "2026-10-09T10:00:00.000Z",
"updated_at": "2026-10-09T10:00:00.000Z"
},
"meta": {
"requestId": "d0b3f4a5-6c7d-4e8f-a091-2b3c4d5e6f70",
"durationMs": 39
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}Monitoring
GET /monitor/{id}
One monitor’s settings, next run, credit estimate and last check. Free.
GET
/
monitor
/
{id}
Get a monitor
curl --request GET \
--url https://api.prefetch.io/monitor/{id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.prefetch.io/monitor/{id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.prefetch.io/monitor/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.prefetch.io/monitor/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.prefetch.io/monitor/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.prefetch.io/monitor/{id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prefetch.io/monitor/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "mon_3f9a1c2b7d4e4f6a8b0c1d2e3f4a5b6c",
"name": "Competitor pricing",
"status": "active",
"schedule": {
"cron": "0 9 * * 1-5",
"timezone": "Europe/Athens",
"text": "every weekday at 9am"
},
"next_run_at": "2026-10-13T06:00:00.000Z",
"last_run_at": "2026-10-12T06:00:04.112Z",
"current_check_id": null,
"goal": "Alert me when a plan price or its included features change",
"judge_enabled": true,
"targets": [
{
"id": "tgt_8d1e0f2a3b4c5d6e",
"type": "scrape",
"urls": [
"https://example.com/pricing"
],
"scrape_options": {
"only_main_content": true,
"include_links": true,
"include_images": false,
"include_selectors": [],
"exclude_selectors": []
},
"change_tracking": {
"modes": [
"json"
],
"json_prompt": "Each plan: name, monthly price, headline features"
}
},
{
"id": "tgt_1a2b3c4d5e6f7a8b",
"type": "crawl",
"url": "https://example.com/changelog",
"crawl_options": {
"limit": 25,
"max_depth": 2,
"include_paths": [
"^/changelog/"
],
"exclude_paths": [],
"allow_subdomains": false,
"ignore_query_params": true,
"respect_robots_txt": true,
"use_sitemap": true,
"delay_ms": 0,
"concurrency": 2
},
"scrape_options": {
"only_main_content": true,
"include_links": true,
"include_images": false,
"include_selectors": [],
"exclude_selectors": []
},
"change_tracking": {
"modes": [
"markdown"
]
}
}
],
"webhook": {
"url": "https://you.example.org/hooks/prefetch",
"headers": {},
"metadata": {
"env": "production"
},
"events": [
"monitor.page",
"monitor.check.completed"
],
"secret": "whsec_4f1c9e2a7b3d8e6f0a5c1b9d2e7f3a8c4b6d0e1f9a2c5b7d"
},
"retention_days": 30,
"estimated_credits_per_check": 55,
"estimated_credits_per_month": 1155,
"last_check_summary": {
"check_id": "chk_8e2d4f6a1b3c4d5e6f7a8b9c0d1e2f3a",
"status": "completed",
"finished_at": "2026-10-12T06:01:27.930Z",
"total_pages": 19,
"same": 16,
"new": 1,
"changed": 1,
"removed": 1,
"error": 0
},
"created_at": "2026-10-09T10:00:00.000Z",
"updated_at": "2026-10-09T10:00:00.000Z"
},
"meta": {
"requestId": "d0b3f4a5-6c7d-4e8f-a091-2b3c4d5e6f70",
"durationMs": 39
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}{
"error": "Credit limit exceeded",
"error_code": "CREDITS_EXHAUSTED",
"retryable": false,
"success": false,
"retryAfterSeconds": 123,
"limit": 123,
"meta": {
"requestId": "a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d",
"durationMs": 1842
}
}Overview
Returns the monitor exactly as it runs: every target with its effective options, the schedule as cron, the next run, the webhook — including its signingsecret — and the summary of the most recent check.
A monitor you do not own returns 404 rather than 403. Monitor ids are unguessable, and confirming that some id exists is the only thing an enumeration attempt is after.
Example request
curl "https://api.prefetch.io/monitor/mon_3f9a1c2b7d4e4f6a8b0c1d2e3f4a5b6c" \
-H "X-API-Key: $PREFETCH_API_KEY"
const res = await fetch(`https://api.prefetch.io/monitor/${monitorId}`, {
headers: { "X-API-Key": process.env.PREFETCH_API_KEY },
});
const { data: monitor } = await res.json();
console.log(monitor.next_run_at, monitor.estimated_credits_per_month);
import os, requests
monitor = requests.get(
f"https://api.prefetch.io/monitor/{monitor_id}",
headers={"X-API-Key": os.environ["PREFETCH_API_KEY"]},
).json()["data"]
print(monitor["next_run_at"], monitor["estimated_credits_per_month"])
Reading the monitor
| Field | Meaning |
|---|---|
schedule.cron | The schedule the monitor runs on. A phrase you submitted is kept in schedule.text. |
next_run_at | When the next check starts. null while the monitor is paused. |
current_check_id | The check running right now, if one is. |
targets | What it watches. Every target has an id and every option its effective value. |
webhook.secret | The key to verify webhook signatures with. Treat it like a password. |
estimated_credits_per_check | Upper bound: every page fetched, and judged if there is a goal. |
estimated_credits_per_month | The per-check estimate times the runs in an average month. |
last_check_summary | Page counts from the most recent check, with its id and status. |
GET /monitor/{id}/checks.
Related
PATCH /monitor/{id}
Change it, pause it or resume it.
GET /monitor/{id}/checks
Its check history.
Authorizations
Your Prefetch API key. Obtain one from the dashboard.
Path Parameters
The monitor id returned by POST /monitor.
Example:
"mon_3f9a1c2b7d4e4f6a8b0c1d2e3f4a5b6c"