Python · GET /screenshot

The Python screenshot API.
One request. Zero setup.

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.

  • Zero dependencies
  • Works with requests, httpx, urllib
  • PDF, video & HTML input
  • 100 free captures/month
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/...

What is a screenshot API for Python?

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.

A complete screenshot API for Python developers

Capture any website from Python without running a headless browser. No driver installs, no infrastructure.

No dependencies

Works with requests, httpx, urllib, or any Python HTTP client. No pip install needed beyond your existing stack.

Async-ready

Use httpx or aiohttp for concurrent captures. Batch hundreds of screenshots without blocking your event loop.

PDF output

Pass output=pdf to get binary PDF content. Write it to disk or return it directly in a Flask or FastAPI response.

HTML input

Send raw HTML strings with no URL needed. Perfect for invoice generation, OG images, and report rendering.

Bring Your Own S3

Pass your S3 credentials and captures go straight to your bucket. No download-and-reupload needed.

Stealth mode

Add stealth=True to bypass bot detection on any target page. No Playwright-stealth plugin to configure.

Advanced examples

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")

Why not use Selenium or Playwright in Python?

They work, until they don't. Here's the real cost of running a headless browser inside your Python app.

Selenium / Playwright
  • Heavy dependency, 200–400 MB per environment
  • Browser driver version mismatches break CI
  • Not designed to scale concurrent captures
  • You maintain bot-detection workarounds yourself
  • Difficult to run in serverless or container environments
ScreenshotCore
  • Just requests, zero browser dependency
  • No driver management, ever
  • Auto-scales to thousands of concurrent captures
  • Stealth mode included on every request
  • Works in Lambda, Cloud Run, any host

Frequently asked questions

Add a screenshot API to your Python app. No Selenium needed.

100 free captures per month. No credit card. Drop it into any Python project in minutes.

Get your free API key →