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
| Parameter | Default | Description |
|---|---|---|
url | required | The URL to screenshot |
format | png | png or jpeg |
width | 1280 | Viewport width in pixels |
height | 800 | Viewport height in pixels |
fullPage | false | Capture the full scrollable page |
quality | 90 | JPEG quality (1–100) |
delay | 0 | Wait 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:
| Status | Meaning |
|---|---|
200 | Screenshot returned successfully |
400 | Missing or invalid parameters |
401 | Invalid or missing API key |
429 | Rate limit or monthly quota exceeded |
500 | Internal 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
- Set up scheduled screenshots to automate recurring captures
- Create additional API keys per environment (dev, staging, prod)
- Upgrade your plan when you're ready to scale
Ready to get started?
Create a free account and capture your first screenshot in under 2 minutes.
Get started free