Skip to main content
ScreenshotXScreenshot API
Table of Contents
Free API

API Documentation

Screenshot API provides a simple REST API for capturing website screenshots. No credit card required. Start making requests in seconds.

Getting Started

Capture your first screenshot in 3 simple steps:

  1. Get your free API key from the get-api-key page
  2. Make a request to the screenshot endpoint
  3. Use the returned CDN URL (or redirect to download bytes)
bash
# Capture a screenshot
curl -X POST "https://api.screenshot-api.org/api/v1/screenshot" \
  -H "authorization: Bearer YOUR_API_KEY" \
  -H "content-type: application/json" \
  -d '{"url":"https://example.com","format":"png","fullPage":false}'

Authentication

Authenticate your requests using an API key. You can pass it as a query parameter (convenience) or in headers (recommended):

bash
# Query parameter
curl "https://api.screenshot-api.org/api/v1/screenshot?url=...&key=YOUR_API_KEY"

# Authorization header
curl "https://api.screenshot-api.org/api/v1/screenshot?url=..." \
  -H "Authorization: Bearer YOUR_API_KEY"

# X-API-Key header
curl "https://api.screenshot-api.org/api/v1/screenshot?url=..." \
  -H "X-API-Key: YOUR_API_KEY"

API Reference

GET/api/v1/screenshot

Capture a screenshot using query parameters. Returns JSON by default; use redirect=1 to get a 302 to the image/PDF.

POST/api/v1/screenshot

Same as GET, but parameters are passed in the request body as JSON. Useful for complex configurations.

POST/api/v1/screenshot/batch

Capture multiple screenshots in a single request. Returns a batch ID for tracking progress.

Parameters

Basic parameters work on both GET (query string) and POST (JSON body). Advanced options like css, js, hideSelectors, geolocation, and pdf are POST-only.

ParameterTypeRequiredDescription
urlstringRequiredThe URL to capture
format"png" | "jpeg" | "webp" | "pdf"OptionalOutput format (default: png)
viewport.widthnumberOptionalViewport width in pixels (POST JSON body). For GET use width.
viewport.heightnumberOptionalViewport height in pixels (POST JSON body). For GET use height.
fullPagebooleanOptionalCapture the full scrollable page (default: false)
deviceScaleFactornumberOptionalDevice scale factor for retina (default: 1)
waitUntil"load" | "domcontentloaded" | "networkidle0" | "networkidle2"OptionalNavigation wait strategy (default: networkidle2)
qualitynumberOptionalImage quality for jpeg/webp (1-100)
selectorstringOptionalCapture a specific element (CSS selector). Not supported for PDF.
waitForSelectorstringOptionalWait for a selector to appear before capture
delayMsnumberOptionalExtra delay (ms) after load, for late UI (default: 0)
blockAdsbooleanOptionalBlock ads and trackers (default: true)
blockCookieBannersbooleanOptionalBlock cookie consent banners (default: true)
darkModebooleanOptionalEnable dark mode (default: false)
hideSelectorsstring[]OptionalHide elements by CSS selectors (POST only)
cssstringOptionalInject custom CSS before capture (POST only)
jsstringOptionalInject custom JavaScript before capture (POST only)
geolocation{ latitude, longitude, accuracy? }OptionalSimulate geolocation (POST only)
timezoneIdstringOptionalEmulate timezone (e.g. America/Los_Angeles) (POST only)
localestringOptionalSet Accept-Language (e.g. en-US) (POST only)
pdfobjectOptionalPDF options (requires format=pdf) (POST only)
cachebooleanOptionalUse cached version if available (default: true)
cacheTTLnumberOptionalCache time-to-live in seconds (default: 86400)
staleTTLnumberOptionalServe stale while revalidating, in seconds (default: 43200)
timeoutMsnumberOptionalNavigation timeout in milliseconds (default: 30000)
redirectbooleanOptionalGET only: respond with 302 to the screenshot URL
keystringOptionalOptional: API key via query string (convenience; headers recommended)

Code Examples

cURL

bash
curl -X POST "https://api.screenshot-api.org/api/v1/screenshot" \
	  -H "Authorization: Bearer YOUR_API_KEY" \
	  -H "Content-Type: application/json" \
	  -d '{
	    "url": "https://example.com",
	    "viewport": { "width": 1280, "height": 720 },
	    "format": "png",
	    "fullPage": true,
	    "blockAds": true
	  }'

JavaScript / Node.js

javascript
const response = await fetch('https://api.screenshot-api.org/api/v1/screenshot', {
	  method: 'POST',
	  headers: {
	    'Authorization': 'Bearer YOUR_API_KEY',
	    'Content-Type': 'application/json',
	  },
	  body: JSON.stringify({
	    url: 'https://example.com',
	    viewport: { width: 1280, height: 720 },
	    format: 'png',
	    fullPage: true,
	  }),
	});

const data = await response.json();
console.log(data.screenshotUrl);

Python

python
import requests

	response = requests.post(
	    'https://api.screenshot-api.org/api/v1/screenshot',
	    headers={'Authorization': 'Bearer YOUR_API_KEY'},
	    json={
	        'url': 'https://example.com',
	        'viewport': { 'width': 1280, 'height': 720 },
	        'format': 'png',
	        'fullPage': True,
	    }
	)

data = response.json()
print(data['screenshotUrl'])

Batch Screenshots

Capture multiple URLs in a single request. Perfect for bulk operations and automation.

bash
curl -X POST "https://api.screenshot-api.org/api/v1/screenshot/batch" \
	  -H "Authorization: Bearer YOUR_API_KEY" \
	  -H "Content-Type: application/json" \
	  -d '{
	    "urls": [
	      "https://example.com",
	      "https://example.org",
	      "https://example.net"
	    ],
	    "options": {
	      "viewport": { "width": 1280, "height": 720 },
	      "format": "png"
	    }
	  }'

Track batch progress via GET /api/v1/batch/:batchId or stream updates with SSE at GET /api/v1/batch/:batchId/stream

Error Handling

All errors return a consistent JSON response with an error code and message:

json
{
  "success": false,
  "error": {
    "code": "invalid_request",
    "message": "Invalid request body",
    "details": { "fieldErrors": { "url": ["Invalid URL"] } }
  },
  "meta": { "requestId": "req_..." }
}

Common Error Codes

CodeHTTP StatusDescription
unauthorized401Invalid or missing API key
invalid_request400Invalid request parameters or body
rate_limited429Rate limit exceeded (per-minute or monthly quota)
quota_exceeded429Monthly quota exceeded (batch pre-check)
render_failed502Failed to render the page
selector_not_found422The selector did not match any element

Rate Limits

Free plan limits (see pricing for higher tiers):

60
requests / minute
500
screenshots / month
Caching
faster repeat requests

Rate limit headers are included in every response: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Quota-Remaining, X-Quota-Reset

Ready to get started?

Get your free API key and start capturing screenshots in seconds.

Get Free API Key