🎉 Celebrating our Product Hunt launch: get 50% off for 6 months with code HUNT20. Ends Nov 30. See pricing
Menu

Viewport options

Reference for the viewport options of the shotkit screenshot API, with an example request for each.

The browser window the page is rendered in. Pick a device preset or set the size yourself; explicit options override the preset.

viewport_device

Emulate a device preset (sets size, DPR, UA, touch). Sets width, height, device pixel ratio, user agent, touch and mobile mode in one go. All ids are listed below.

Type: enum

All 153 device ids

blackberry_playbook, blackberry_playbook_landscape, blackberry_z30, blackberry_z30_landscape, galaxy_note_3, galaxy_note_3_landscape, galaxy_note_ii, galaxy_note_ii_landscape, galaxy_s5, galaxy_s5_landscape, galaxy_s8, galaxy_s8_landscape, galaxy_s9+, galaxy_s9+_landscape, galaxy_s_iii, galaxy_s_iii_landscape, galaxy_tab_s4, galaxy_tab_s4_landscape, ipad, ipad_(gen_6), ipad_(gen_6)_landscape, ipad_(gen_7), ipad_(gen_7)_landscape, ipad_landscape, ipad_mini, ipad_mini_landscape, ipad_pro, ipad_pro_11, ipad_pro_11_landscape, ipad_pro_landscape, iphone_11, iphone_11_landscape, iphone_11_pro, iphone_11_pro_landscape, iphone_11_pro_max, iphone_11_pro_max_landscape, iphone_12, iphone_12_landscape, iphone_12_mini, iphone_12_mini_landscape, iphone_12_pro, iphone_12_pro_landscape, iphone_12_pro_max, iphone_12_pro_max_landscape, iphone_13, iphone_13_landscape, iphone_13_mini, iphone_13_mini_landscape, iphone_13_pro, iphone_13_pro_landscape, iphone_13_pro_max, iphone_13_pro_max_landscape, iphone_14, iphone_14_landscape, iphone_14_plus, iphone_14_plus_landscape, iphone_14_pro, iphone_14_pro_landscape, iphone_14_pro_max, iphone_14_pro_max_landscape, iphone_15, iphone_15_landscape, iphone_15_plus, iphone_15_plus_landscape, iphone_15_pro, iphone_15_pro_landscape, iphone_15_pro_max, iphone_15_pro_max_landscape, iphone_16, iphone_16_landscape, iphone_16_plus, iphone_16_plus_landscape, iphone_16_pro, iphone_16_pro_landscape, iphone_16_pro_max, iphone_16_pro_max_landscape, iphone_16e, iphone_16e_landscape, iphone_17, iphone_17_landscape, iphone_17_pro, iphone_17_pro_landscape, iphone_17_pro_max, iphone_17_pro_max_landscape, iphone_17e, iphone_17e_landscape, iphone_4, iphone_4_landscape, iphone_5, iphone_5_landscape, iphone_6, iphone_6_landscape, iphone_6_plus, iphone_6_plus_landscape, iphone_7, iphone_7_landscape, iphone_7_plus, iphone_7_plus_landscape, iphone_8, iphone_8_landscape, iphone_8_plus, iphone_8_plus_landscape, iphone_air, iphone_air_landscape, iphone_se, iphone_se_(3rd_gen), iphone_se_(3rd_gen)_landscape, iphone_se_landscape, iphone_x, iphone_x_landscape, iphone_xr, iphone_xr_landscape, jiophone_2, jiophone_2_landscape, kindle_fire_hdx, kindle_fire_hdx_landscape, lg_optimus_l70, lg_optimus_l70_landscape, microsoft_lumia_550, microsoft_lumia_950, microsoft_lumia_950_landscape, moto_g4, moto_g4_landscape, nexus_10, nexus_10_landscape, nexus_4, nexus_4_landscape, nexus_5, nexus_5_landscape, nexus_5x, nexus_5x_landscape, nexus_6, nexus_6_landscape, nexus_6p, nexus_6p_landscape, nexus_7, nexus_7_landscape, nokia_lumia_520, nokia_lumia_520_landscape, nokia_n9, nokia_n9_landscape, pixel_2, pixel_2_landscape, pixel_2_xl, pixel_2_xl_landscape, pixel_3, pixel_3_landscape, pixel_4, pixel_4_landscape, pixel_4a_(5g), pixel_4a_(5g)_landscape, pixel_5, pixel_5_landscape

curl -X POST "https://shotkit.net/api/take" \
  -H "X-Access-Key: YOUR_ACCESS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","viewport_device":"iphone_15_pro"}' \
  --fail-with-body -o shot.jpg

viewport_width

Viewport width in px.

Type: number · Default: 1280 · Range: 1–7680

curl -X POST "https://shotkit.net/api/take" \
  -H "X-Access-Key: YOUR_ACCESS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","viewport_width":1920}' \
  --fail-with-body -o shot.jpg

viewport_height

Viewport height in px.

Type: number · Default: 1024 · Range: 1–7680

curl -X POST "https://shotkit.net/api/take" \
  -H "X-Access-Key: YOUR_ACCESS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","viewport_height":1080}' \
  --fail-with-body -o shot.jpg

device_scale_factor

Device pixel ratio (1–5). Animated formats record at 1×. A 1280×1024 viewport at 2 produces a 2560×2048 image.

Type: number · Default: 1 · Range: 1–5

curl -X POST "https://shotkit.net/api/take" \
  -H "X-Access-Key: YOUR_ACCESS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","device_scale_factor":2}' \
  --fail-with-body -o shot.jpg

viewport_mobile

Respect the meta viewport tag. Makes the page honour <meta name="viewport">, like a phone browser.

Type: boolean · Default: false

curl -X POST "https://shotkit.net/api/take" \
  -H "X-Access-Key: YOUR_ACCESS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","viewport_width":390,"viewport_height":844,"viewport_mobile":true}' \
  --fail-with-body -o shot.jpg

viewport_has_touch

Enable touch events.

Type: boolean · Default: false

curl -X POST "https://shotkit.net/api/take" \
  -H "X-Access-Key: YOUR_ACCESS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","viewport_width":390,"viewport_height":844,"viewport_has_touch":true}' \
  --fail-with-body -o shot.jpg

viewport_landscape

Landscape orientation.

Type: boolean · Default: false

curl -X POST "https://shotkit.net/api/take" \
  -H "X-Access-Key: YOUR_ACCESS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","viewport_device":"ipad_pro_11","viewport_landscape":true}' \
  --fail-with-body -o shot.jpg