GET
/api/v1/screenshotScreenshot API
Capture pixel-perfect screenshots of any publicly accessible URL. Supports custom viewports, full page capture, element selectors, delays, and multiple output formats.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| url | string | Yes | - | The URL to screenshot. Must be publicly accessible and start with http:// or https://. |
| width | number | No | 1280 | Viewport width in pixels. Range: 320-3840. |
| height | number | No | 720 | Viewport height in pixels. Range: 240-2160. |
| format | string | No | png | Output format: png, jpeg, or webp. Free plan: PNG only. |
| fullPage | boolean | No | false | Capture the full scrollable page instead of just the viewport. Pro plan and above. |
| delay | number | No | 0 | Wait time in milliseconds after page load before capturing. Max: varies by plan. |
| selector | string | No | - | CSS selector to capture a specific element instead of the full viewport. |
| quality | number | No | 80 | Image quality for JPEG/WebP format. Range: 1-100. |
| deviceScaleFactor | number | No | 1 | Device pixel ratio (1 for standard, 2 for retina). Range: 1-3. |
| json | boolean | No | false | Return JSON response with a temporary CDN URL instead of binary image data. |
Response
By default, the API returns the screenshot as binary image data with the appropriate Content-Type header. Use ?json=true to receive a JSON response instead.
Binary Response Headers
Response Headers
Content-Type: image/png
Content-Length: 245678
X-Request-Id: req_abc123
X-RateLimit-Remaining: 49
X-Capture-Duration: 1250msCode Examples
cURL
cURL Examples
# Basic screenshot
curl "https://captureapi.dev/api/v1/screenshot?url=https://github.com" \
-H "X-API-Key: cap_your_key" \
-o github.png
# Full page, high resolution
curl "https://captureapi.dev/api/v1/screenshot?url=https://github.com&fullPage=true&width=1920&height=1080&format=webp&deviceScaleFactor=2" \
-H "X-API-Key: cap_your_key" \
-o github-full.webp
# Capture specific element
curl "https://captureapi.dev/api/v1/screenshot?url=https://github.com&selector=.application-main" \
-H "X-API-Key: cap_your_key" \
-o github-main.pngJavaScript / Node.js
JavaScript
async function captureScreenshot(url, options = {}) {
const params = new URLSearchParams({
url,
width: options.width?.toString() || "1280",
height: options.height?.toString() || "720",
format: options.format || "png",
...(options.fullPage && { fullPage: "true" }),
...(options.delay && { delay: options.delay.toString() }),
...(options.selector && { selector: options.selector }),
});
const response = await fetch(
`https://captureapi.dev/api/v1/screenshot?${params}`,
{
headers: { "X-API-Key": process.env.CAPTURE_API_KEY }
}
);
if (!response.ok) {
const error = await response.json();
throw new Error(error.error.message);
}
return response.arrayBuffer();
}
// Usage
const screenshot = await captureScreenshot("https://example.com", {
width: 1920,
height: 1080,
format: "webp",
fullPage: true
});Python
Python
import requests
import os
def capture_screenshot(url, **kwargs):
params = {
"url": url,
"width": kwargs.get("width", 1280),
"height": kwargs.get("height", 720),
"format": kwargs.get("format", "png"),
}
if kwargs.get("full_page"):
params["fullPage"] = "true"
if kwargs.get("delay"):
params["delay"] = kwargs["delay"]
if kwargs.get("selector"):
params["selector"] = kwargs["selector"]
response = requests.get(
"https://captureapi.dev/api/v1/screenshot",
params=params,
headers={"X-API-Key": os.environ["CAPTURE_API_KEY"]}
)
response.raise_for_status()
return response.content
# Usage
screenshot = capture_screenshot(
"https://example.com",
width=1920,
height=1080,
format="webp",
full_page=True
)
with open("screenshot.webp", "wb") as f:
f.write(screenshot)Rate Limits by Plan
| Plan | Monthly Limit | Max Resolution | Timeout | Formats |
|---|---|---|---|---|
| Free | 50 | 720p | 5s | PNG |
| Pro | 2,000 | 1080p | 30s | PNG, JPEG, WebP |
| Business | 10,000 | 4K | 60s | All |
| Enterprise | Unlimited | 4K+ | 120s | All |