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/performance
Vercel + optional worker. HTTP timing runs on Vercel. Browser metrics need the optional worker.

Authentication

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

NameTypeDescription
urlstringrequiredPublic http(s) URL
browserbooleanoptionalReal 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": "…"}}.

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.