API 08 · Vercel + optional worker
Website Performance
By default measures a real HTTP fetch from the Vercel region: total time, time to first byte, HTML bytes, redirect chain and declared sub-resources. Responses state `measurement: "http_fetch"`. With `browser: true` the worker loads the page in Chromium and returns Navigation Timing and paint metrics, labelled `measurement: "browser"`.
POST https://dev.itsozy.lol/api/v1/performanceAuthentication
Send Authorization: Bearer ozy_… with an API key that includes the performance 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 |
browser | boolean | optional | Real browser metrics via the worker |
Example request
curl -X POST https://dev.itsozy.lol/api/v1/performance \
-H "Authorization: Bearer $OZY_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}'
Example response (illustrative)
{
"browser_metrics": null,
"declared_resource_count": 0,
"elapsed_ms": 241,
"first_byte_ms": 198,
"html_bytes": 1256,
"measurement": "http_fetch",
"redirect_count": 0,
"status": 200,
"url": "https://example.com/"
}
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.