Skip to content

Devices Pro

Device Viewport Emulation is a Rocket Validator Pro feature that you can use to simulate a device viewport in your site validation reports.

Using the Rocket Validator API you can get the complete list of available devices, and all the details for their specific attributes. You can also check this list at the devices section of the Rocket Validator site.

Attributes

ID
Unique Device ID.
Name
Name of the device.
Width
Viewport width, in pixels.
Height
Viewport height, in pixels.
Device Scale Factor
Scale factor of the device.
Is Mobile
True if it's a mobile device.
Is Landscape
True if it's a landscape device.
Has Touch
True if it's touch enabled.
User Agent
User Agent string. Check the User Agents section to get all the UA strings for the given device.

Example

Example: Device structure

{
  "data": {
    "attributes": {
      "device_scale_factor": 3,
      "has_touch": true,
      "height": 640,
      "is_landscape": false,
      "is_mobile": true,
      "name": "Galaxy Note 3",
      "user_agent": "Mozilla/5.0 (Linux; U; Android 4.3; en-us; SM-N900T Build/JSS15J) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
      "width": 360
    },
    "id": "888f56c2-5e28-404b-8ac1-e71c414694bf",
    "type": "device"
  },
  "jsonapi": {
    "version": "1.0"
  }
}

List of Devices

To list all the available Devices, send a GET request to /api/v1/devices.

GET /api/v1/devices

Retrieve a Device

To retrieve an individual Device, send a GET request to /api/v1/devices/$DEVICE_ID.

GET /api/v1/devices/$DEVICE_ID

Default Device

When a report is run without specifying a device, the default device is used.

To get the properties of the default device, send a GET request to /api/v1/devices/default.

Example: GET /api/v1/devices/default

{
  "data": {
    "attributes": {
      "device_scale_factor": 1,
      "has_touch": false,
      "height": 600,
      "is_landscape": false,
      "is_mobile": false,
      "name": "Default",
      "user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4512.0 Safari/537.36",
      "width": 800
    },
    "id": "",
    "type": "device"
  },
  "jsonapi": {
    "version": "1.0"
  }
}