Docs menu
Getting started

Authentication

Every call with your key goes from your server, over HTTPS, with the key in a header.

API keys

Make keys on the API keys page of your account, up to 20: one for each app or server, if you like. A key is pp_ and 32 letters and digits. All your keys share your plan's renders and requests per minute.

A key is shown once, when it is made, with its signing secret: they can't be shown again. If you lose a key, revoke it and make a new one. A revoked key stops working within a minute.

Keep it on your serverAnyone with your key can spend your renders. Never put it in a web page, a mobile app or public code. To show screenshots in web pages, use signed links, which carry no key.

Sending the key

HeaderValue
AuthorizationBearer YOUR_KEY
X-API-KeyYOUR_KEY, if your client can't set Authorization

Send one of them with every call that needs a key. Header names are not case-sensitive. A key in the URL is not read, and the request is answered 401 missing_key: keys don't belong where logs and browser histories keep them.

HTTPS only

Every call is HTTPS. Plain HTTP is refused with 403 https_required, not redirected: by then the key has already gone out unencrypted, and a redirect would hide that. If it happens, revoke that key.

Check your key

GET /v3/usage needs a key and costs no render, so it makes a good first call. With a working key it answers 200 and your plan's numbers:

import requests

res = requests.get(
    "https://api.pagepeeker.com/v3/usage",
    headers={"Authorization": "Bearer YOUR_KEY"},
)
print(res.status_code, res.json())

The signing secret

Each key comes with a signing secret. It signs links that a browser loads without the key: a link carries the key's first 8 characters, its key_id, and a signature made with the secret. Keep the secret on your server too. Revoking the key ends its links.

Endpoints without a key

The images (GET /v3/files/{name}), GET /v3/reasons and GET /v3/ips are public. A signed link is checked by its signature instead of a key.

When authentication fails

StatusCodeWhenWhat to do
401missing_keyNo key in Authorization: Bearer or X-API-Key. A key in the URL is not read.Send the key in a header: see Authentication.
401invalid_keyThe key is not valid, or was revoked.Check it on your API keys page, or make a new one.
403account_inactiveThe account is not active.Sign in to see its state, or contact us.
403https_requiredThe request was plain HTTP.Use https://. The key went out unencrypted: revoke it and make a new one.
401, no key
HTTP/1.1 401 Unauthorized
Content-Type: application/json; charset=utf-8

{
  "error": {
    "code": "missing_key",
    "message": "Send your API key in \"Authorization: Bearer <key>\" or \"X-API-Key: <key>\"."
  }
}

These answers carry no limit headers: the request was refused before your limits were looked at, and it isn't counted.