ClientLibraryApi

Endpoints for retrieving information about, and managing, tracks and albums that the current user has saved in their “Your Music” library.

Api Reference

Constructors

Link copied to clipboard
constructor(api: GenericSpotifyApi)

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
suspend fun add(type: LibraryType, vararg ids: String)

Save one or more of LibraryType to the current user’s ‘Your Music’ library.

suspend fun add(type: LibraryType, id: String)

Save one of LibraryType to the current user’s ‘Your Music’ library.

Link copied to clipboard
suspend fun contains(type: LibraryType, vararg ids: String): List<Boolean>

Check if one or more of LibraryType is already saved in the current Spotify user’s ‘Your Music’ library.

suspend fun contains(type: LibraryType, id: String): Boolean

Check if the LibraryType with id id is already saved in the current Spotify user’s ‘Your Music’ library.

Link copied to clipboard
suspend fun getSavedAlbums(limit: Int? = api.spotifyApiOptions.defaultLimit, offset: Int? = null, market: Market? = null): PagingObject<SavedAlbum>

Get a list of the albums saved in the current Spotify user’s ‘Your Music’ library.

Link copied to clipboard
suspend fun getSavedEpisodes(limit: Int? = api.spotifyApiOptions.defaultLimit, offset: Int? = null, market: Market? = null): PagingObject<SavedEpisode>

Get a list of the episodes saved in the current Spotify user’s library. This API endpoint is in beta and could change without warning.

Link copied to clipboard
suspend fun getSavedShows(limit: Int? = api.spotifyApiOptions.defaultLimit, offset: Int? = null): PagingObject<SavedShow>

Get a list of shows saved in the current Spotify user’s library. Optional parameters can be used to limit the number of shows returned.

Link copied to clipboard
suspend fun getSavedTracks(limit: Int? = api.spotifyApiOptions.defaultLimit, offset: Int? = null, market: Market? = null): PagingObject<SavedTrack>

Get a list of the songs saved in the current Spotify user’s ‘Your Music’ library.

Link copied to clipboard
suspend fun remove(type: LibraryType, vararg ids: String)

Remove one or more of the LibraryType (tracks or albums) from the current user’s ‘Your Music’ library.

suspend fun remove(type: LibraryType, id: String)

Remove one of LibraryType (track or album) from the current user’s ‘Your Music’ library.