Reference
Errors.
Every failure is application/problem+json (RFC 9457) with the same four fields, plus url when the failure was about a specific page. One shape to handle, whatever went wrong.
{
"type": "https://snakereach.com/errors/authentication-required",
"title": "Authentication required",
"status": 401,
"detail": "Provide your key in the X-API-Key header, or as Authorization: Bearer <key>."
}title is the machine-stable summary and detail is the human one. Read both. Where a status has several causes, title is what distinguishes them.
Every status
- 400 · Malformed requestThe request body was not valid JSON.
- 401 · Authentication requiredNo API key was sent.
- 403 · ForbiddenThe key was rejected, robots.txt disallowed the URL, or it resolves to a non-public address.
- 404 · Job not foundNo crawl job with that id.
- 413 · Response too largeThe upstream page exceeded the response size cap.
- 415 · Unsupported content typeNo parser is installed for that content type.
- 422 · Invalid fieldThe body was valid JSON but a field was wrong.
- 429 · Rate limit exceededToo many requests, too many concurrent crawls, or a budget was exhausted.
- 502 · Upstream fetch failedThe page could not be fetched at all.
- 504 · Upstream timeoutThe target site did not respond in time.
What is not an error
A target site returning 404, 403 or 500 is not an API error. You get a normal Document with that status and whatever content the page had. The API only errors when it could not obtain a response at all, or when policy refused to try.