> ## Documentation Index
> Fetch the complete documentation index at: https://docs.screenshotapi.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Viewports and devices

> Choose page layout dimensions, pixel density, and mobile emulation.

Viewport dimensions are CSS pixels. The device scale factor controls output pixel density. A 1280 × 720 viewport at scale 2 produces a 2560 × 1440 viewport image.

```json theme={null}
{
  "url": "https://example.com",
  "viewport": {
    "width": 1440,
    "height": 900,
    "deviceScaleFactor": 1,
    "isMobile": false,
    "hasTouch": false
  }
}
```

## Limits and defaults

| Viewport field | Allowed range | Default |
| - | - | - |
| `width` | Integer, 320–3840 | 1280 |
| `height` | Integer, 240–2160 | 720 |
| `deviceScaleFactor` | Number, 1–3 | 2 |
| `isMobile` | Boolean | false |
| `hasTouch` | Boolean | false |

The nested viewport keys use camelCase, while most top-level capture options use snake\_case.

## Device presets

Set `device` to a supported preset identifier, such as `iphone_15_pro`. Presets include viewport dimensions, pixel density, mobile/touch settings, and, for mobile devices, a user agent.

```json theme={null}
{
  "url": "https://example.com",
  "device": "iphone_15_pro",
  "format": "png"
}
```

The [generated device reference](/reference/devices) lists the identifiers and dimensions supported by this implementation. A device preset takes precedence when both `device` and `viewport` are supplied. Use either a device preset or an explicit viewport for predictable configuration.

Device emulation changes browser context settings. It does not run the target inside the physical device or its native browser. For an element capture, output dimensions describe the selected element rather than the whole viewport.

Choose a lower scale factor when smaller output is more useful than higher pixel density. For long pages, combine viewport sizing with [full-page diagnostics](/capture/full-page).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.