Skip to main content
POST
Screenshots API

Screenshots API

The Screenshots API allows you to capture high-quality screenshots of any webpage with customizable options and apply device mockups.

Endpoint

Base URL: https://screenshotly.app (or your deployed instance)

Authentication

All requests must include your API key in the Authorization header:

Request Parameters

Core Parameters

string
required
The URL of the webpage to capture

Viewport Configuration

string
Predefined device viewport. Options:
  • desktop (1920×1080)
  • laptop (1366×768)
  • tablet (768×1024)
  • mobile (375×812)
number
Custom viewport width in pixels (ignored if device is specified)
number
Custom viewport height in pixels (ignored if device is specified)

Output Options

string
default:"png"
Output format:
  • png: High quality with transparency
  • jpeg: Smaller file size
  • pdf: Document format (mockups not available)
number
default:"100"
Image quality for JPEG format (1-100)
boolean
default:"false"
Whether to capture the full scrollable page

Capture Options

number
default:"0"
Delay in milliseconds before capturing (0-10000). Useful for:
  • Waiting for animations
  • Loading dynamic content
  • Ensuring popups appear
string
CSS selector to capture specific element. Examples:
  • #hero-section
  • .product-card
  • [data-testid="main-content"]

Mockup Options

string
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

object
AI-powered element removal configuration:
Available element types:
  • cookie-banner: Cookie consent banners and GDPR notices
  • newsletter: Newsletter signup forms and subscription prompts
  • chat-widget: Customer support chat widgets and messengers
  • social-overlay: Social media buttons and sharing widgets
  • ad: Advertisement elements and promotional content

Response

Success Response

  • Status: 200 OK
  • Content-Type: image/png, image/jpeg, or application/pdf
  • Body: Binary file content

Headers

Error Responses

object
Invalid request parameters
object
Missing or invalid API token
object
Rate limit exceeded
object
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
Rate limit information is included in response headers:

Best Practices

Format Selection

  • Use png for screenshots that require transparency or highest quality
  • Use jpeg with quality settings for optimal file size
  • Use pdf for document-style captures or when PDF format is required

Performance Tips

  • Set appropriate delay for dynamic content loading
  • Use fullPage: true only 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