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
Parameter | Type | Description |
---|---|---|
url | string | The 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 |
width | number | Viewport width in pixels |
height | number | Viewport height in pixels |
fullPage | boolean | Capture full page height |
removeAds | boolean | Remove advertisements from the page |
waitDuration | number | Time to wait for dynamic content (seconds) |
selector | string | CSS selector to capture specific element |
customCSS | string | Custom CSS to inject before capture |
customJS | string | Custom 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: true16 })17});1819const 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.