Skip to content
DocumentationAPI Reference

Get Available Devices

PlayerGetDevicesResponse me().player().getDevices(PlayerGetDevicesParamsparams = PlayerGetDevicesParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/me/player/devices

Get information about a user’s available Spotify Connect devices. Some device models are not supported and will not be listed in the API response.

ParametersExpand Collapse
PlayerGetDevicesParams params
ReturnsExpand Collapse
class PlayerGetDevicesResponse:
List<DeviceObject> devices
Optional<String> id

The device ID. This ID is unique and persistent to some extent. However, this is not guaranteed and any cached device_id should periodically be cleared out and refetched as necessary.

Optional<Boolean> isActive

If this device is the currently active device.

Optional<Boolean> isPrivateSession

If this device is currently in a private session.

Optional<Boolean> isRestricted

Whether controlling this device is restricted. At present if this is "true" then no Web API commands will be accepted by this device.

Optional<String> name

A human-readable name for the device. Some devices have a name that the user can configure (e.g. "Loudest speaker") and some devices have a generic name associated with the manufacturer or device model.

Optional<Boolean> published

The playlist's public/private status (if it should be added to the user's profile or not): true the playlist will be public, false the playlist will be private, null the playlist status is not relevant. For more about public/private status, see Working with Playlists

Optional<Boolean> supportsVolume

If this device can be used to set the volume.

Optional<String> type

Device type, such as "computer", "smartphone" or "speaker".

Optional<Long> volumePercent

The current volume in percent.

minimum0
maximum100

Get Available Devices

package dev.cjav.spotted.example;

import dev.cjav.spotted.client.SpottedClient;
import dev.cjav.spotted.client.okhttp.SpottedOkHttpClient;
import dev.cjav.spotted.models.me.player.PlayerGetDevicesParams;
import dev.cjav.spotted.models.me.player.PlayerGetDevicesResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        SpottedClient client = SpottedOkHttpClient.fromEnv();

        PlayerGetDevicesResponse response = client.me().player().getDevices();
    }
}
{
  "devices": [
    {
      "id": "id",
      "is_active": true,
      "is_private_session": true,
      "is_restricted": true,
      "name": "Kitchen speaker",
      "published": true,
      "supports_volume": true,
      "type": "computer",
      "volume_percent": 59
    }
  ]
}
Returns Examples
{
  "devices": [
    {
      "id": "id",
      "is_active": true,
      "is_private_session": true,
      "is_restricted": true,
      "name": "Kitchen speaker",
      "published": true,
      "supports_volume": true,
      "type": "computer",
      "volume_percent": 59
    }
  ]
}