Set exact viewport dimensions for pixel-perfect screenshots. Control width, height, and device pixel ratio.
# 4K screenshot
curl "https://snapapi.tech/v1/screenshot?url=https://example.com&api_key=YOUR_KEY&width=3840&height=2160&scale=1" -o 4k.png
# Retina mobile
curl "https://snapapi.tech/v1/screenshot?url=https://example.com&api_key=YOUR_KEY&width=375&height=812&scale=2" -o retina-mobile.pngimport requests
# 4K screenshot
response = requests.get("https://snapapi.tech/v1/screenshot", params={
"url": "https://example.com",
"api_key": "YOUR_KEY",
"width": "3840",
"height": "2160"
})
with open("4k.png", "wb") as f:
f.write(response.content)// Retina mobile screenshot
const res = await fetch(
"https://snapapi.tech/v1/screenshot?" + new URLSearchParams({
url: "https://example.com",
api_key: "YOUR_KEY",
width: "375",
height: "812",
scale: "2"
})
);
require("fs").writeFileSync("retina-mobile.png", Buffer.from(await res.arrayBuffer()));