Skip to content
DocumentationAPI Reference

Player

Get Playback State
client.me.player.getState(PlayerGetStateParams { additional_types, market } query?, RequestOptionsoptions?): PlayerGetStateResponse { actions, context, currently_playing_type, 8 more }
GET/me/player
Transfer Playback
client.me.player.transfer(PlayerTransferParams { device_ids, play, published } body, RequestOptionsoptions?): void
PUT/me/player
Get Available Devices
client.me.player.getDevices(RequestOptionsoptions?): PlayerGetDevicesResponse { devices }
GET/me/player/devices
Get Currently Playing Track
client.me.player.getCurrentlyPlaying(PlayerGetCurrentlyPlayingParams { additional_types, market } query?, RequestOptionsoptions?): PlayerGetCurrentlyPlayingResponse { actions, context, currently_playing_type, 5 more }
GET/me/player/currently-playing
Start/Resume Playback
client.me.player.startPlayback(PlayerStartPlaybackParams { device_id, context_uri, offset, 3 more } params?, RequestOptionsoptions?): void
PUT/me/player/play
Pause Playback
client.me.player.pausePlayback(PlayerPausePlaybackParams { device_id } params?, RequestOptionsoptions?): void
PUT/me/player/pause
Skip To Next
client.me.player.skipNext(PlayerSkipNextParams { device_id } params?, RequestOptionsoptions?): void
POST/me/player/next
Skip To Previous
client.me.player.skipPrevious(PlayerSkipPreviousParams { device_id } params?, RequestOptionsoptions?): void
POST/me/player/previous
Seek To Position
client.me.player.seekToPosition(PlayerSeekToPositionParams { position_ms, device_id } params, RequestOptionsoptions?): void
PUT/me/player/seek
Set Repeat Mode
client.me.player.setRepeatMode(PlayerSetRepeatModeParams { state, device_id } params, RequestOptionsoptions?): void
PUT/me/player/repeat
Set Playback Volume
client.me.player.setVolume(PlayerSetVolumeParams { volume_percent, device_id } params, RequestOptionsoptions?): void
PUT/me/player/volume
Toggle Playback Shuffle
client.me.player.toggleShuffle(PlayerToggleShuffleParams { state, device_id } params, RequestOptionsoptions?): void
PUT/me/player/shuffle
Get Recently Played Tracks
client.me.player.listRecentlyPlayed(PlayerListRecentlyPlayedParams { after, before, limit } query?, RequestOptionsoptions?): CursorURLPage<PlayerListRecentlyPlayedResponse { context, played_at, published, track } >
GET/me/player/recently-played
ModelsExpand Collapse
ContextObject { external_urls, href, published, 2 more }
external_urls?: ExternalURLObject { published, spotify }

External URLs for this context.

published?: boolean

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

spotify?: string

The Spotify URL for the object.

href?: string

A link to the Web API endpoint providing full details of the track.

published?: boolean

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

type?: string

The object type, e.g. "artist", "playlist", "album", "show".

uri?: string

The Spotify URI for the context.

DeviceObject { id, is_active, is_private_session, 6 more }
id?: string | null

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.

is_active?: boolean

If this device is the currently active device.

is_private_session?: boolean

If this device is currently in a private session.

is_restricted?: boolean

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

name?: string

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.

published?: boolean

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

supports_volume?: boolean

If this device can be used to set the volume.

type?: string

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

volume_percent?: number | null

The current volume in percent.

minimum0
maximum100

PlayerQueue

Get the User's Queue
client.me.player.queue.get(RequestOptionsoptions?): QueueGetResponse { currently_playing, published, queue }
GET/me/player/queue
Add Item to Playback Queue
client.me.player.queue.add(QueueAddParams { uri, device_id } params, RequestOptionsoptions?): void
POST/me/player/queue