We use cookies

We use cookies to enhance your experience and analyse site usage.

Back to Blog
Tutorial5 min read

How to Screenshot Any Website with a Single API Call

A practical guide to integrating WebCaptureAPI into your application. From your first request to handling responses, full-page captures, and format options.

Introduction

Automating website screenshots used to mean managing your own headless browser infrastructure — installing Chrome, handling memory leaks, debugging rendering issues. WebCaptureAPI eliminates all of that with a simple REST API you can call from any language in seconds.

This guide walks you through everything from your first request to production-ready integration.

Getting Your API Key

After signing up and verifying your email, head to Dashboard → API Keys and create your first key. Keys start with sk_ and are shown once — copy it to a secure location.

Your First Screenshot

The simplest possible request is a single GET with your URL and API key:

curl -H "x-api-key: sk_your_key" \

"https://api.webcaptureapi.com/api/screenshot?url=https://example.com" \

--output screenshot.png

That's it. You get a PNG back in the response body.

Request Parameters

ParameterDefaultDescription
urlrequiredThe URL to screenshot
formatpngpng or jpeg
width1280Viewport width in pixels
height800Viewport height in pixels
fullPagefalseCapture the full scrollable page
quality90JPEG quality (1–100)
delay0Wait time in ms before capture

Full-page capture

To capture an entire long page rather than just the visible viewport:

curl -H "x-api-key: sk_your_key" \

"https://api.webcaptureapi.com/api/screenshot?url=https://example.com&fullPage=true" \

--output full.png

Capturing JavaScript-heavy SPAs

If you're capturing a React or Vue app that needs time to render, use the delay parameter:

curl -H "x-api-key: sk_your_key" \

"https://api.webcaptureapi.com/api/screenshot?url=https://app.example.com&delay=2000"

JavaScript Integration

async function captureScreenshot(url) {

const params = new URLSearchParams({

url,

format: 'png',

width: '1440',

fullPage: 'true',

})

const response = await fetch(

https://api.webcaptureapi.com/api/screenshot?${params},

{ headers: { 'x-api-key': process.env.WEBCAPTURE_API_KEY } }

)

if (!response.ok) {

const error = await response.json()

throw new Error(error.error || 'Screenshot failed')

}

return response.blob()

}

Python Integration

import requests

import os

def capture_screenshot(url: str, output_path: str) -> None:

response = requests.get(

'https://api.webcaptureapi.com/api/screenshot',

params={

'url': url,

'format': 'png',

'width': 1440,

'fullPage': 'true',

},

headers={'x-api-key': os.environ['WEBCAPTURE_API_KEY']},

timeout=30,

)

response.raise_for_status()

with open(output_path, 'wb') as f:

f.write(response.content)

Error Handling

The API returns standard HTTP status codes:

StatusMeaning
200Screenshot returned successfully
400Missing or invalid parameters
401Invalid or missing API key
429Rate limit or monthly quota exceeded
500Internal error (retryable)

On error, the response body is JSON: { "error": "description" }.

Usage & Quotas

Each plan has a monthly screenshot limit that resets on your billing date. The Free plan includes 100 screenshots per month — enough to evaluate the API and build a prototype. When you exceed your quota, requests return 429 until the next billing cycle.

Monitor your current usage in Dashboard → Usage.

Next Steps

Ready to get started?

Create a free account and capture your first screenshot in under 2 minutes.

Get started free