API 07 · Runs on Vercel

Link Preview

Fetches a page with robots.txt respected and returns normalised preview metadata with absolute URLs, plus Open Graph, Twitter card and article meta tags.

GET https://dev.itsozy.lol/api/v1/preview
Runs on Vercel. Fully served by the Rust function on Vercel.

Authentication

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

Parameters

NameTypeDescription
urlquery stringrequiredPublic http(s) URL

Example request

curl "https://dev.itsozy.lol/api/v1/preview?url=https://github.com" \
  -H "Authorization: Bearer $OZY_KEY"

Example response (illustrative)

{
  "metadata": {
    "canonical_url": "https://github.com/",
    "description": "…",
    "favicon": "https://github.githubassets.com/favicons/favicon.svg",
    "image": "https://github.githubassets.com/…png",
    "language": "en",
    "site_name": "GitHub",
    "title": "GitHub"
  },
  "public_metadata": {
    "og:type": "object"
  },
  "status": 200,
  "url": "https://github.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.