Screenshots API
The Screenshots API allows you to capture high-quality screenshots of any webpage with customizable options and apply device mockups.Endpoint
https://screenshotly.app (or your deployed instance)
Authentication
All requests must include your API key in the Authorization header:Request Parameters
Core Parameters
The URL of the webpage to capture
Viewport Configuration
Predefined device viewport. Options:
desktop(1920×1080)laptop(1366×768)tablet(768×1024)mobile(375×812)
Custom viewport width in pixels (ignored if device is specified)
Custom viewport height in pixels (ignored if device is specified)
Output Options
Output format:
png: High quality with transparencyjpeg: Smaller file sizepdf: Document format (mockups not available)
Image quality for JPEG format (1-100)
Whether to capture the full scrollable page
Capture Options
Delay in milliseconds before capturing (0-10000). Useful for:
- Waiting for animations
- Loading dynamic content
- Ensuring popups appear
CSS selector to capture specific element. Examples:
#hero-section.product-card[data-testid="main-content"]
Mockup Options
Apply a device mockup:
browser-light: Modern browser with light theme (1920×1036)browser-dark: Modern browser with dark theme (1920×1036)iphone-14: iPhone 14 Pro with Dynamic Island (1000×1760)macbook-pro: Modern MacBook Pro (1980×1230)
AI Element Removal
AI-powered element removal configuration:Available element types:
cookie-banner: Cookie consent banners and GDPR noticesnewsletter: Newsletter signup forms and subscription promptschat-widget: Customer support chat widgets and messengerssocial-overlay: Social media buttons and sharing widgetsad: Advertisement elements and promotional content
Response
Success Response
- Status: 200 OK
- Content-Type:
image/png,image/jpeg, orapplication/pdf - Body: Binary file content
Headers
Error Responses
Invalid request parameters
Missing or invalid API token
Rate limit exceeded
Internal server error
Examples
Basic Screenshot
With AI Element Removal and Mockup
Full Page PDF
Rate Limits
Rate limits vary by plan:- Free: 500 requests/month
- Pro: 5000 requests/month
Best Practices
Format Selection
- Use
pngfor screenshots that require transparency or highest quality - Use
jpegwith quality settings for optimal file size - Use
pdffor document-style captures or when PDF format is required
Performance Tips
- Set appropriate
delayfor dynamic content loading - Use
fullPage: trueonly when necessary - Optimize JPEG quality based on your needs
- Consider using mockups only when presentation is important
Security Considerations
- Never expose API keys in client-side code
- Use environment variables to store API keys
- Validate URLs on your end before sending to the API
- Be mindful of rate limits to avoid service interruption