# Monitor websites for changes

> Watch pages or whole sites on a rhythm you write in words – "weekdays at 09:30" – and get an e-mail or webhook when pages appear, disappear or change, with a report of every run.

Source: https://docs.virginproxy.com/monitors/

A monitor is a [schedule](https://docs.virginproxy.com/automation/#schedules) with `"track": "pages"`: every run reads your pages (a list or a whole site), compares them with the run before, and tells you what is new, what is gone and what changed – by e-mail, webhook, or in the dashboard under **Monitors**.

## Create a monitor

**cURL**

```bash
curl https://api.virginproxy.com/v1/schedules \
  -H "Authorization: Bearer $VP_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Docs watch",
    "every": "weekdays at 09:30",
    "max_credits": 200,
    "track": "pages",
    "notify": {
      "email": true,
      "webhook": false
    },
    "crawl": {
      "url": "https://docs.example.com/",
      "max_pages": 100,
      "request": {
        "format": "markdown",
        "main_content": true
      }
    }
  }'
```

**Python**

```python
import os, requests

r = requests.post(
    "https://api.virginproxy.com/v1/schedules",
    headers={"Authorization": "Bearer " + os.environ["VP_KEY"]},
    json={
        "name": "Docs watch",
        "every": "weekdays at 09:30",
        "max_credits": 200,
        "track": "pages",
        "notify": {"email": True, "webhook": False},
        "crawl": {
            "url": "https://docs.example.com/",
            "max_pages": 100,
            "request": {"format": "markdown", "main_content": True},
        },
    },
    timeout=30,
)
data = r.json()
if not r.ok:
    raise SystemExit(data["error"]["code"] + ": " + data["error"]["message"])
print(data["status"], data["cost"]["credits"])
```

**Node.js**

```javascript
const res = await fetch("https://api.virginproxy.com/v1/schedules", {
  method: "POST",
  headers: { Authorization: "Bearer " + process.env.VP_KEY, "Content-Type": "application/json" },
  body: JSON.stringify({
    name: "Docs watch",
    every: "weekdays at 09:30",
    max_credits: 200,
    track: "pages",
    notify: { email: true, webhook: false },
    crawl: {
      url: "https://docs.example.com/",
      max_pages: 100,
      request: { format: "markdown", main_content: true },
    },
  }),
  signal: AbortSignal.timeout(30_000),
});
const data = await res.json();
if (!res.ok) throw new Error(data.error.code + ": " + data.error.message);
console.log(data.status, data.cost.credits);
```

**Python SDK**

```pysdk
from virginproxy import VirginProxy  # docs.virginproxy.com/sdk/virginproxy.py

vp = VirginProxy()  # reads VP_KEY
data = vp.create_schedule({
    "name": "Docs watch",
    "every": "weekdays at 09:30",
    "max_credits": 200,
    "track": "pages",
    "notify": {"email": True, "webhook": False},
    "crawl": {
        "url": "https://docs.example.com/",
        "max_pages": 100,
        "request": {"format": "markdown", "main_content": True},
    },
})
print(data)
```

**Node SDK**

```nodesdk
import { VirginProxy } from "./virginproxy.mjs"; // docs.virginproxy.com/sdk/virginproxy.mjs

const vp = new VirginProxy(); // reads VP_KEY
const data = await vp.createSchedule({
  name: "Docs watch",
  every: "weekdays at 09:30",
  max_credits: 200,
  track: "pages",
  notify: { email: true, webhook: false },
  crawl: {
    url: "https://docs.example.com/",
    max_pages: 100,
    request: { format: "markdown", main_content: true },
  },
});
console.log(data);
```

**PHP**

```php
<?php
$ch = curl_init("https://api.virginproxy.com/v1/schedules");
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("VP_KEY"),
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => json_encode([
        "name" => "Docs watch",
        "every" => "weekdays at 09:30",
        "max_credits" => 200,
        "track" => "pages",
        "notify" => ["email" => true, "webhook" => false],
        "crawl" => [
            "url" => "https://docs.example.com/",
            "max_pages" => 100,
            "request" => ["format" => "markdown", "main_content" => true],
        ],
    ], JSON_UNESCAPED_SLASHES),
]);
$data = json_decode(curl_exec($ch), true);
if (isset($data["error"])) {
    exit($data["error"]["code"] . ": " . $data["error"]["message"] . PHP_EOL);
}
echo $data["status"], " ", $data["cost"]["credits"], PHP_EOL;
```

**Go**

```go
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"log"
	"net/http"
	"os"
	"time"
)

func main() {
	payload := []byte(`{
  "name": "Docs watch",
  "every": "weekdays at 09:30",
  "max_credits": 200,
  "track": "pages",
  "notify": {
    "email": true,
    "webhook": false
  },
  "crawl": {
    "url": "https://docs.example.com/",
    "max_pages": 100,
    "request": {
      "format": "markdown",
      "main_content": true
    }
  }
}`)
	req, err := http.NewRequest("POST", "https://api.virginproxy.com/v1/schedules", bytes.NewReader(payload))
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("Authorization", "Bearer "+os.Getenv("VP_KEY"))
	req.Header.Set("Content-Type", "application/json")

	client := &http.Client{Timeout: 30 * time.Second}
	res, err := client.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer res.Body.Close()

	var data map[string]any
	if err := json.NewDecoder(res.Body).Decode(&data); err != nil {
		log.Fatal(err)
	}
	if res.StatusCode >= 300 {
		e := data["error"].(map[string]any)
		log.Fatalf("%v: %v", e["code"], e["message"])
	}
	fmt.Println(data["status"], data["cost"].(map[string]any)["credits"])
}
```

POST`/v1/schedules`

*Response (shortened):*

```json
{
  "id": "sch_4mK9xQ2pLs7Vn1bZ0cR8",
  "name": "Docs watch",
  "every": "weekdays at 09:30",
  "rhythm": "weekdays at 09:30",
  "time_zone": "Europe/Berlin",
  "notify": { "email": true, "webhook": false },
  "track": "pages",
  "next_runs": ["2026-12-01T08:30:00.000Z", "2026-12-02T08:30:00.000Z", "2026-12-03T08:30:00.000Z"],
  "kind": "crawl",
  "max_credits": 200,
  "status": "active",
  "runs": 0
}
```

## A rhythm in words

`every` takes the fixed intervals (`15m`, `1h`, `1d` …) or a rhythm in words, in your account's time zone (Settings in the dashboard; summer and winter time are handled):

| You write | Runs |
| --- | --- |
| `every 30 minutes` | every 30 minutes, counted from now |
| `hourly`, `every 6 hours` | every hour, every 6 hours |
| `daily at 08:00` | every day at 08:00 |
| `weekdays at 09:30` | Monday to Friday at 09:30 |
| `weekly on monday at 07:00` | Mondays at 07:00 |
| `every mon, wed and fri at 18:15` | those days at 18:15 |
| `every 2 days` | every 48 hours |

Check a rhythm before you save it: `POST /v1/schedules/preview` with `{"every": "…"}` says it back as it will be stored, whether your plan allows it, and the next three runs. How often a plan may run a schedule: free every 1 day, starter every 60 minutes, growth every 15 minutes, scale every 5 minutes; at least every 5 minutes for anyone.

## What counts as a change

- **New**: a page this run read that the last run did not (a crawl found it, or it answered again).
- **Removed**: a page of the last run that this run did not find. When pages of a run failed or were not reached (its cap, your credits, a time-out), nothing counts as removed in that run (the report says `"complete": false`) and those pages keep their last state; a run that read nothing at all is not compared.
- **Changed**: the content is different. What is compared: `extracted` when you read fields with `extract`, else `auto_extracted` or `parsed`, else the page as returned – so with `format: "markdown"` and `main_content` a new timestamp in the footer does not count.

The first run only records the pages (`"first_run": true`); changes are reported from the second run on.

## E-mail and webhook

`notify.email`: an e-mail to your account address (and the extra addresses you confirmed for alerts) with the counts and the first addresses – at most one per monitor and hour. `notify.webhook`: a delivery `alert.monitor_changed` to your [alert webhook](https://docs.virginproxy.com/webhooks/#alerts) (also as a Slack message). The dashboard shows every change as a notice either way.

## Reports

`GET /v1/schedules/{id}/reports`: one report per finished run, newest first; the last 100 are kept. The lists hold up to 200 addresses each; the counts are complete.

*GET /v1/schedules/sch_…/reports:*

```json
{
  "items": [
    {
      "job": "job_N2xV8cQ0mLp4Rz7Tb1Ws",
      "at": "2026-12-02T08:31:12.000Z",
      "first_run": false,
      "pages": 96,
      "counts": { "added": 2, "removed": 1, "changed": 3 },
      "added": ["https://docs.example.com/new-endpoint/", "https://docs.example.com/changelog/2026-12/"],
      "removed": ["https://docs.example.com/old-guide/"],
      "changed": ["https://docs.example.com/pricing/", "https://docs.example.com/limits/", "https://docs.example.com/"]
    }
  ]
}
```

## What it costs

Each run is an ordinary job or crawl: every page read is a request with its usual price, and `max_credits` caps every run. Comparing, reports and notifications are free.

> **Tip:** Watch only what matters: read the prices with `extract` (or `auto_extract: "product"`) and the monitor reports a page as changed only when those fields change.

> **Note:** A crawl with [`only_changed`](https://docs.virginproxy.com/crawl/#only-changed) in a monitor also leaves unchanged pages out of results, exports, deliveries and item webhooks.
