# Monitor

> Watch onion pages, sites or searches on a schedule and read what is new, changed or gone.

`/v2/monitor` is Firecrawl’s scheduled monitor API. A monitor has a schedule and one or more targets. Each check reads every target and reports, page by page, what is new, what changed and what is gone. With a `goal`, a model also judges each change.

**curl**

```bash
curl -X POST https://api.darkcrawl.dev/v2/monitor \
  -H "Authorization: Bearer $DARKCRAWL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Notice board","schedule":{"text":"every 6 hours","timezone":"Europe/Berlin"},"targets":[{"type":"scrape","urls":["http://exampleonionq7x2mfk4lzr5w3ty6hbnc2jdu7avs4ekp5gw3xmlq2zr.onion/notice"]}]}'
```

**Python**

```python
import os
import requests

resp = requests.post(
    "https://api.darkcrawl.dev/v2/monitor",
    headers={"Authorization": "Bearer " + os.environ["DARKCRAWL_API_KEY"]},
    json={
        "name": "Notice board",
        "schedule": {
            "text": "every 6 hours",
            "timezone": "Europe/Berlin",
        },
        "targets": [
            {
                "type": "scrape",
                "urls": ["http://exampleonionq7x2mfk4lzr5w3ty6hbnc2jdu7avs4ekp5gw3xmlq2zr.onion/notice"],
            },
        ],
    },
    timeout=330,
)
print(resp.json())
```

**Node**

```javascript
const resp = await fetch("https://api.darkcrawl.dev/v2/monitor", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.DARKCRAWL_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "name": "Notice board",
    "schedule": {
      "text": "every 6 hours",
      "timezone": "Europe/Berlin"
    },
    "targets": [
      {
        "type": "scrape",
        "urls": [
          "http://exampleonionq7x2mfk4lzr5w3ty6hbnc2jdu7avs4ekp5gw3xmlq2zr.onion/notice"
        ]
      }
    ]
  }),
  signal: AbortSignal.timeout(330000),
});
console.log(await resp.json());
```

```json
{
  "success": true,
  "data": {
    "id": "01K0EXAMPLEMONITOR0000000A",
    "name": "Notice board",
    "status": "active",
    "schedule": {
      "cron": "0 */6 * * *",
      "timezone": "Europe/Berlin"
    },
    "nextRunAt": "2026-11-26T10:00:00+00:00",
    "lastRunAt": null,
    "currentCheckId": null,
    "targets": [
      {
        "id": "01K0EXAMPLETARGET00000000A",
        "type": "scrape",
        "urls": [
          "http://exampleonionq7x2mfk4lzr5w3ty6hbnc2jdu7avs4ekp5gw3xmlq2zr.onion/notice"
        ]
      }
    ],
    "webhook": null,
    "notification": {},
    "retentionDays": 30,
    "estimatedCreditsPerMonth": 0,
    "lastCheckSummary": null,
    "goal": null,
    "judgeEnabled": false,
    "channelIds": [],
    "createdAt": "2026-11-26T10:00:00+00:00",
    "updatedAt": "2026-11-26T10:00:00+00:00"
  }
}
```

## Routes

| Route                                            | What it does                                                                         |
| ------------------------------------------------ | ------------------------------------------------------------------------------------ |
| `POST /v2/monitor`                               | Creates a monitor.                                                                   |
| `GET /v2/monitor?limit=&offset=`                 | Lists monitors, newest first.                                                        |
| `GET /v2/monitor/{monitor_id}`                   | Reads one monitor.                                                                   |
| `PATCH /v2/monitor/{monitor_id}`                 | Changes what the body sends, and nothing else. A body that changes nothing is `400`. |
| `DELETE /v2/monitor/{monitor_id}`                | Deletes the monitor with its checks. Captures stay.                                  |
| `POST /v2/monitor/{monitor_id}/run`              | Runs a check now.                                                                    |
| `GET /v2/monitor/{monitor_id}/checks`            | Lists checks, newest first. `status` picks one check status.                         |
| `GET /v2/monitor/{monitor_id}/checks/{check_id}` | Reads one check with its pages.                                                      |

