Devices and emulation

Viewport presets, dark mode, timezone and media type.

viewport_device sets width, height, scale, touch, mobile flag and user agent together. Setting the viewport without the user agent is the most common emulation bug: the page believes it is on desktop while being rendered at phone width.

An explicit field still wins over the preset, so viewport_device=iphone_15_pro with device_scale_factor=1 is a legitimate request for a lighter capture.

The full catalog is served by the API — it is versioned, and a preset is only ever added, never edited, because changing one silently changes the output of everyone already using it:

curl https://api.pagecapture.dev/v1/devices

Landscape variants carry the suffix: iphone_13_pro_max and iphone_13_pro_max_landscape. You can also flip any preset with viewport_landscape=true.

{ "url": "https://example.com", "viewport_device": "iphone_15_pro", "format": "png" }

Other emulation controls:

  • dark_mode=true — emulates prefers-color-scheme: dark
  • reduced_motion=true — emulates prefers-reduced-motion: reduce
  • media_type=print — renders print stylesheets
  • time_zone — any IANA zone, e.g. America/Sao_Paulo
  • geolocation_latitude / geolocation_longitude — what the page's Geolocation API reports

Note that geolocation_* and ip_country_code are independent: one changes what the page reads from the browser, the other changes where the traffic comes from.