API 11 · Runs on Vercel

Website to API

Saves a named extraction (URL + OzyScrape rules) for permitted public data and runs it immediately. The result is cached and served from GET /api/v1/extract/{id}; refreshes happen on a schedule (5 minutes to 24 hours) or on demand with ?refresh=true (at most once a minute). Usage counters track reads and refreshes.

POST https://dev.itsozy.lol/api/v1/extract/create
Runs on Vercel. Runs on Vercel. Scheduled refreshes are triggered by /api/v1/internal/tick.

Authentication

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

Parameters

NameTypeDescription
namestringrequiredDisplay name (1-80 bytes)
urlstringrequiredPublic page to extract from
rules[]object[]requiredOzyScrape rules (see Web Scraper)
refresh_secondsintegeroptional300-86400 (default 3600)
markdownbooleanoptionalInclude Markdown in results

Example request

curl -X POST https://dev.itsozy.lol/api/v1/extract/create \
  -H "Authorization: Bearer $OZY_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Rust releases", "url": "https://blog.rust-lang.org/", "rules": [{"name": "titles", "selector": "table a"}], "refresh_seconds": 3600}'

Example response (illustrative)

{
  "endpoint": "https://dev.itsozy.lol/api/v1/extract/9b0e…",
  "id": "9b0e…",
  "name": "Rust releases",
  "result": {
    "fields": {
      "titles": {
        "match_type": "exact",
        "values": [
          "…"
        ]
      }
    }
  },
  "usage": {
    "fetch_count": 0,
    "refresh_count": 1
  }
}

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.