Endpoints
List the failure reasons
Every code a failed render can have in reason, with its title and explanation. The list may grow: treat a code you don't know as render_failed.
GEThttps://api.pagepeeker.com/v3/reasons
Authentication
None. Public, and counted toward none of your limits.
Request
No parameters.
Response
| Field | Type | Description |
|---|---|---|
| reasons | array | One object a code, with the fields below. |
| reasons[].code | string | The code, as a failed render's reason has it. |
| reasons[].title | string | A short title. |
| reasons[].explanation | string | What it means. |
| reasons[].url | string | This code's own address. |
{
"reasons": [
{
"code": "host_not_found",
"title": "The host does not exist",
"explanation": "The domain name of the URL does not resolve: it is misspelled, expired or not registered. The API answers a host it can tell does not exist with this code at once, without queueing a render.",
"url": "https://api.pagepeeker.com/v3/reasons/host_not_found"
},
{
"code": "timeout",
"title": "The page did not load in time",
"explanation": "The page kept loading past the time a render may take, often because a resource on it never finished.",
"url": "https://api.pagepeeker.com/v3/reasons/timeout"
}
]
}
The API answers all of them: they are listed in Errors and failures. Cached for an hour.
Status codes
| Status | Answer | When |
|---|---|---|
| 200 | The list | Always. |
Every endpoint can also answer 403 https_required, 405 method_not_allowed, 500 internal_error. What each error means and what to do about it: Errors and failures.
Example
import requests
res = requests.get(
"https://api.pagepeeker.com/v3/reasons",
)
print(res.status_code, res.json())
<?php
$http = curl_init('https://api.pagepeeker.com/v3/reasons');
curl_setopt_array($http, [
CURLOPT_RETURNTRANSFER => true,
]);
$answer = json_decode(curl_exec($http), true);
echo curl_getinfo($http, CURLINFO_RESPONSE_CODE), "\n";
print_r($answer);
const res = await fetch("https://api.pagepeeker.com/v3/reasons");
console.log(res.status, await res.json());
curl -i https://api.pagepeeker.com/v3/reasons