API Reference

Complete documentation for the SnapAPI screenshot and PDF capture API.

Authentication

All API requests require a Bearer token in the Authorization header. Get your API key from the Dashboard.

Header
Authorization: Bearer YOUR_API_KEY

Base URL

Endpoint
GET /api/v1/screenshot

All parameters are passed as query string parameters.

Parameters

NameTypeRequiredDefaultDescription
urlstringrequired-The URL of the webpage to capture. Must be a valid HTTP or HTTPS URL.
formatstringoptionalpngOutput format. Options: "png", "jpeg", "pdf".
widthintegeroptional1280Viewport width in pixels. Range: 100-3840.
heightintegeroptional720Viewport height in pixels. Range: 100-2160.
fullPagebooleanoptionalfalseCapture the full scrollable page instead of just the viewport.
qualityintegeroptional80Image quality for JPEG format only. Range: 1-100.
delayintegeroptional0Wait time in milliseconds after page load before capture. Useful for pages with animations. Range: 0-10000.

Examples

Basic Screenshot (PNG)

cURL
curl "https://api.snapapi.dev/api/v1/screenshot?url=https://example.com" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -o screenshot.png

Full Page JPEG with Custom Quality

cURL
curl "https://api.snapapi.dev/api/v1/screenshot?url=https://example.com&format=jpeg&fullPage=true&quality=90" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -o fullpage.jpg

PDF with Custom Viewport

cURL
curl "https://api.snapapi.dev/api/v1/screenshot?url=https://example.com&format=pdf&width=1920&height=1080" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -o page.pdf

Screenshot with Delay (for dynamic content)

cURL
curl "https://api.snapapi.dev/api/v1/screenshot?url=https://example.com&delay=2000" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -o delayed.png

Response

On success, the API returns the binary content of the screenshot or PDF with the appropriate Content-Type header:

  • image/pngfor PNG screenshots
  • image/jpegfor JPEG screenshots
  • application/pdffor PDF documents

Rate limit information is included in the response headers:

Response Headers
X-RateLimit-Limit: 20
X-RateLimit-Remaining: 19
X-RateLimit-Reset: 1711234567

Error Codes

Error responses return JSON with an error message:

JSON
{
  "error": "Missing required parameter: url"
}
StatusCodeDescription
400BAD_REQUESTInvalid or missing parameters. Check the error message for details.
401UNAUTHORIZEDMissing or invalid Authorization header.
403FORBIDDENInvalid API key.
429RATE_LIMITEDToo many requests. Wait and retry.
500INTERNAL_ERRORScreenshot capture failed. The target URL may be unreachable or timed out.

Rate Limits

Rate limits are applied per API key + IP combination:

  • Free: 20 requests per minute
  • Pro: 60 requests per minute
  • Business: 200 requests per minute

If you exceed the rate limit, you'll receive a 429 status code. Check the X-RateLimit-Reset header for when you can retry.

SDKs & Libraries

Official SDKs are coming soon. In the meantime, the API is a simple REST endpoint that works with any HTTP client:

  • JavaScript/TypeScript: Use fetch or axios
  • Python: Use requests or httpx
  • Go: Use net/http
  • Ruby: Use Net::HTTP or faraday