Docs
Skip to content

Avatars

Screenshots_

Capture webpage screenshots with customizable viewport, theme, browser settings, and geolocation options for comprehensive web page documentation.

6 min read

Raw

The screenshots endpoint allows you to capture full webpage screenshots with extensive customization options. You can control the browser viewport size, theme, user agent, geolocation, permissions, and other browser settings to capture web pages exactly as they would appear in different scenarios.

This is valuable for various use cases, including generating visual documentation, creating link previews, automating QA testing across different devices and browsers, or archiving web pages for compliance and record-keeping. Instead of manually taking screenshots or setting up complex headless browser infrastructure, you can generate high-quality screenshots on-demand through a simple API call, ensuring consistency and saving development time.

Get webpage screenshot

Capture a screenshot of a remote webpage with customizable browser settings and viewport options.

Parameters

The getScreenshot method accepts the following parameters:

ParameterTypeDescription
urlstringThe URL of the website to capture. Must be a valid HTTP or HTTPS URL.
headersobjectHTTP headers to send with the browser request. Pass a key-value object with custom headers. Defaults to {} if not provided.
viewportWidthintegerThe width of the browser viewport in pixels. Accepts values between 1-1920. Defaults to 1280 if not provided.
viewportHeightintegerThe height of the browser viewport in pixels. Accepts values between 1-1080. Defaults to 720 if not provided.
scalefloatThe device pixel ratio for the screenshot. Accepts values between 0.1-3 for different DPI settings. Defaults to 1 if not provided.
themestringThe browser color scheme theme. Accepts: light or dark. Defaults to light if not provided.
userAgentstringA custom user agent string for the browser request. Defaults to browser default if not provided.
fullpagebooleanCapture the full scrollable page (true) or only the viewport (false). Defaults to false if not provided.
localestringThe browser locale code (e.g., en-US, fr-FR). Defaults to browser default if not provided.
timezonestringIANA timezone identifier (e.g., America/New_York, Europe/London). Defaults to browser default if not provided.
latitudefloatGeolocation latitude for the screenshot. Accepts values between -90 to 90. Defaults to 0 if not provided.
longitudefloatGeolocation longitude for the screenshot. Accepts values between -180 to 180. Defaults to 0 if not provided.
accuracyfloatGeolocation accuracy in meters. Accepts values between 0-100000. Defaults to 0 if not provided.
touchbooleanEnable touch device support (true) or disable it (false). Defaults to false if not provided.
permissionsarrayArray of browser permissions to grant. Accepts: geolocation, camera, microphone, notifications, midi, push, clipboard-read, clipboard-write, payment-handler, usb, bluetooth, accelerometer, gyroscope, magnetometer, ambient-light-sensor, background-sync, persistent-storage, screen-wake-lock, web-share, xr-spatial-tracking. Defaults to [] if not provided.
sleepintegerWait time in seconds before taking the screenshot. Accepts values between 0-10. Defaults to 0 if not provided.
widthintegerThe output image width in pixels. Pass 0 to use original width, or 1-2000 for custom width. Defaults to 0 (original width) if not provided.
heightintegerThe output image height in pixels. Pass 0 to use original height, or 1-2000 for custom height. Defaults to 0 (original height) if not provided.
qualityintegerScreenshot quality. Accepts values between 0-100. -1 preserves original image quality. Defaults to -1 if not provided.
outputstringOutput image format. Supported formats: jpg, jpeg, png, gif, webp. Defaults to png if not provided.

Viewport customization

Control the browser viewport to capture web pages as they would appear on different devices and screen sizes.

Browser customization

Customize browser settings like theme, user agent, locale, and timezone to simulate different browser environments.

Geolocation simulation

Simulate different geographic locations to see how web pages render with location-based content and features.

Wait time before capture

Use the sleep parameter to wait for a specified duration before capturing the screenshot. This is useful when pages need time to fully load dynamic content, animations, or async resources.

Browser permissions

Grant specific browser permissions to allow web pages to access features like geolocation, camera, microphone, and other APIs during screenshot capture. When you visit a web page that requires certain browser capabilities, it typically prompts users to grant permissions. With the permissions parameter, you can pre-grant these permissions to the browser session, allowing you to capture screenshots of pages that depend on these features without manual intervention.

Available permissions

The following permissions can be granted to the browser session:

PermissionDescription
geolocationAccess device location coordinates
cameraAccess camera for video/photo capture
microphoneAccess microphone for audio recording
notificationsSend browser notifications
midiAccess MIDI devices for music applications
pushReceive push notifications
clipboard-readRead from clipboard
clipboard-writeWrite to clipboard
payment-handlerHandle payment requests
usbAccess USB devices
bluetoothAccess Bluetooth devices
accelerometerAccess device accelerometer sensor
gyroscopeAccess device gyroscope sensor
magnetometerAccess device magnetometer sensor
ambient-light-sensorAccess ambient light sensor
background-syncSync data in the background
persistent-storageUse persistent storage
screen-wake-lockPrevent screen from sleeping
web-shareUse Web Share API
xr-spatial-trackingTrack spatial positioning for XR/VR

By pre-granting permissions, you can capture screenshots of fully functional pages in their active state, rather than showing permission prompts or degraded experiences.

Use cases

Screenshots are commonly used for:

  • Web documentation: Automatically generate visual documentation of web applications and websites
  • Link previews: Display website previews in link cards and social sharing interfaces
  • Performance testing: Capture pages in different browser environments to verify responsive design
  • Accessibility testing: Generate screenshots with different viewport sizes and accessibility settings
  • Localization testing: Verify how pages render in different locales and timezones
  • Browser compatibility: Test how pages appear with different user agents and browser settings
  • Content archival: Create visual snapshots of web pages for archival and reference
  • A/B testing: Compare visual renderings of different page variants
  • Automated reporting: Generate visual reports and dashboards with live web page screenshots
  • QA automation: Verify visual consistency across different browser and device configurations

Was this page helpful?

Share what worked or what we should fix. Once approved, our agents automatically apply suggested updates to the docs.