Screenshot API Reference

The Screenshot API allows you to capture high-quality screenshots of any webpage with extensive customization options.

Capture Screenshot

Endpoint

bash
01POST https://api.screenshotapi.io/v1/capture

Request Options

ParameterTypeDescription
urlstringThe URL of the webpage to capture
captureType'screenshot'Set to 'screenshot' for capturing screenshots
format'png' | 'jpeg' | 'webp'Output format for the screenshot
deviceType'desktop' | 'tablet' | 'mobile'Device type to emulate
widthnumberViewport width in pixels
heightnumberViewport height in pixels
fullPagebooleanCapture full page height
removeAdsbooleanRemove advertisements from the page
waitDurationnumberTime to wait for dynamic content (seconds)
selectorstringCSS selector to capture specific element
customCSSstringCustom CSS to inject before capture
customJSstringCustom JavaScript to execute before capture

Response

typescript
01interface ScreenshotResponse {
02 screenshot_url: string;
03 width: number;
04 height: number;
05 size: number;
06 mime_type: string;
07 created_at: string;
08}

Example

javascript
01const response = await fetch('https://api.screenshotapi.io/v1/capture', {
02 method: 'POST',
03 headers: {
04 'Content-Type': 'application/json',
05 'Authorization': 'Bearer your_api_key'
06 },
07 body: JSON.stringify({
08 url: 'https://example.com',
09 captureType: 'screenshot',
10 format: 'png',
11 deviceType: 'desktop',
12 width: 1280,
13 height: 800,
14 fullPage: true,
15 removeAds: true
16 })
17});
18
19const data = await response.json();
20console.log(data.screenshot_url);

Device Types

The API supports three device types for viewport simulation:

  • Desktop: Default viewport of 1280x800
  • Tablet: iPad-like viewport of 768x1024
  • Mobile: iPhone-like viewport of 375x667

Output Formats

Available screenshot formats:

  • PNG: Lossless format, best for screenshots with text
  • JPEG: Lossy format, smaller file size
  • WebP: Modern format with good compression and quality

Ready to Get Started?

Get your API key now and start capturing screenshots in minutes.