Skip to main content

Viewport Presets

Control the viewport size to capture screenshots at different device dimensions. DomShot provides presets for common devices or you can define custom dimensions.

Preset viewports

PresetWidthHeightDevice Scale Factor
mobile375px812px3x
tablet768px1024px2x
desktop1920px1080px1x

Mobile

bash
curl "https://api.domshot.com/shot?key=YOUR_API_KEY&url=https://example.com&viewportType=mobile" \
  --output mobile.png

Tablet

bash
curl "https://api.domshot.com/shot?key=YOUR_API_KEY&url=https://example.com&viewportType=tablet" \
  --output tablet.png

Desktop

bash
curl "https://api.domshot.com/shot?key=YOUR_API_KEY&url=https://example.com&viewportType=desktop" \
  --output desktop.png

Custom viewport

bash
curl "https://api.domshot.com/shot?key=YOUR_API_KEY&url=https://example.com&viewportType=custom&width=1280&height=720&deviceScaleFactor=2" \
  --output custom.png

Parameters

ParameterTypeDefaultDescription
viewportTypestringdesktopmobile, tablet, desktop, or custom
widthnumber1920Custom viewport width (required when viewportType=custom)
heightnumber1080Custom viewport height (required when viewportType=custom)
deviceScaleFactornumber1Device pixel ratio for high-DPI displays
When using preset viewports (mobile, tablet, desktop), the width, height, and deviceScaleFactor parameters are ignored. These parameters only apply when viewportType=custom.

Device scale factor

The device scale factor controls the pixel density for capturing screenshots on high-DPI displays:
  • 1x - Standard displays (desktop default)
  • 2x - Retina displays (tablet default)
  • 3x - Super Retina displays (mobile default)
Higher scale factors produce larger, sharper images at the cost of file size.

See also