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/monitorAuthentication
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
| Name | Type | Description | |
|---|---|---|---|
url | string | required | Public http(s) URL to monitor |
interval_seconds | integer | optional | 300-86400 (default 300) |
selector | string | optional | CSS selector; content changes are detected on its visible text only |
webhook_url | string | optional | Public 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": "…"}}.
| Status | Code | Meaning |
|---|---|---|
| 403 | destination_blocked | URL resolves to a private, loopback, metadata or non-standard-port destination |
| 403 | robots_denied | The site's robots.txt disallows OzyScrape |
| 413 | response_too_large | Upstream response exceeded 2 MiB |
| 429 | domain_rate_limited | Wait one second between requests to the same host |
| 502 | upstream_failed | The site could not be reached |
| 504 | upstream_timeout | The site did not respond in time |
| 400 | invalid_input | A parameter is missing or invalid |
| 401 | unauthorized | No valid API key or session |
| 403 | permission_denied | The key does not include this API's permission |
| 429 | quota_exceeded | Free-tier quota reached (20 units/min, 100 units/day) |
| 503 | database_unavailable | Persistent 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.