# Devices and sizes

A page does not look the same on a laptop and on a phone. Choose a device, or set the screen yourself.

## Pick a device

`device` sets the screen size, the pixel density and, for a phone or a tablet, a mobile browser. One word instead of three numbers.

- `desktop`
- `desktop_hd`
- `laptop`
- `ipad`
- `ipad_pro`
- `ipad_mini`
- `iphone_15`
- `iphone_15_pro_max`
- `iphone_se`
- `pixel_8`
- `galaxy_s24`

**As a phone sees it**

```bash
curl "https://api.localscreenshot.com/v1/screenshot?url=https://www.wikipedia.org&device=iphone_15" \
  -H "Authorization: Bearer $LOCALSCREENSHOT_API_KEY" \
  -o phone.png
```

## Or set the screen yourself

Without `device`, the screen is 1,440 by 900 pixels.

| Parameter | Type | Description |
| --- | --- | --- |
| `viewport` | string | Screen size as WIDTHxHEIGHT, for example 1440x900. Shortcut for viewport_width and viewport_height. |
| `viewport_width` | integer | Width of the browser window, in pixels. 320 to 3,840. Default: `1440`. |
| `viewport_height` | integer | Height of the browser window, in pixels. With full_page, the image is taller than this. 320 to 2,160. Default: `900`. |
| `device` | string | Capture as this device (screen size, pixel density, mobile browser). One of `desktop`, `desktop_hd`, `laptop`, `ipad`, `ipad_pro`, `ipad_mini`, `iphone_15`, `iphone_15_pro_max`, `iphone_se`, `pixel_8`, `galaxy_s24`. |
| `device_scale_factor` | number | Pixel density. 2 gives a sharper, larger image. 1 to 3. Default: `1`. |
| `color_scheme` | string | Ask the page for its light or dark theme. One of `light`, `dark`. |
| `language` | string | Browser language, for example fr or fr-FR.  Default: `en-US`. |
| `timezone` | string | Browser time zone, for example Europe/Paris. |
| `country` | string | Load the page from this country (ISO 3166-1 alpha-2 code, see /v1/countries). The response reports the country actually observed. If it cannot be obtained, the request fails and is not charged. Costs 2 credits instead of 1. |

`viewport=1280x720` is a shortcut for `viewport_width=1280` and `viewport_height=720`.

**A custom screen, sharper**

```bash
curl "https://api.localscreenshot.com/v1/screenshot?url=https://www.wikipedia.org&viewport=1280x720&device_scale_factor=2" \
  -H "Authorization: Bearer $LOCALSCREENSHOT_API_KEY" \
  -o shot.png
```

## The whole page, or one element

- `full_page=true` captures the page from top to bottom. The image is as wide as the screen and as tall as the page. We scroll the page first, so images that load late are in the picture.
- `selector` captures only the first element that matches a CSS selector, for example `#pricing` or `.chart`. If nothing matches, the screenshot fails with `selector_not_found`.
- They cannot be used together.

**One element only**

```bash
curl "https://api.localscreenshot.com/v1/screenshot?url=https://www.wikipedia.org&selector=.central-featured" \
  -H "Authorization: Bearer $LOCALSCREENSHOT_API_KEY" \
  -o element.png
```

## Dark mode, language, time zone

- `color_scheme=dark` asks the page for its dark theme. A page that has none stays as it is.
- `language` sets the browser language, for example `fr` or `fr-FR`. A site that follows it answers in that language.
- `timezone` sets the browser clock, for example `Europe/Paris`.

These change what the browser says about itself. They do not change where the page is loaded from: for that, see [Countries and attestation](https://docs.localscreenshot.com/countries).
