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/createRuns 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
| Name | Type | Description | |
|---|---|---|---|
name | string | required | Display name (1-80 bytes) |
url | string | required | Public page to extract from |
rules[] | object[] | required | OzyScrape rules (see Web Scraper) |
refresh_seconds | integer | optional | 300-86400 (default 3600) |
markdown | boolean | optional | Include 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": "…"}}.
| 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.