Errors and failures
A refused request is an HTTP error with a code. A page that couldn't be rendered is a failed render, with a reason.
Errors
{
"error": {
"code": "invalid_option",
"message": "Some options are not valid.",
"fields": {
"width": "a whole number from 16 to 3840"
}
}
}
code is for your code to match on. message is for people, and may change. fields comes only with option errors.
| Status | Code | When |
|---|---|---|
| 400 | invalid_json | The body is not a JSON object. |
| 400 | unknown_option | An option the API doesn't take, or wait in a signed link. fields names it. |
| 400 | invalid_option | Wrong values. fields names each one with what it takes. |
| 400 | url_blocked | The URL is not rendered. |
| 400 | host_not_found | The URL's domain does not exist. Answered at once, without a render. |
| 401 | missing_key | No key in Authorization: Bearer or X-API-Key. |
| 401 | invalid_key | The key is not valid, or was revoked. |
| 402 | over_quota | The renders of this month are used up. Cached renders are still answered. |
| 403 | account_inactive | The account is not active. |
| 403 | https_required | The request was plain HTTP. |
| 403 | invalid_signature | A signed link whose signature doesn't match. |
| 404 | not_found | No render with this id, or no such endpoint. |
| 405 | method_not_allowed | Another method. Allow says which. |
| 415 | unsupported_media_type | The body is not application/json. |
| 429 | rate_limited | Over your requests a minute. Retry-After says when to try again. |
| 500 | internal_error | Something went wrong on our side. |
Over a limit
Over the requests a minute, wait the seconds of Retry-After, then try again. Over the month's renders, renders already in the cache are still answered; new ones wait for next month, or a bigger plan.
HTTP/1.1 429 Too Many Requests
Retry-After: 42
RateLimit-Limit: 10
RateLimit-Remaining: 0
RateLimit-Reset: 42
RateLimit-Policy: "minute";q=10;w=60
RateLimit: "minute";r=0;t=42
X-PP-Renders-Used: 123
X-PP-Renders-Limit: 500
{
"error": {
"code": "rate_limited",
"message": "Over 10 requests a minute. Try again in 42 seconds."
}
}
HTTP/1.1 402 Payment Required
RateLimit-Limit: 10
RateLimit-Remaining: 7
RateLimit-Reset: 18
RateLimit-Policy: "minute";q=10;w=60
RateLimit: "minute";r=7;t=18
X-PP-Renders-Used: 500
X-PP-Renders-Limit: 500
{
"error": {
"code": "over_quota",
"message": "The renders of this month are used up. Cached renders are still answered."
}
}
Failed renders
A render that failed answers "status": "failed" with one of these in reason, the worker's words in message, and an explanation at reason_url. The list may grow: treat a code you don't know as render_failed.
| Reason | Meaning |
|---|---|
| host_not_found | The domain name doesn't resolve: misspelled, expired or not registered. |
| timeout | The page kept loading past the time a render may take, or wait_for_selector didn't appear. |
| robots_denied | The site's robots.txt doesn't let the PagePeeker robot in. |
| bot_check | The site showed a check for automated visitors instead of its content. |
| navigation_failed | The connection failed: refused, reset, timed out, or a secure connection that couldn't be set up. Local and private addresses fail this way too. |
| capture_failed | The page loaded, but the image couldn't be made. |
| render_failed | Any other reason. |
The same list, as JSON: GET https://api.pagepeeker.com/v3/reasons, or one code at https://api.pagepeeker.com/v3/reasons/{code}. No key needed.