Python

Screenshot API for Python

No Selenium grid, no driver version to keep in sync with a browser you did not choose to upgrade.

screenshot api python · request and resultPAGECAPTURE / 01
Python
import os
import requests

PAGECAPTURE = "https://api.pagecapture.dev/v1/take"

def capture(url: str, path: str = "shot.png") -> None:
    response = requests.post(
        PAGECAPTURE,
        headers={"X-Access-Key": os.environ["PAGECAPTURE_KEY"]},
        json={"url": url, "format": "png", "full_page": True},
        timeout=120,
    )

    if response.status_code != 200:
        error = response.json()
        raise RuntimeError(f"{error['error_code']}: {error['error_message']}")

    with open(path, "wb") as file:
        file.write(response.content)
Capture result
succeeded
https://example.com
Noma
Shop now
NEW COLLECTION

Objects for slower mornings.

Thoughtful essentials, made in small batches from natural materials.

Explore the collection
No. 01 · Hinoki
PLANT-BASEDMADE IN SMALL BATCHESREFILLABLE
Artifact
PNG · 1440×900
Billing
1 credit
Engine
stable

requests or httpx

Any HTTP client works. Nothing to compile, nothing to pin.

Fits a worker

Celery, RQ or a cron job — call it and write the bytes.

Bulk for data work

One call for a thousand URLs, results delivered by webhook.

Markdown output

format=markdown gives clean text from a rendered page, after JavaScript has run.

Pricing

One credit per successful capture. Failures and cache hits are free.

Free
$0
100 credits
Basic
$10
2,000 credits
Growth
$47
10,000 credits
All plans

Questions this raises

Can I get text instead of an image?

Yes. format=markdown or format=html returns the rendered document — including content that only exists after JavaScript runs.

How should I handle rate limits?

Back off using X-RateLimit-Reset. For large batches, /v1/bulk with async delivery is the intended path.

Does it work with asyncio?

Yes, with httpx or aiohttp. The API has no client-side state.