Endpoints
Get a failure reason
One code's title and explanation. A failed render's reason_url is this address.
GEThttps://api.pagepeeker.com/v3/reasons/{code}
Authentication
None. Public, and counted toward none of your limits.
Request
| Path parameter | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | A failed render's reason. |
Response
| Field | Type | Description |
|---|---|---|
| code | string | The code, as a failed render's reason has it. |
| title | string | A short title. |
| explanation | string | What it means. |
| url | string | This code's own address. |
{
"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"
}
Cached for an hour.
Status codes
| Status | Answer | When |
|---|---|---|
| 200 | The reason | A code of the list. |
| 404 | error not_found | No render with this id (never asked for, or a failure older than an hour), no such failure reason, or no such endpoint. |
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/timeout",
)
print(res.status_code, res.json())
<?php
$http = curl_init('https://api.pagepeeker.com/v3/reasons/timeout');
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/timeout");
console.log(res.status, await res.json());
curl -i https://api.pagepeeker.com/v3/reasons/timeout