API 02 · Runs on Vercel

Website Monitor

Creates a persistent monitor that checks availability, response time and visible-content changes on a schedule (every 5 minutes to 24 hours). The first check runs immediately. Transitions emit monitor.down, monitor.up and monitor.content_changed notifications, and optional HMAC-signed webhooks. History and uptime percentages are kept for 30 days.

POST https://dev.itsozy.lol/api/v1/monitor
Runs on Vercel. Checks run inside the Rust function. Scheduled checks are triggered by /api/v1/internal/tick (Supabase pg_cron every minute when configured; Vercel daily cron as fallback).

Authentication

Send Authorization: Bearer ozy_… with an API key that includes the monitor permission (or *). Signed-in dashboard sessions work in the playground. Each call costs 1 unit.

Parameters

NameTypeDescription
urlstringrequiredPublic http(s) URL to monitor
interval_secondsintegeroptional300-86400 (default 300)
selectorstringoptionalCSS selector; content changes are detected on its visible text only
webhook_urlstringoptionalPublic https URL for signed event deliveries

Example request

curl -X POST https://dev.itsozy.lol/api/v1/monitor \
  -H "Authorization: Bearer $OZY_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com", "interval_seconds": 300, "selector": "main"}'

Example response (illustrative)

{
  "history": [
    {
      "available": true,
      "changed": false,
      "duration_ms": 182,
      "status": 200
    }
  ],
  "monitor": {
    "id": "6f1c…",
    "interval_seconds": 300,
    "last_available": true,
    "last_status": 200,
    "url": "https://example.com/"
  },
  "stats": {
    "average_response_ms_24h": 182,
    "checks": 1,
    "uptime_24h": 100.0
  }
}

Related endpoints

Errors

Errors use one envelope: {"error": {"code": "…", "message": "…"}}.

StatusCodeMeaning
403destination_blockedURL resolves to a private, loopback, metadata or non-standard-port destination
403robots_deniedThe site's robots.txt disallows OzyScrape
413response_too_largeUpstream response exceeded 2 MiB
429domain_rate_limitedWait one second between requests to the same host
502upstream_failedThe site could not be reached
504upstream_timeoutThe site did not respond in time
400invalid_inputA parameter is missing or invalid
401unauthorizedNo valid API key or session
403permission_deniedThe key does not include this API's permission
429quota_exceededFree-tier quota reached (20 units/min, 100 units/day)
503database_unavailablePersistent storage is temporarily unavailable

Rate limits

20 units per minute and 100 units per day per account; outbound fetches to the same host are spaced at least one second apart. Exceeding a limit returns 429.