GET /screenshot

Basic Screenshot — Capture Any Web Page as PNG

Capture a simple PNG screenshot of any public web page with default viewport settings. The quickest way to get started with the Scrnpix API.

Parameters

NameValueDescription
urlhttps://example.comThe public URL to capture
formatpngOutput image format

cURL Example

cURL
curl -H "X-KEY: your-api-key" "https://api.scrnpix.com/screenshot?url=https://example.com&format=png" -o screenshot.png

SDK Example

Python
import requests

response = requests.get(
    "https://api.scrnpix.com/screenshot",
    headers={"X-KEY": "your-api-key"},
    params={"url": "https://example.com", "format": "png"}
)

with open("screenshot.png", "wb") as f:
    f.write(response.content)

Expected Output

Content-Typeimage/png
Credit Cost1 credit

Failure Modes

URL is not publicly accessible

Symptom: HTTP 400 with SSRF error message

Fix: Ensure the target URL is publicly accessible and does not resolve to a private IP range.

Missing API key

Symptom: HTTP 401 Unauthorized

Fix: Include the X-KEY header with a valid API key from your dashboard.

Frequently Asked Questions

What is the default viewport size for screenshots?

The default viewport is 1280x720 pixels. You can customize it using the width and height parameters.

How long does a basic screenshot take?

Most screenshots complete within 2-5 seconds depending on page complexity and load time.

Related Recipes

Ready to try this recipe?

Get your API key and run this recipe in seconds. Free tier includes 50 credits per month.

Get API Key