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
succeededhttps://example.com
Noma
Shop nowNEW COLLECTION
Objects for slower mornings.
Thoughtful essentials, made in small batches from natural materials.
Explore the collectionOur materials
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.
Related
Screenshot API
A screenshot API that returns the file, not a job to poll
Node.js
Screenshot API for Node.js
Bulk
Capture a thousand URLs in one call
Ready to try it against your own page?
Try it free — no signup