Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.screenshotly.dev/llms.txt

Use this file to discover all available pages before exploring further.

Screenshotly lets you set exact viewport dimensions and emulate device characteristics like screen density, touch support, and orientation.

Setting viewport dimensions

Use viewport_width and viewport_height to define the browser viewport size in pixels:
const screenshot = await client.capture({
  url: 'https://example.com',
  viewport_width: 1440,
  viewport_height: 900
});
Default values are 1280x1024 when not specified.

Device emulation parameters

ParameterTypeDefaultDescription
viewport_widthinteger1280Viewport width in pixels (100–5000)
viewport_heightinteger1024Viewport height in pixels (100–5000)
device_scale_factornumber1Device pixel ratio (1–3, use 2 for retina)
viewport_mobilebooleanfalseEmulate mobile device behavior
viewport_has_touchbooleanfalseEnable touch event support
viewport_landscapebooleanfalseUse landscape orientation

Common device presets

Here are viewport settings for popular devices:
DeviceWidthHeightScale factorMobile
iPhone 143908443true
iPhone SE3756672true
iPad Air82011802true
iPad Mini (landscape)10247682true
Pixel 74129152.625true
MacBook Pro 14”15129822false
Desktop 1080p192010801false

Examples

Mobile device

const screenshot = await client.capture({
  url: 'https://example.com',
  viewport_width: 390,
  viewport_height: 844,
  device_scale_factor: 3,
  viewport_mobile: true,
  viewport_has_touch: true
});

Tablet in landscape

const screenshot = await client.capture({
  url: 'https://example.com',
  viewport_width: 1024,
  viewport_height: 768,
  device_scale_factor: 2,
  viewport_mobile: true,
  viewport_has_touch: true,
  viewport_landscape: true
});

Retina desktop

const screenshot = await client.capture({
  url: 'https://example.com',
  viewport_width: 1440,
  viewport_height: 900,
  device_scale_factor: 2
});
Combine viewport settings with full_page: true to capture the entire page at a specific device width. The width controls how the page renders responsively, while full-page captures the complete scrollable height.

Testing responsive breakpoints

To test your site across multiple breakpoints, use batch processing with different viewport settings, or loop through common widths:
const breakpoints = [375, 768, 1024, 1440, 1920];

for (const width of breakpoints) {
  const screenshot = await client.capture({
    url: 'https://example.com',
    viewport_width: width,
    viewport_height: 800,
    full_page: true
  });
  console.log(`Captured at ${width}px`);
}