Run a check now
curl --request POST \
--url https://api.prefetch.io/monitor/{id}/run \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.prefetch.io/monitor/{id}/run"
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.prefetch.io/monitor/{id}/run', 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}/run",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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}/run"
req, _ := http.NewRequest("POST", 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.post("https://api.prefetch.io/monitor/{id}/run")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prefetch.io/monitor/{id}/run")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "chk_8e2d4f6a1b3c4d5e6f7a8b9c0d1e2f3a",
"monitor_id": "mon_3f9a1c2b7d4e4f6a8b0c1d2e3f4a5b6c",
"status": "queued",
"trigger": "manual",
"scheduled_for": null,
"started_at": null,
"finished_at": null,
"estimated_credits": 55,
"actual_credits": 0,
"summary": {
"total_pages": 0,
"same": 0,
"new": 0,
"changed": 0,
"removed": 0,
"error": 0
},
"target_results": null,
"error": null,
"created_at": "2026-10-09T10:05:00.000Z",
"updated_at": "2026-10-09T10:05:00.000Z"
},
"meta": {
"requestId": "a3e6c7d8-9f0a-4b12-93c4-5e6f708192a3",
"durationMs": 38
}
}{
"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
}
}{
"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
POST /monitor/{id}/run
Run a monitor’s check now instead of waiting for its schedule. Billed like a scheduled check.
POST
/
monitor
/
{id}
/
run
Run a check now
curl --request POST \
--url https://api.prefetch.io/monitor/{id}/run \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.prefetch.io/monitor/{id}/run"
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.prefetch.io/monitor/{id}/run', 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}/run",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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}/run"
req, _ := http.NewRequest("POST", 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.post("https://api.prefetch.io/monitor/{id}/run")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prefetch.io/monitor/{id}/run")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "chk_8e2d4f6a1b3c4d5e6f7a8b9c0d1e2f3a",
"monitor_id": "mon_3f9a1c2b7d4e4f6a8b0c1d2e3f4a5b6c",
"status": "queued",
"trigger": "manual",
"scheduled_for": null,
"started_at": null,
"finished_at": null,
"estimated_credits": 55,
"actual_credits": 0,
"summary": {
"total_pages": 0,
"same": 0,
"new": 0,
"changed": 0,
"removed": 0,
"error": 0
},
"target_results": null,
"error": null,
"created_at": "2026-10-09T10:05:00.000Z",
"updated_at": "2026-10-09T10:05:00.000Z"
},
"meta": {
"requestId": "a3e6c7d8-9f0a-4b12-93c4-5e6f708192a3",
"durationMs": 38
}
}{
"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
}
}{
"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
Queues a check outside the schedule and returns it straight away, with statusqueued. The check runs within seconds; poll GET /monitor/{id}/checks/{checkId} until its status is no longer queued or running.
Use it to take the first baseline right after creating a monitor, to check a page on demand, or to try a new goal. It works on paused monitors too, and does not move the schedule.
Example request
curl -X POST "https://api.prefetch.io/monitor/mon_3f9a1c2b7d4e4f6a8b0c1d2e3f4a5b6c/run" \
-H "X-API-Key: $PREFETCH_API_KEY"
const base = "https://api.prefetch.io";
const headers = { "X-API-Key": process.env.PREFETCH_API_KEY };
const run = await fetch(`${base}/monitor/${monitorId}/run`, { method: "POST", headers });
const { data: queued } = await run.json();
// Wait for the check, then show only what changed.
let check;
do {
await new Promise((r) => setTimeout(r, 3000));
const res = await fetch(`${base}/monitor/${monitorId}/checks/${queued.id}?status=changed`, { headers });
({ data: check } = await res.json());
} while (check.status === "queued" || check.status === "running");
for (const page of check.pages) console.log(page.url, page.diff?.text ?? page.diff?.fields);
import os, time, requests
base = "https://api.prefetch.io"
headers = {"X-API-Key": os.environ["PREFETCH_API_KEY"]}
queued = requests.post(f"{base}/monitor/{monitor_id}/run", headers=headers).json()["data"]
while True:
time.sleep(3)
check = requests.get(
f"{base}/monitor/{monitor_id}/checks/{queued['id']}",
params={"status": "changed"},
headers=headers,
).json()["data"]
if check["status"] not in ("queued", "running"):
break
for page in check["pages"]:
print(page["url"], page["diff"])
Example response
{
"success": true,
"data": {
"id": "chk_8e2d4f6a1b3c4d5e6f7a8b9c0d1e2f3a",
"monitor_id": "mon_3f9a1c2b7d4e4f6a8b0c1d2e3f4a5b6c",
"status": "queued",
"trigger": "manual",
"scheduled_for": null,
"started_at": null,
"finished_at": null,
"estimated_credits": 55,
"actual_credits": 0,
"summary": { "total_pages": 0, "same": 0, "new": 0, "changed": 0, "removed": 0, "error": 0 },
"target_results": null,
"error": null,
"created_at": "2026-10-09T10:05:00.000Z",
"updated_at": "2026-10-09T10:05:00.000Z"
},
"meta": {
"requestId": "a3e6c7d8-9f0a-4b12-93c4-5e6f708192a3",
"durationMs": 38
}
}
202 Accepted — the check has been queued, not run.
One check at a time
A monitor runs one check at a time. If one is already queued or running, this returns409 and names it — wait for it to finish rather than retrying in a loop. The same rule applies to scheduled checks: one that comes due while the previous is still running is recorded as skipped_overlap instead of running alongside it.
Credits
A manual check is billed exactly like a scheduled one: 1 credit per page fetched (4 on targets trackingjson), plus 1 per changed page judged against the goal. estimated_credits is the upper bound; actual_credits on the finished check is what was charged.
Related
GET /monitor/{id}/checks/{checkId}
Read the check’s results.
POST /monitor
How monitors detect and report changes.
Authorizations
Your Prefetch API key. Obtain one from the dashboard.
Path Parameters
The monitor id returned by POST /monitor.
Example:
"mon_3f9a1c2b7d4e4f6a8b0c1d2e3f4a5b6c"