Features Full Page Screenshot Wait for Selector & Delay Block Cookie Banners Custom Viewport & Device Website to PDF HTML to Image Dark Mode Image Format & Quality MCP Server Webhook Pricing Docs Blog Log In Sign Up

Devices

The device parameter lets you emulate different devices without manually setting viewport size and User-Agent. When you pick a device preset, the API automatically sets the correct screen dimensions and sends a matching browser User-Agent string — just like a real user visiting the site from that device.

This matters because many websites serve different layouts depending on the device. A mobile User-Agent triggers the mobile version of the site, while a desktop User-Agent shows the full layout. Simply changing the viewport width is often not enough.

Available Presets

DeviceWidthHeightUser-Agent
desktop 1280px 800px Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
mobile 375px 812px Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1
tablet 768px 1024px Mozilla/5.0 (iPad; CPU OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1

The default device is desktop if you don't specify one.

Examples

Mobile screenshot

bash
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.screenshotrun.com/v1/screenshots/capture?url=https://example.com&device=mobile" \
  -o mobile.png

Tablet screenshot

bash
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.screenshotrun.com/v1/screenshots/capture?url=https://example.com&device=tablet&format=webp" \
  -o tablet.webp

Mobile with full page

bash
curl -X POST https://api.screenshotrun.com/v1/screenshots \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "device": "mobile",
    "full_page": true,
    "format": "webp"
  }'

Mobile in dark mode

bash
curl -X POST https://api.screenshotrun.com/v1/screenshots \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "device": "mobile",
    "dark_mode": true,
    "format": "png"
  }'

Retina mobile (2x resolution)

bash
curl -X POST https://api.screenshotrun.com/v1/screenshots \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "device": "mobile",
    "retina": true,
    "format": "png"
  }'
Tip

With retina=true, the output image is 750×1624px (2× the mobile viewport of 375×812). This produces sharper text and icons, matching what you see on a real iPhone Retina display.

Custom Viewport

You are not limited to the three presets above. The width and height parameters let you set any viewport size you want — from a tiny 320px widget to a 4K display. This is useful when you need to emulate a specific device that doesn't match the built-in presets, or when you need an exact resolution for your design workflow.

When you set width and height manually, the API uses them instead of the device preset dimensions. You can combine them with device to keep the User-Agent string while overriding the size, or skip device entirely and set user_agent yourself.

The viewport range is 320–3,840px wide and 200–2,160px tall.

Common viewport sizes

Here are popular device resolutions you can use with width and height:

DeviceWidthHeight
iPhone SE375667
iPhone 14 / 15390844
iPhone 14 Pro Max / 15 Pro Max430932
Samsung Galaxy S24360780
Google Pixel 8412915
iPad Mini7681024
iPad Air / Pro 11"8201180
iPad Pro 12.9"10241366
Laptop (HD)1366768
Laptop (Full HD)19201080
Desktop (QHD)25601440
Desktop (4K)38402160

Example: iPhone 15 Pro Max

bash
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.screenshotrun.com/v1/screenshots/capture?url=https://example.com&width=430&height=932" \
  -o iphone15promax.png

Example: Full HD laptop

bash
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.screenshotrun.com/v1/screenshots/capture?url=https://example.com&width=1920&height=1080" \
  -o fullhd.png

Example: 4K desktop

bash
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.screenshotrun.com/v1/screenshots/capture?url=https://example.com&width=3840&height=2160" \
  -o 4k.png

Custom User-Agent

You can override the device preset's User-Agent with the user_agent parameter. This is useful when you need a specific viewport size from a preset but want to send a different User-Agent string:

bash
curl -X POST https://api.screenshotrun.com/v1/screenshots \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "device": "mobile",
    "user_agent": "Mozilla/5.0 (Linux; Android 14; Pixel 8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Mobile Safari/537.36"
  }'

This uses the mobile viewport (375×812) but sends an Android User-Agent instead of iPhone.

Comparing Desktop, Mobile, and Tablet

A common use case is capturing the same page across all three devices to see how the responsive design looks. Here is a batch request that does exactly that:

python
import requests

API_KEY = "YOUR_API_KEY"
BASE_URL = "https://api.screenshotrun.com/v1"
headers = {"Authorization": f"Bearer {API_KEY}"}

for device in ["desktop", "mobile", "tablet"]:
    response = requests.get(
        f"{BASE_URL}/screenshots/capture",
        headers=headers,
        params={
            "url": "https://example.com",
            "device": device,
            "format": "webp",
        },
    )
    with open(f"screenshot-{device}.webp", "wb") as f:
        f.write(response.content)
    print(f"Saved screenshot-{device}.webp")

Plan Availability

The desktop device preset is available on all plans, including Free. The mobile and tablet presets require a Starter plan or above. Custom width and height values are available on all plans.