Errors
Every error response is JSON with an error string and a matching HTTP status code. Most errors also carry a stable code to branch on, and may carry fix_hint (what to change), docs_url (the page for that endpoint) and retry_after:
HTTP 400
{
"error": "`url` is required",
"code": "missing_url",
"fix_hint": "Include a `url` string in the request body.",
"docs_url": "https://docs.superscraper.dev/scrape"
}Branch on code when it is present; error is a human-readable message and its wording can change.
These handlers always return a code:
| Status | code | Body | When |
|---|---|---|---|
| 401 | missing_api_key | { "error": "API key required. Pass via x-api-key header.", "code": "missing_api_key" } | No key sent |
| 401 | invalid_api_key | { "error": "Invalid or revoked API key.", "code": "invalid_api_key" } | Key not found, inactive, or revoked |
| 401 | session_required | { "error": "Sign-in required.", "code": "session_required" } | Dashboard routes: no session token |
| 401 | invalid_session | { "error": "Invalid or expired session.", "code": "invalid_session" } | Dashboard routes: session token invalid or expired |
| 403 | not_developer_surface | { "error": "This surface is not part of the developer API.", "code": "not_developer_surface" } | The route is not part of the developer API |
| 404 | not_found | { "error": "Not found", "code": "not_found", "fix_hint": "…" } | Unknown path |
| 429 | auth_rate_limited | { "error": "Too many failed authentication attempts. Retry later.", "code": "auth_rate_limited", "retryAfterSeconds" } | Too many failed authentications from your IP in the last minute. Checked before your key, so a valid key is refused too until Retry-After passes |
| 429 | rate_limited | { "error": "Rate limit exceeded", "code": "rate_limited", "limit", "tier", "retryAfterSeconds" } | Your key's per-minute window is full |
| 503 | auth_unavailable | { "error": "Auth backend not configured.", "code": "auth_unavailable" } | The auth backend is unavailable (also "Auth check failed. Try again."). Retry with backoff |
| 500 | internal_error | { "error": "Internal server error", "code": "internal_error" } | An unexpected server error |
| 504 | upstream_timeout | { "error": "Upstream timeout", "code": "upstream_timeout" } | A dependency timed out |
API-key 401s also set WWW-Authenticate: ApiKey header="x-api-key".
The API never throws raw stack traces to the client and never returns a 500 for an expected condition (a bad URL, a page that wouldn't load, a missing key). Those map to specific 4xx codes below.
Status codes
| Status | Meaning | Typical cause |
|---|---|---|
200 | OK | Request succeeded |
201 | Created | A key was provisioned (POST /v1/keys/provision) or created |
202 | Accepted | An async crawl job was queued (POST /v1/crawl) |
400 | Bad request | Missing/invalid field, malformed JSON body, invalid URL, or an SSRF-blocked URL |
401 | Unauthorized | Missing, invalid, or revoked API key |
402 | Payment required | A pay-per-call (x402) route was hit without payment, or credits are exhausted |
404 | Not found | Unknown job/resource id, or a cache-only scrape (minAge) with no cached copy |
422 | Unprocessable | The URL was valid but the page could not be fetched or parsed |
429 | Too many requests | Rate limit exceeded for your tier (rate limits) |
503 | Service unavailable | A required backend isn't configured (e.g. crawl without a job queue, or auth backend down) |
Common error bodies
| Status | Body | When |
|---|---|---|
| 400 | { "error": "Invalid JSON body", "code": "invalid_json" } | Request body isn't valid JSON, or is JSON but not an object (null, an array, a number or a string) |
| 400 | { "error": "`url` must be a string", "code": "invalid_field" } | A field that must be a string (url, domain, cookies...) was sent as another type |
| 400 | { "error": "`url` is required" } | A required field is missing |
| 400 | { "error": "Invalid URL" } | The url field isn't a valid http(s) URL |
| 400 | { "ok": false, "error": "Blocked URL: This address can't be fetched.", "code": "blocked_url" } | URL rejected by the SSRF guard (private/internal hosts). The response never names the address the host resolved to |
| 401 | { "error": "API key required. Pass via x-api-key header.", "code": "missing_api_key" } | No key header present |
| 401 | { "error": "Invalid or revoked API key.", "code": "invalid_api_key" } | Key not found, inactive, or revoked |
| 422 | { "ok": false, "error": "…" } | Page couldn't be fetched/parsed (e.g. /v1/scrape failure) |
| 429 | { "error": "Rate limit exceeded", "code": "rate_limited", "limit": 200, "tier": "pro", "retryAfterSeconds": 60 } | Too many requests in the sliding window |
| 503 | { "error": "Async crawl unavailable: job queue not configured (REDIS_URL). Crawl was not started." } | Crawl with no worker queue configured |
| 503 | { "error": "Auth backend not configured.", "code": "auth_unavailable" } | The auth/database backend isn't reachable |
Rate-limit errors
A 429 additionally sets response headers so you can back off precisely:
| Header | Description |
|---|---|
X-RateLimit-Limit | Your tier's per-minute ceiling |
X-RateLimit-Remaining | Requests left in the current window |
Retry-After | Seconds to wait before retrying (60 for rate_limited; the time left in the window for auth_rate_limited) |
Note that X-RateLimit-Limit and X-RateLimit-Remaining are returned on every authenticated /v1 request, not only on a 429, so you can throttle proactively. See rate limits.
Handling errors
- Always check the HTTP status first, then read
error(andokwhere present) for the human-readable reason. - On
429, honorRetry-After(or theX-RateLimit-Remainingheader) before retrying. - On
503, the failure is a configuration or backend issue with the service. Retry with backoff. - A
422from/v1/scrapemeans the URL was reachable as input but the page itself didn't yield content; it is not a quota or auth problem.
Other codes
| Status | code | When |
|---|---|---|
| 422 | unsupported_content_type | Scrape: the URL returned an image, video, archive or other binary instead of a page. Not charged. Use /v1/parse for documents and /v1/screenshot to capture a page as an image |
| 422 | too_large | Scrape: the response is larger than the download limit (a PDF is held to the document limit of /v1/parse). Refused without downloading the rest. Not charged |
| 422 | too_many_redirects | Scrape: the URL redirects more times than the limit (a redirect loop). Not charged |
| 422 | blocked_url | Scrape: a redirect led to an address that can't be fetched. Not charged |
| 422 | blocked_by_site | Map: the site refused the request (401/403) and no links were found |
| 422 | robots_disallowed | Map: the site's robots.txt does not allow the homepage and no links were found |
| 422 | no_address | Map: neither the host nor its www. form resolves |
| 429 | site_rate_limited | Map: the site rate limited the request and no links were found (not your own rate limit) |
| 502 | map_fetch_failed | Map could not fetch the site |
| 503 | search_unavailable | No search backend completed |
| 504 | map_timeout | Map exceeded time budget with no links |