Docs menu
API v3

Screenshots

Ask for a screenshot, wait for it or ask again later, and download the image.

POSThttps://api.pagepeeker.com/v3/shot

The whole flow

Ask for the screenshot with wait, so most renders come back in the same request. If it isn't done in that time, ask again with its id every few seconds. Over the rate limit, wait the seconds of Retry-After and try again. A refused request (an error, see Errors and failures) or a failed render ends it. Then download the image.

import time
import requests

API = "https://api.pagepeeker.com/v3"
HEADERS = {"Authorization": "Bearer YOUR_KEY"}


# One call to the API. Over the rate limit, it waits as told and tries again.
def call(method, path, body=None):
    while True:
        res = requests.request(method, API + path, headers=HEADERS, json=body)
        if res.status_code != 429:
            break
        time.sleep(int(res.headers["Retry-After"]))
    answer = res.json()
    if "error" in answer:  # refused: see Errors and failures
        raise RuntimeError(answer["error"]["code"] + ": " + answer["error"]["message"])
    return answer


# Ask for the screenshot, holding the request open up to 30 seconds.
shot = call("POST", "/shot", {
    "url": "https://example.com/",
    "width": 480,
    "height": 360,
    "wait": 30,
})

# Not done in 30 seconds: ask again every 5 seconds.
while shot["status"] == "queued":
    time.sleep(5)
    shot = call("GET", "/shot/" + shot["id"])

if shot["status"] == "failed":
    raise RuntimeError(shot["reason"] + ": " + shot["message"])

# Done: download the image. Its address needs no key.
with open("capture.jpg", "wb") as f:
    f.write(requests.get(shot["url"]).content)

The request

The body is a JSON object of options, with Content-Type: application/json, and your key in Authorization. Only url is required.

Request
POST /v3/shot HTTP/1.1
Host: api.pagepeeker.com
Authorization: Bearer YOUR_KEY
Content-Type: application/json

{
  "url": "https://example.com/",
  "full_page": true,
  "format": "webp",
  "width": 640,
  "block_ads": true,
  "wait": 30
}
Answer
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
RateLimit-Limit: 10
RateLimit-Remaining: 9
RateLimit-Reset: 42
RateLimit-Policy: "minute";q=10;w=60
RateLimit: "minute";r=9;t=42
X-PP-Renders-Used: 124
X-PP-Renders-Limit: 500

{
  "id": "5c1e8b0a3f6d42c9b7e1a0d3c5f2e4b6",
  "status": "done",
  "url": "https://api.pagepeeker.com/v3/files/5c1e8b0a3f6d42c9b7e1a0d3c5f2e4b6-8b2d4f6a1c3e5079.webp",
  "rendered_at": "2026-11-16T12:00:00Z",
  "final_url": "https://example.com/",
  "status_code": 200,
  "title": "Example Domain",
  "width": 640,
  "height": 512,
  "bytes": 18420
}

The headers say where you stand: see Limits and usage.

AnswerStatusWhen
done200A render with these options is in the cache, younger than cache_ttl, or it was done while the request waited.
queued202The render is queued. With wait, it was not done in that time.
failed200The page could not be rendered. The same request is answered as failed for an hour, then rendered again.
Done, 200
{
  "id": "9a3f0c2e5b7d41e8a6c3f2d1e0b9a8c7",
  "status": "done",
  "url": "https://api.pagepeeker.com/v3/files/9a3f0c2e5b7d41e8a6c3f2d1e0b9a8c7-4f2a9c1e7b3d5a60.jpeg",
  "rendered_at": "2026-11-16T12:00:00Z",
  "final_url": "https://example.com/",
  "status_code": 200,
  "title": "Example Domain",
  "width": 1280,
  "height": 1024,
  "bytes": 81234
}
Queued, 202
{
  "id": "9a3f0c2e5b7d41e8a6c3f2d1e0b9a8c7",
  "status": "queued"
}
Failed, 200
{
  "id": "9a3f0c2e5b7d41e8a6c3f2d1e0b9a8c7",
  "status": "failed",
  "reason": "timeout",
  "message": "The selector did not appear in 30 seconds",
  "reason_url": "https://api.pagepeeker.com/v3/reasons/timeout",
  "failed_at": "2026-11-16T12:00:00Z"
}

Done

FieldMeaning
idThe render's id. The same options give the same id.
urlThe image. Its address never changes: a new render of the same page gets a new one.
rendered_atWhen the render was made, in UTC.
final_urlWhere the page ended up after redirects.
status_codeThe HTTP status the page answered with.
titleThe page's title.
widthThe image's width, in pixels.
heightThe image's height, in pixels.
bytesThe image's size.

Failed

reason is a code from Errors and failures, message says what happened in words, and reason_url explains the code.

Asking again

GEThttps://api.pagepeeker.com/v3/shot/id

Where a render stands: the same answers as above. 404 not_found for an id that was never asked for, or a failure older than an hour. Each call counts toward your rate limit, so leave a few seconds between them, or use wait.

The image

Download it from url, with no key. It can be cached for good, by you or a browser: the address of a newer render is different. Images are deleted 31 days after they were made, so keep your own copy if you need one longer.

The cache

A request whose options match a render younger than cache_ttl (a day unless you set it) gets that render at once, and costs no render. fresh asks for a new render whatever the cache holds.

Notecache_ttl, fresh and wait say how to answer, not what to render: they don't change the id.