const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.context.dev/v1/monitors', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.context.dev/v1/monitors"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)require 'uri'
require 'net/http'
url = URI("https://api.context.dev/v1/monitors")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.context.dev/v1/monitors"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.context.dev/v1/monitors",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}curl --request GET \
--url https://api.context.dev/v1/monitors \
--header 'Authorization: Bearer <token>'{
"data": [
{
"mode": "web",
"id": "mon_123",
"name": "Acme pricing monitor",
"target": {
"type": "page",
"url": "https://acme.com/pricing",
"instructions": "Report pricing or plan availability changes. Ignore counters, timestamps, testimonials, and navigation.",
"normalize_whitespace": true,
"include_selectors": [
"#attraction-details"
],
"exclude_selectors": [
".carousel",
"[id^=\"TA_\"]"
],
"actions": [
{
"do": "wait",
"timeMs": 15000
}
]
},
"change_detection": {
"type": "exact"
},
"schedule": {
"type": "interval",
"frequency": 6,
"unit": "hours"
},
"status": "active",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"webhook": {
"url": "https://example.com/webhook",
"events": [
"change.detected",
"run.completed"
],
"retry": {
"delays_seconds": [
10,
60,
300,
1800,
7200,
21600,
57600
]
},
"secret": "whsec_8f3a…"
},
"last_run_at": "2023-11-07T05:31:56Z",
"last_change_at": "2023-11-07T05:31:56Z",
"next_run_at": "2023-11-07T05:31:56Z",
"last_error": {
"code": "fetch_failed",
"message": "The target URL could not be fetched."
},
"webhook_failure": {
"consecutive_failures": 3,
"last_status": "rejected",
"last_message": "Webhook endpoint returned HTTP 429.",
"last_failed_at": "2023-11-07T05:31:56Z"
},
"tags": [
"pricing",
"competitor"
],
"baseline": {
"text": "Acme Pricing\nStarter $9/mo…",
"captured_at": "2023-11-07T05:31:56Z"
}
}
],
"has_more": true,
"next_cursor": "<string>",
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"message": "<string>",
"error_code": "RATE_LIMITED",
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}List monitors
List your monitors with optional search and filters.
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.context.dev/v1/monitors', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.context.dev/v1/monitors"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)require 'uri'
require 'net/http'
url = URI("https://api.context.dev/v1/monitors")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.context.dev/v1/monitors"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.context.dev/v1/monitors",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}curl --request GET \
--url https://api.context.dev/v1/monitors \
--header 'Authorization: Bearer <token>'{
"data": [
{
"mode": "web",
"id": "mon_123",
"name": "Acme pricing monitor",
"target": {
"type": "page",
"url": "https://acme.com/pricing",
"instructions": "Report pricing or plan availability changes. Ignore counters, timestamps, testimonials, and navigation.",
"normalize_whitespace": true,
"include_selectors": [
"#attraction-details"
],
"exclude_selectors": [
".carousel",
"[id^=\"TA_\"]"
],
"actions": [
{
"do": "wait",
"timeMs": 15000
}
]
},
"change_detection": {
"type": "exact"
},
"schedule": {
"type": "interval",
"frequency": 6,
"unit": "hours"
},
"status": "active",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"webhook": {
"url": "https://example.com/webhook",
"events": [
"change.detected",
"run.completed"
],
"retry": {
"delays_seconds": [
10,
60,
300,
1800,
7200,
21600,
57600
]
},
"secret": "whsec_8f3a…"
},
"last_run_at": "2023-11-07T05:31:56Z",
"last_change_at": "2023-11-07T05:31:56Z",
"next_run_at": "2023-11-07T05:31:56Z",
"last_error": {
"code": "fetch_failed",
"message": "The target URL could not be fetched."
},
"webhook_failure": {
"consecutive_failures": 3,
"last_status": "rejected",
"last_message": "Webhook endpoint returned HTTP 429.",
"last_failed_at": "2023-11-07T05:31:56Z"
},
"tags": [
"pricing",
"competitor"
],
"baseline": {
"text": "Acme Pricing\nStarter $9/mo…",
"captured_at": "2023-11-07T05:31:56Z"
}
}
],
"has_more": true,
"next_cursor": "<string>",
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"message": "<string>",
"error_code": "RATE_LIMITED",
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}monitors:read permission. See the guide for examples and usage.Authorizations
Send Authorization: Bearer <API_KEY>. Keys have full access unless restricted to scopes.
Query Parameters
Free-text search term, matched against the fields named in search_by.
200"pricing"
Fields to search with q. Defaults to all fields; page and extract targets can have instructions.
name, url, instructions, tags "name,url"
prefix for as-you-type prefix matching (default), exact for full-token matching.
exact, prefix Filter monitors by lifecycle status.
active, paused, failed Filter by target type.
page, sitemap, extract Filter by change detection type.
exact, semantic Comma-separated list of tags to filter by (matches monitors having any of them).
201 - 50"pricing,competitor"
Filter to items that have this tag.
"pricing"
Maximum number of items to return per page (1-100). Defaults to 25.
1 <= x <= 100Opaque pagination cursor from a previous response.
Response
A paginated list of monitors
Show child attributes
Show child attributes
Unique ID of this request, also in X-Request-Id. Include it when contacting support.
"3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91"
Credits this request used and your remaining balance.
Show child attributes
Show child attributes
Was this page helpful?