Skip to main content
GET
/
monitors
/
{monitor_id}
JavaScript
import ContextDev from 'context.dev';

const client = new ContextDev({
  apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted
});

const monitor = await client.monitors.retrieve('mon_123');

console.log(monitor.id);
import os
from context.dev import ContextDev

client = ContextDev(
api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted
)
monitor = client.monitors.retrieve(
"mon_123",
)
print(monitor.id)
package main

import (
"context"
"fmt"

"github.com/context-dot-dev/context-go-sdk"
"github.com/context-dot-dev/context-go-sdk/option"
)

func main() {
client := contextdev.NewClient(
option.WithAPIKey("My API Key"),
)
monitor, err := client.Monitors.Get(context.TODO(), "mon_123")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", monitor.ID)
}
require "context_dev"

context_dev = ContextDev::Client.new(api_key: "My API Key")

monitor = context_dev.monitors.retrieve("mon_123")

puts(monitor)
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use ContextDev\Client;
use ContextDev\Core\Exceptions\APIException;

$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');

try {
$monitor = $client->monitors->retrieve('mon_123');

var_dump($monitor);
} catch (APIException $e) {
echo $e->getMessage();
}
context-dev monitors retrieve \
--api-key 'My API Key' \
--monitor-id mon_123
curl --request GET \
--url https://api.context.dev/v1/monitors/{monitor_id} \
--header 'Authorization: Bearer <token>'
HttpResponse<String> response = Unirest.get("https://api.context.dev/v1/monitors/{monitor_id}")
.header("Authorization", "Bearer <token>")
.asString();
{
  "mode": "web",
  "id": "mon_123",
  "name": "Acme pricing monitor",
  "target": {
    "type": "page",
    "url": "https://acme.com/pricing",
    "normalize_whitespace": true
  },
  "change_detection": {
    "type": "exact"
  },
  "schedule": {
    "type": "interval",
    "frequency": 6,
    "unit": "hours"
  },
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "webhook": {
    "url": "https://example.com/webhook",
    "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."
  },
  "tags": [
    "pricing",
    "competitor"
  ],
  "baseline": {
    "text": "Acme Pricing\nStarter $9/mo…",
    "captured_at": "2023-11-07T05:31:56Z"
  }
}
{
"message": "<string>",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}
{
"message": "<string>",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}
0 Credits

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

monitor_id
string
required

Response

Monitor

A web monitor. mode is the constant web; behavior is described by target (page/sitemap/extract) and change_detection (exact/semantic).

mode
enum<string>
required

Top-level monitor category. Always web today; the concrete behavior is described by target and change_detection.

Available options:
web
id
string
required
Example:

"mon_123"

name
string
required
Example:

"Acme pricing monitor"

target
Page target · object
required

Discriminated union describing what the monitor watches.

change_detection
Exact · object
required

Discriminated union describing how changes are detected.

schedule
Interval · object
required

Discriminated union describing how the monitor is scheduled. Only interval is supported today; cron and exact_time are reserved for future use.

status
enum<string>
required

Monitor lifecycle status. failed means the most recent run failed (see the monitor's last_error); failed monitors keep running on schedule and flip back to active on the next successful run. Monitors are auto-paused after repeated consecutive failures or insufficient-credit skips; resume by PATCHing status to active.

Available options:
active,
paused,
failed
created_at
string<date-time>
required
updated_at
string<date-time>
required
webhook
object | null
last_run_at
string<date-time> | null
last_change_at
string<date-time> | null
next_run_at
string<date-time> | null

When the next scheduled run is due.

last_error
object | null

Error from the most recent failed run; null when the last run succeeded.

tags
string[]

User-defined tags for grouping and filtering monitors and their changes.

Maximum array length: 20
Required string length: 1 - 50
Example:
["pricing", "competitor"]
baseline
Page baseline · object

Current baseline: the last observed value the monitor compares new snapshots against. Its shape follows target.type (page/sitemap/extract). Only populated on GET /monitors/{monitor_id}; null until the first baseline run completes (and after a target or change_detection update, which resets the baseline).