List Devices
Retrieve all available device presets for viewport emulation.
Endpoint
GET https://api.renderscreenshot.com/v1/devices
Authentication
Include your API key in the Authorization header:
Authorization: Bearer rs_live_xxxxx
Response
The list is shortened here. GET /v1/devices/:id returns one device object in the same shape.
{ "devices": [ { "id": "iphone_14_pro", "name": "iPhone 14 Pro", "viewport": { "width": 393, "height": 852, "device_scale_factor": 3, "is_mobile": true, "has_touch": true }, "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Mobile/15E148 Safari/604.1" }, { "id": "macbook_pro_14", "name": "MacBook Pro 14\"", "viewport": { "width": 1512, "height": 982, "device_scale_factor": 2, "is_mobile": false, "has_touch": false }, "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 13_0) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15" } ] }
Device Properties
| Property | Type | Description |
|---|---|---|
id |
string | Device identifier to use in requests |
name |
string | Human-readable device name |
viewport.width |
integer | Screen width in CSS pixels |
viewport.height |
integer | Screen height in CSS pixels |
viewport.device_scale_factor |
number | Device pixel ratio. Applied as viewport.scale |
viewport.is_mobile |
boolean | Mobile emulation. Applied as viewport.mobile |
viewport.has_touch |
boolean | Touch support. Applied as viewport.touch |
user_agent |
string | User agent sent with the request. Applied as browser.user_agent |
The response uses the device field names. In a screenshot request, set the same values with viewport.scale, viewport.mobile and viewport.touch.
Using Device Presets
Specify a device in your screenshot request:
POST Request
{ "url": "https://example.com", "viewport": { "device": "iphone_14_pro" } }
GET Request
GET /v1/screenshot?url=https://example.com&device=iphone_14_pro
Example
curl https://api.renderscreenshot.com/v1/devices \ -H "Authorization: Bearer rs_live_xxxxx"
Combining Device with Other Options
Device presets set viewport, scale, mobile, and touch automatically. You can override individual settings:
{ "url": "https://example.com", "device": "iphone_14_pro", "viewport": { "width": 852, "height": 393 } }
This uses the iPhone 14 Pro scale, mobile, touch and user agent with the width and height swapped, which gives a landscape capture. viewport.landscape: true only sets the browser's landscape flag. It does not swap the width and height.
See Also
- Viewport Options - Custom viewport configuration
- Devices Reference - Complete device specifications