Popular Language

Capture screenshots in Python

Add screenshot and scrolling GIF capabilities to your Python applications with just the requests library. No Selenium, no headless browsers to manage.

Installation

  1. 1Install the requests library: pip install requests
  2. 2Get your API key from the dashboard
  3. 3Set the X-KEY header in your requests

Authentication

Include your API key in the X-KEY header with every request:

headers = {"X-KEY": "your-api-key"}
response = requests.get(url, headers=headers)

Python Screenshot Example

Capture a screenshot or create a scrolling GIF animation with a simple GET request:

curl "https://api.scrnpix.com/screenshot?url=https%3A%2F%2Fexample.com&width=1280&height=720&format=png" \
  -H "X-KEY: your-api-key" \
  -o screenshot.png
curl "https://api.scrnpix.com/animate?url=https%3A%2F%2Fexample.com&scroll_duration=3000&scroll_easing=ease-in-out" \
  -H "X-KEY: your-api-key" \
  -o animation.gif

Response Format

On success, the API returns the image binary data directly in the response body.

Status Code200 OK
Content-Typeimage/png, image/jpeg, or image/gif
BodyBinary image data
Error ResponseError message with 4xx/5xx status

Key Features

Zero Setup

No need to install Selenium, Playwright, or manage headless Chrome. Just use the requests library you already have.

Production Ready

Built on Cloudflare Workers with global edge network. Handles concurrency and browser lifecycle automatically.

Pythonic API

Simple GET requests with dict params. Integrates seamlessly with Flask, Django, FastAPI, or any Python framework.

Rich Features

Custom viewport sizes, full page capture, PNG/JPEG formats, scrolling GIFs with 15 easing functions.

Frequently Asked Questions

Do I need to install any browser dependencies for Python?

No. Scrnpix runs browsers on our infrastructure. You only need the Python requests library to make HTTP calls.

Can I use this with Django or Flask?

Yes. Scrnpix works with any Python framework — Django, Flask, FastAPI, Pyramid, or plain Python scripts.

How do I handle errors in Python?

Check the response status code. A 200 status means success with image bytes in the body. 4xx errors indicate invalid params or auth issues, 5xx errors are server-side.

What Python version is required?

Any Python version that supports the requests library (Python 3.7+). The API is a simple HTTP GET request.

Ready to capture screenshots in Python?

Get your API key and start rendering screenshots in seconds. Free tier includes 50 screenshots per month.

Start Free