Device emulation and responsive testing
Capture screenshots at any viewport size or use device presets to emulate real devices. Perfect for responsive design testing and multi-device compatibility checks.
Set viewport dimensions with viewport_width and viewport_height:
curl -X POST https://www.snapshotai.dev/api/v1/screenshots \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"options": {
"viewport_width": 1920,
"viewport_height": 1080
}
}'Use the device parameter to automatically configure viewport, user agent, and device pixel ratio:
curl -X POST https://www.snapshotai.dev/api/v1/screenshots \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"options": {
"device": "iphone-15-pro-max"
}
}'Automatic Configuration
Device presets automatically set viewport size, user agent string, and device scale factor. No need to specify individual parameters.
1920 × 1080default
1920 × 1080desktop-1080p
2560 × 1440desktop-1440p
3840 × 2160desktop-4k
1728 × 1117macbook-pro-16
1470 × 956macbook-air-13
430 × 932iphone-15-pro-max
393 × 852iphone-15-pro
430 × 932iphone-14-pro-max
393 × 852iphone-14-pro
390 × 844iphone-13
390 × 844iphone-12
375 × 667iphone-se
412 × 915samsung-s25-ultra
384 × 854samsung-s25-plus
360 × 800samsung-s25
412 × 915samsung-s24-ultra
412 × 915samsung-s23-ultra
360 × 800samsung-s22
360 × 800samsung-a54
412 × 915pixel-10-pro
412 × 915pixel-10
412 × 892pixel-9-pro-xl
384 × 831pixel-9-pro
384 × 831pixel-9
412 × 892pixel-8-pro
412 × 915pixel-8
412 × 892pixel-7-pro
412 × 915pixel-7
1032 × 1376ipad-pro-13
1024 × 1366ipad-pro-12.9
820 × 1180ipad-air
768 × 1024ipad-mini
1024 × 1536samsung-tab-s11-ultra
800 × 1280samsung-tab-s11-plus
800 × 1280samsung-tab-s11
1024 × 1536samsung-tab-s10-ultra
800 × 1280samsung-tab-s10-plus
800 × 1280samsung-tab-s10
800 × 1280samsung-tab-s9
1600 × 2560pixel-tablet
Fine-tune viewport behavior with additional parameters:
curl -X POST https://www.snapshotai.dev/api/v1/screenshots \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"options": {
"viewport_width": 1280,
"viewport_height": 720,
"device_scale_factor": 2,
"viewport_mobile": true
}
}'device_scale_factorDevice pixel ratio (1-3). Use 2 for Retina displays.
viewport_mobileEnable mobile viewport meta tag behavior.
viewport_has_touchEmulate touch screen capability.
viewport_landscapeRotate viewport to landscape orientation.
const response = await fetch('https://www.snapshotai.dev/api/v1/screenshots', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: 'https://example.com',
options: {
device: 'iphone-15-pro-max'
// Device preset automatically sets viewport, user agent, and scale factor
}
})
});Min Width
320pxMax Width
3840pxMin Height
240pxMax Height
4320pxBest Practices
Related Guides