Skip to content
DocumentationAPI Reference

Player

Get Playback State
client.Me.Player.GetState(ctx, query) (*MePlayerGetStateResponse, error)
GET/me/player
Transfer Playback
client.Me.Player.Transfer(ctx, body) error
PUT/me/player
Get Available Devices
client.Me.Player.GetDevices(ctx) (*MePlayerGetDevicesResponse, error)
GET/me/player/devices
Get Currently Playing Track
client.Me.Player.GetCurrentlyPlaying(ctx, query) (*MePlayerGetCurrentlyPlayingResponse, error)
GET/me/player/currently-playing
Start/Resume Playback
client.Me.Player.StartPlayback(ctx, params) error
PUT/me/player/play
Pause Playback
client.Me.Player.PausePlayback(ctx, body) error
PUT/me/player/pause
Skip To Next
client.Me.Player.SkipNext(ctx, body) error
POST/me/player/next
Skip To Previous
client.Me.Player.SkipPrevious(ctx, body) error
POST/me/player/previous
Seek To Position
client.Me.Player.SeekToPosition(ctx, body) error
PUT/me/player/seek
Set Repeat Mode
client.Me.Player.SetRepeatMode(ctx, body) error
PUT/me/player/repeat
Set Playback Volume
client.Me.Player.SetVolume(ctx, body) error
PUT/me/player/volume
Toggle Playback Shuffle
client.Me.Player.ToggleShuffle(ctx, body) error
PUT/me/player/shuffle
Get Recently Played Tracks
client.Me.Player.ListRecentlyPlayed(ctx, query) (*CursorURLPage[MePlayerListRecentlyPlayedResponse], error)
GET/me/player/recently-played
ModelsExpand Collapse
type ContextObject struct{…}
ExternalURLs ExternalURLObjectoptional

External URLs for this context.

Published booloptional

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 stringoptional

The Spotify URL for the object.

Href stringoptional

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

Published booloptional

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 stringoptional

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

Uri stringoptional

The Spotify URI for the context.

type DeviceObject struct{…}
ID stringoptional

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.

IsActive booloptional

If this device is the currently active device.

IsPrivateSession booloptional

If this device is currently in a private session.

IsRestricted booloptional

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

Name stringoptional

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 booloptional

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

SupportsVolume booloptional

If this device can be used to set the volume.

Type stringoptional

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

VolumePercent int64optional

The current volume in percent.

minimum0
maximum100

PlayerQueue

Get the User's Queue
client.Me.Player.Queue.Get(ctx) (*MePlayerQueueGetResponse, error)
GET/me/player/queue
Add Item to Playback Queue
client.Me.Player.Queue.Add(ctx, body) error
POST/me/player/queue