A fast, reliable way to capture any website from Python. One GET request via requests, httpx, or any HTTP client. Screenshots, PDFs, and videos delivered as a CDN URL. No Selenium, no Playwright, no infrastructure.
import requests
import os
def screenshot(url: str) -> str:
"""Returns the CDN URL of the screenshot."""
response = requests.get(
"https://screenshotcore.com/api/v1/screenshot",
params={
"token": os.environ["SCREENSHOT_API_KEY"],
"url": url,
"output": "json",
"width": 1280,
"height": 800,
},
)
response.raise_for_status()
return response.json()["screenshot"]
url = screenshot("https://example.com")
print(url) # https://cdn.screenshotcore.com/...A Python screenshot API lets you capture any public URL as an image, PDF, or video with a single HTTP request. No headless browser, no Selenium, and no server infrastructure to run. Instead of launching a browser inside your app, you call an external endpoint and get a ready-to-use CDN URL back in milliseconds. Use it as a lightweight Python capture API across any environment: Django, FastAPI, Flask, AWS Lambda, Cloud Run, and more.
Capture any website from Python without running a headless browser. No driver installs, no infrastructure.
Works with requests, httpx, urllib, or any Python HTTP client. No pip install needed beyond your existing stack.
Use httpx or aiohttp for concurrent captures. Batch hundreds of screenshots without blocking your event loop.
Pass output=pdf to get binary PDF content. Write it to disk or return it directly in a Flask or FastAPI response.
Send raw HTML strings with no URL needed. Perfect for invoice generation, OG images, and report rendering.
Pass your S3 credentials and captures go straight to your bucket. No download-and-reupload needed.
Add stealth=True to bypass bot detection on any target page. No Playwright-stealth plugin to configure.
More than screenshots. The screenshot API for Python supports PDF generation, async webhooks, and raw HTML rendering, all from the same endpoint.
import requests
import os
def url_to_pdf(url: str, output_path: str) -> str:
response = requests.get(
"https://screenshotcore.com/api/v1/screenshot",
params={
"token": os.environ["SCREENSHOT_API_KEY"],
"url": url,
"output": "pdf",
"pdf_page_size": "A4",
},
)
response.raise_for_status()
with open(output_path, "wb") as f:
f.write(response.content)
return output_path
url_to_pdf("https://example.com", "report.pdf")They work, until they don't. Here's the real cost of running a headless browser inside your Python app.
100 free captures per month. No credit card. Drop it into any Python project in minutes.
Get your free API key →