Python screenshot API

Website Screenshot API for Python

Capture any URL to a PNG, JPEG or PDF from Python with one requests call. rasterly runs the headless Chromium server-side, so there's no Selenium, Playwright, driver or browser to install and keep patched.

Screenshotting in Python usually means installing a browser, wiring up Selenium or Playwright, and babysitting a driver in CI. rasterly moves that off your box: GET /v1/screenshot?url=...&format=png with your key returns the image bytes. One request, no local browser, priced from $0.90 per 1,000.

Try it

python — requests
import requests

r = requests.get(
    "https://api.rasterly.dev/v1/screenshot",
    params={"url": "https://stripe.com", "format": "png",
            "full_page": "true", "scale": "2"},
    headers={"X-Api-Key": "sk_live_..."},
    timeout=60,
)
r.raise_for_status()
with open("shot.png", "wb") as f:
    f.write(r.content)

Swap format=pdf for a print-ready A4, or format=jpeg with quality to shrink the file. Get a key instantly:

python — grab a key
key = requests.post("https://api.rasterly.dev/v1/keys").json()["key"]

Common options

Why not just run Playwright?

Running your own headless Chromium works until it doesn't: cold starts, memory spikes on full-page captures, font and codec gaps in slim containers, and a browser to patch every few weeks. rasterly reuses one warm browser across requests, so a render is about a second of CPU and your Python service stays a thin HTTP client. It's the same engine behind PDF, read→Markdown, extract→JSON, crawl and monitoring, so one key covers the whole web layer at $0.90 per 1,000 with 100/mo free.

FAQ

How do I take a screenshot of a website in Python?
Call GET https://api.rasterly.dev/v1/screenshot with url and format params and your X-Api-Key header via requests, then write response.content to a file. No local browser, driver or headless Chromium.
Do I still need Selenium or Playwright?
No — rasterly runs the headless Chromium server-side, so you don't install a browser, manage a driver, or keep it patched. One HTTP request from Python returns the image or PDF bytes.
Can I get a full-page or retina screenshot?
Yes — add full_page=true for the whole scroll height, scale=2 or 3 for retina, and width/height for the viewport. format can be png, jpeg or pdf.
How much does it cost?
From $0.90 per 1,000 on standard and $0.58 per 1,000 on Growth, with 100 renders/mo free. Instant sk_live_ key from POST /v1/keys.
Start free — 100 renders See a live render