Skip to main content
GET
/
monitors
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 monitors = await client.monitors.list();

console.log(monitors.data);
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
)
monitors = client.monitors.list()
print(monitors.data)
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"),
)
monitors, err := client.Monitors.List(context.TODO(), contextdev.MonitorListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", monitors.Data)
}
require "context_dev"

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

monitors = context_dev.monitors.list

puts(monitors)
<?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 {
$monitors = $client->monitors->list(
changeDetectionType: 'exact',
cursor: 'cursor',
limit: 1,
q: 'q',
searchBy: ['name'],
searchType: 'exact',
status: 'active',
tag: 'tag',
tags: ['string'],
targetType: 'page',
);

var_dump($monitors);
} catch (APIException $e) {
echo $e->getMessage();
}
context-dev monitors list \
--api-key 'My API Key'
curl --request GET \
--url https://api.context.dev/v1/monitors \
--header 'Authorization: Bearer <token>'
HttpResponse<String> response = Unirest.get("https://api.context.dev/v1/monitors")
.header("Authorization", "Bearer <token>")
.asString();
{
  "data": [
    {
      "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"
      }
    }
  ],
  "has_more": true,
  "next_cursor": "<string>"
}
{
"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.

Query Parameters

q
string

Free-text search term, matched against the fields named in search_by.

Maximum string length: 200
search_by
enum<string>[]

Comma-separated fields to search with q. Defaults to all of them. Note instructions only exists on extract monitors.

Available options:
name,
url,
instructions,
tags
search_type
enum<string>
default:prefix

prefix for as-you-type prefix matching (default), exact for full-token matching.

Available options:
exact,
prefix
target_type
enum<string>
Available options:
page,
sitemap,
extract
change_detection_type
enum<string>
Available options:
exact,
semantic
status
enum<string>

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
tags
string[]

Comma-separated list of tags to filter by (matches monitors having any of them).

tag
string

Filter to items that have this tag.

limit
integer
default:25
Required range: 1 <= x <= 100
cursor
string

Response

A paginated list of monitors

data
Monitor · object[]
required
has_more
boolean
required
next_cursor
string | null
required