Requests are strict: an unknown field is a `400`. Ids are DarkCrawl’s own 26-character ids, not UUIDs.

## Fields

| Field           | What it does                                                                                                               |
| --------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `name`          | 1 to 256 characters.                                                                                                       |
| `schedule`      | `{"cron": ...}` or `{"text": ...}`, never both, with an optional `timezone` such as `Europe/Berlin` (`UTC` when left out). |
| `targets`       | 1 to 50 targets, described below.                                                                                          |
| `goal`          | Up to 2000 characters. A model judges each change against it, and the check needs a model provider on the server.          |
| `judgeEnabled`  | Turns the goal check on or off. On by default when `goal` is not empty.                                                    |
| `retentionDays` | How long checks are kept, 1 to 365.                                                                                        |
| `channelIds`    | DarkCrawl’s own. Alert channels that get an alert when a change is found.                                                  |
| `webhook`       | A URL, or `{url, headers, metadata, events}`. See [Webhooks](https://darkcrawl.dev/docs/api-reference/webhooks/).          |
| `status`        | `active` or `paused`. `PATCH` only.                                                                                        |

`notification` is accepted and not used: turning on its email or Slack entry is `400 NOT_IMPLEMENTED`. Name a channel in `channelIds` instead. `origin` is accepted and ignored.

### Targets

| Target   | Fields                                                                                                                                                                              |
| -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `scrape` | `urls`: 1 to 50 onion URLs, each checked as a scrape’s URL is.                                                                                                                      |
| `crawl`  | `url`: one onion URL, and optional `crawlOptions` such as `limit`, `maxDiscoveryDepth`, `includePaths` and `excludePaths`.                                                          |
| `search` | `queries`: 1 to 12 searches of 1 to 256 characters, `maxResults` and DarkCrawl’s own `sources` (`captures` and `ahmia`). A search target needs a `goal` while the goal check is on. |

`scrapeOptions` takes `onlyMainContent`, `timeout`, `checkPromptInjection` and the `markdown` and `changeTracking` formats. Any other option is `400 NOT_IMPLEMENTED`, and it names the field. A target’s changes are found in the Markdown only.

### Schedules

`text` takes `every N minutes`, `hourly`, `every N hours`, `daily` (optionally `at 9`, `at 9:30` or `at 5:30 pm`) and `weekly`. It is stored, and shown, as the cron it becomes. Any other text is `400`. A cron has 5 fields and is read in the schedule’s timezone.

Checks run at most every 15 minutes by default. A schedule that comes closer is a `400`. `POST /v2/monitor/{monitor_id}/run` has a cooldown of its own and answers `409` while a check is queued or running, or while the monitor is paused.

## Read a check

A run-now answers with the new check’s `id`. Read the check until its `status` is `completed`, `partial` or `failed`.

**curl**

```bash
curl -X POST https://api.darkcrawl.dev/v2/monitor/MONITOR_ID/run \
  -H "Authorization: Bearer $DARKCRAWL_API_KEY"
```

**Python**

```python
import os
import requests

resp = requests.post(
    "https://api.darkcrawl.dev/v2/monitor/MONITOR_ID/run",
    headers={"Authorization": "Bearer " + os.environ["DARKCRAWL_API_KEY"]},
    timeout=330,
)
print(resp.json())
```

**Node**

```javascript
const resp = await fetch("https://api.darkcrawl.dev/v2/monitor/MONITOR_ID/run", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.DARKCRAWL_API_KEY,
  },
  signal: AbortSignal.timeout(330000),
});
console.log(await resp.json());
```

```json
{
  "success": true,
  "id": "01K0EXAMPLECHECK000000000A",
  "data": {
    "id": "01K0EXAMPLECHECK000000000A",
    "monitorId": "01K0EXAMPLEMONITOR0000000A",
    "status": "queued",
    "trigger": "manual",
    "scheduledFor": "2026-11-26T10:00:00+00:00",
    "startedAt": null,
    "finishedAt": null,
    "summary": {
      "totalPages": 0,
      "same": 0,
      "changed": 0,
      "new": 0,
      "removed": 0,
      "error": 0
    },
    "error": null
  }
}
```

**curl**

```bash
curl https://api.darkcrawl.dev/v2/monitor/MONITOR_ID/checks \
  -H "Authorization: Bearer $DARKCRAWL_API_KEY"
```

**Python**

```python
import os
import requests

resp = requests.get(
    "https://api.darkcrawl.dev/v2/monitor/MONITOR_ID/checks",
    headers={"Authorization": "Bearer " + os.environ["DARKCRAWL_API_KEY"]},
    timeout=330,
)
print(resp.json())
```

**Node**

```javascript
const resp = await fetch("https://api.darkcrawl.dev/v2/monitor/MONITOR_ID/checks", {
  headers: {
    Authorization: "Bearer " + process.env.DARKCRAWL_API_KEY,
  },
  signal: AbortSignal.timeout(330000),
});
console.log(await resp.json());
```

```json
{
  "success": true,
  "data": [
    {
      "id": "01K0EXAMPLECHECK000000000A",
      "monitorId": "01K0EXAMPLEMONITOR0000000A",
      "status": "completed",
      "trigger": "manual",
      "scheduledFor": "2026-11-26T10:00:00+00:00",
      "startedAt": "2026-11-26T10:00:00+00:00",
      "finishedAt": "2026-11-26T10:00:20+00:00",
      "summary": {
        "totalPages": 1,
        "same": 0,
        "changed": 1,
        "new": 0,
        "removed": 0,
        "error": 0
      },
      "error": null
    }
  ]
}
```

A check’s `status` is `queued`, `running`, `completed` (no target failed), `partial` (some failed), `failed` (every target failed, or the check was cut short) or `skipped_overlap` (it came due while another check was still running). Its `summary` counts the pages by status.

Each page of `GET /v2/monitor/{monitor_id}/checks/{check_id}` has a `status` of `new` (its first view, or a search result not seen before), `changed` (its text differs from its last view), `same`, `removed` (it answers 404 or 410 now, after a 2xx before) or `error` (it was not read, and `error` holds a code). A `changed` page carries a `diff` in Markdown form. `previousScrapeId` and `currentScrapeId` name the two captures. A page the goal check judged carries its `judgment`.

The samples are trimmed. A real check also carries `estimatedCredits`, `reservedCredits`, `actualCredits` (always `0`), `billingStatus` (always `"not_applicable"`), `targetResults` and `notificationStatus`, and a monitor carries `emailRecipientSubscriptions` (always `[]`) and `estimatedCreditsPerMonth` (always `0`): DarkCrawl uses no credits.

## Limits

Each call counts as one request. A check reserves one page for each scrape URL and a crawl target’s `limit` for each crawl target. Searches cost no pages. A monitor can reach the plan’s limit on how many monitors you keep, and a check can reach its page limits. A goal check counts toward the day’s AI use. The values are on [Rate limits](https://darkcrawl.dev/docs/api-reference/rate-limits/).

## Reference

- [POST /v2/monitor](https://darkcrawl.dev/docs/api-reference/monitor/post-v2-monitor/)
- [GET /v2/monitor](https://darkcrawl.dev/docs/api-reference/monitor/get-v2-monitor/)
- [`GET /v2/monitor/{monitor_id}`](https://darkcrawl.dev/docs/api-reference/monitor/get-v2-monitor-monitor-id/)
- [`PATCH /v2/monitor/{monitor_id}`](https://darkcrawl.dev/docs/api-reference/monitor/patch-v2-monitor-monitor-id/)
- [`DELETE /v2/monitor/{monitor_id}`](https://darkcrawl.dev/docs/api-reference/monitor/delete-v2-monitor-monitor-id/)
- [`POST /v2/monitor/{monitor_id}/run`](https://darkcrawl.dev/docs/api-reference/monitor/post-v2-monitor-monitor-id-run/)
- [`GET /v2/monitor/{monitor_id}/checks`](https://darkcrawl.dev/docs/api-reference/monitor/get-v2-monitor-monitor-id-checks/)
- [`GET /v2/monitor/{monitor_id}/checks/{check_id}`](https://darkcrawl.dev/docs/api-reference/monitor/get-v2-monitor-monitor-id-checks-check-id/)
