Tutorial

How to Take Mobile Screenshots with an API

Capture how websites look on mobile devices using device emulation. iPhone, Pixel, iPad presets built in.

Steps

  1. Choose a device presetSnapAPI has 9 built-in presets: iphone14, iphone14pro, iphone15, pixel7, pixel8, galaxys23, ipad, ipadpro, desktop.
  2. Add the device parameterSet device=iphone14 in your request. This sets the correct viewport, user agent, and device pixel ratio.
  3. Get the resultThe screenshot renders exactly as it would on that device, including responsive CSS and touch layouts.

Code Examples

curl "https://snapapi.tech/v1/screenshot?url=https://example.com&api_key=YOUR_KEY&device=iphone14" -o mobile.png
import requests

response = requests.get("https://snapapi.tech/v1/screenshot", params={
    "url": "https://example.com",
    "api_key": "YOUR_KEY",
    "device": "iphone14"
})
with open("mobile.png", "wb") as f:
    f.write(response.content)
const res = await fetch(
  "https://snapapi.tech/v1/screenshot?" + new URLSearchParams({
    url: "https://example.com",
    api_key: "YOUR_KEY",
    device: "iphone14"
  })
);
require("fs").writeFileSync("mobile.png", Buffer.from(await res.arrayBuffer()));
Get Free API KeyFull API Docs