final class Spotify extends AnyRef
A Spotify API client. Instantiating a client triggers automatically the authorization flow passed as parameter.
- Alphabetic
- By Inheritance
- Spotify
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Spotify(clientID: String, clientSecret: String, redirectURI: URI, scopes: List[String] = Nil, withPKCE: Boolean = false)
A Spotify API client.
A Spotify API client. It uses by default the Authorization Code flow.
- new Spotify(clientID: String, clientSecret: String)
A Spotify API client.
A Spotify API client. It uses the Client Credentials authorization flow.
- new Spotify(authFlow: AuthFlow)
- authFlow
the authorization flow to use.
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def addItemsToPlaylist(playlistID: String, uris: List[String]): Either[Error, String]
Adds one or more items to a user’s playlist.
Adds one or more items to a user’s playlist.
Adding items to the current user’s public playlists requires authorization of the playlist-modify-public scope; adding items to the current user’s private playlist (including collaborative playlists) requires the playlist-modify-private scope.
- playlistID
the Spotify ID for the playlist
- uris
a list of Spotify URIs to add, can be track or episode URIs. A maximum of 100 items can be added in one request
- returns
a String representing a snapshot ID (which can be used to identify your playlist version in future requests) on success, otherwise it returns Error
- def addItemsToPlaylist(playlistID: String, uris: List[String], position: Int): Either[Error, String]
Adds one or more items to a user’s playlist.
Adds one or more items to a user’s playlist.
Adding items to the current user’s public playlists requires authorization of the playlist-modify-public scope; adding items to the current user’s private playlist (including collaborative playlists) requires the playlist-modify-private scope.
- playlistID
the Spotify ID for the playlist
- uris
a list of Spotify URIs to add, can be track or episode URIs. A maximum of 100 items can be added in one request
- position
the position to insert the items, a zero-based index. For example, to insert the items in the first position: position=0; to insert the items in the third position: position=2 . If omitted, the items will be appended to the playlist. Items are added in the order they are listed in the query string or request body.
- returns
a String representing a snapshot ID (which can be used to identify your playlist version in future requests) on success, otherwise it returns Error
- def areAlbumsSaved(ids: List[String]): Either[Error, List[Boolean]]
Checks if one or more albums is already saved in the current Spotify user’s ‘Your Music’ library.
Checks if one or more albums is already saved in the current Spotify user’s ‘Your Music’ library.
The user-library-read scope must have been authorized by the user.
- ids
a list of the Spotify IDs for the albums. Maximum: 50 IDs
- returns
a List of Booleans on success (in the same order in which the IDs were specified), otherwise it returns Error
- def areShowsSaved(ids: List[String]): Either[Error, List[Boolean]]
Checks if one or more shows is already saved in the current Spotify user’s library.
Checks if one or more shows is already saved in the current Spotify user’s library.
The user-library-read scope must have been authorized by the user.
- ids
a list of the Spotify IDs for the shows. Maximum: 50 IDs
- returns
a List of Booleans on success (in the same order in which the IDs were specified), otherwise it returns Error
- def areTracksSaved(ids: List[String]): Either[Error, List[Boolean]]
Checks if one or more tracks is already saved in the current Spotify user’s library.
Checks if one or more tracks is already saved in the current Spotify user’s library.
The user-library-read scope must have been authorized by the user.
- ids
a list of the Spotify IDs for the tracks. Maximum: 50 IDs
- returns
a List of Booleans on success (in the same order in which the IDs were specified), otherwise it returns Error
- def areUsersFollowingPlaylist(playlistID: String, ids: List[String]): Either[Error, List[Boolean]]
Checks to see if one or more Spotify users are following a specified playlist.
Checks to see if one or more Spotify users are following a specified playlist.
Following a playlist can be done publicly or privately.
Checking if a user publicly follows a playlist doesn’t require any scopes; if the user is publicly following the playlist, this endpoint returns true.
Checking if the user is privately following a playlist is only possible for the current user when that user has granted access to the playlist-read-private scope.
- playlistID
the Spotify ID of the playlist
- ids
a list of Spotify User IDs; the ids of the users that you want to check to see if they follow the playlist. Maximum: 5 IDs
- returns
a List of Booleans on success (in the same order in which the IDs were specified), otherwise it returns Error
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- var authObj: AuthObj
The authentication object associated to this client.
- def changePlaylistDetails(playlistID: String, details: Map[String, String]): Either[Error, Unit]
Changes a playlist’s name and public/private state.
Changes a playlist’s name and public/private state. (The user must, of course, own the playlist.)
Changing a public playlist for a user requires authorization of the playlist-modify-public scope; changing a private playlist requires the playlist-modify-private scope.
- playlistID
the Spotify ID for the playlist
- details
a map storing the details to be changed. Allowed key values are 'name', 'public', 'collaborative' and 'description'
- returns
Unit on success, otherwise it returns Error
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- def createPlaylist(userID: String, name: String, public: Boolean = true, collaborative: Boolean = false, description: String = ""): Either[Error, Playlist]
Creates a playlist for a Spotify user.
Creates a playlist for a Spotify user. (The playlist will be empty until you add tracks.)
Creating a public playlist for a user requires authorization of the playlist-modify-public scope; creating a private playlist requires the playlist-modify-private scope.
- userID
the user’s Spotify user ID
- name
the name for the new playlist, for example "Your Coolest Playlist" . This name does not need to be unique; a user may have several playlists with the same name
- public
(optional) defaults to true. If true the playlist will be public, if false it will be private. To be able to create private playlists, the user must have granted the playlist-modify-private scope
- collaborative
(optional) defaults to false. If true the playlist will be collaborative. Note that to create a collaborative playlist you must also set public to false. To create collaborative playlists you must have granted playlist-modify-private and playlist-modify-public scopes
- description
(optional) value for playlist description as displayed in Spotify Clients and in the Web API
- returns
a Playlist on success, otherwise it returns Error
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def follow(idType: String, ids: List[String]): Either[Error, Unit]
Adds the current user as a follower of one or more artists or other Spotify users.
Adds the current user as a follower of one or more artists or other Spotify users.
Modifying the list of artists or users the current user follows requires authorization of the user-follow-modify scope.
- idType
the ID type: either artist or user
- ids
a list of the artist or the user Spotify IDs. A maximum of 50 IDs can be sent in one request
- returns
Unit on success, otherwise it returns Error
- def followPlaylist(playlistID: String, public: Boolean = true): Either[Error, Unit]
Adds the current user as a follower of a playlist.
Adds the current user as a follower of a playlist.
Following a playlist publicly requires authorization of the playlist-modify-public scope; following it privately requires the playlist-modify-private scope.
- playlistID
the Spotify ID of the playlist. Any playlist can be followed, regardless of its public/private status, as long as you know its playlist ID
- public
(optional) defaults to true. If true the playlist will be included in user’s public playlists, if false it will remain private. To be able to follow playlists privately, the user must have granted the playlist-modify-private scope
- returns
Unit on success, otherwise it returns Error
- def getAlbum(id: String, market: String = ""): Either[Error, Album]
Gets Spotify catalog information for a single album.
Gets Spotify catalog information for a single album.
- id
the Spotify ID for the album
- market
(optional) an ISO 3166-1 alpha-2 country code or the string from_token. Provide this parameter if you want to apply Track Relinking
- returns
an Album on success, otherwise it returns Error
- def getAlbumTracks(id: String, limit: Int = 20, offset: Int = 0, market: String = ""): Either[Error, Paging[Track]]
Gets Spotify catalog information about an album’s tracks.
Gets Spotify catalog information about an album’s tracks. Optional parameters can be used to limit the number of tracks returned.
- id
the Spotify ID for the album
- limit
(optional) the maximum number of tracks to return. Default: 20. Minimum: 1. Maximum: 50
- offset
(optional) the index of the first track to return. Default: 0 (the first object). Use with limit to get the next set of tracks
- market
(optional) an ISO 3166-1 alpha-2 country code or the string from_token. Provide this parameter if you want to apply Track Relinking
- returns
a Paging object wrapping Tracks on success, otherwise it returns Error
- def getAlbums(ids: List[String], market: String = ""): Either[Error, List[Album]]
Gets Spotify catalog information for multiple albums identified by their Spotify IDs.
Gets Spotify catalog information for multiple albums identified by their Spotify IDs.
Objects are returned in the order requested. If an object is not found, a null value is returned in the appropriate position. Duplicate ids in the query will result in duplicate objects in the response.
- ids
a list containing the Spotify IDs for the albums. Maximum: 20 IDs
- market
(optional) an ISO 3166-1 alpha-2 country code or the string from_token. Provide this parameter if you want to apply Track Relinking
- returns
a List of Albums on success, otherwise it returns Error
- def getArtist(id: String): Either[Error, Artist]
Gets Spotify catalog information for a single artist identified by their unique Spotify ID.
Gets Spotify catalog information for a single artist identified by their unique Spotify ID.
- id
the Spotify ID for the artist
- returns
an Artist on success, otherwise it returns Error
- def getArtistAlbums(id: String, includeGroups: List[String] = Nil, market: String = "", limit: Int = 20, offset: Int = 0): Either[Error, Paging[Album]]
Gets Spotify catalog information about an artist’s albums.
Gets Spotify catalog information about an artist’s albums. Optional parameters can be specified in the query string to filter and sort the response.
- id
the Spotify ID for the artist
- includeGroups
(optional) a list of keywords that will be used to filter the response. If not supplied, all album types will be returned. Valid values are:
- album
- single
- appears_on
- compilation For example: include_groups=album,single
- market
(optional) an ISO 3166-1 alpha-2 country code or the string from_token. Supply this parameter to limit the response to one particular geographical market. For example, for albums available in Sweden: country=SE. If not given, results will be returned for all countries and you are likely to get duplicate results per album, one for each country in which the album is available!
- limit
(optional) the number of album objects to return. Default: 20. Minimum: 1. Maximum: 50. For example: limit=2
- offset
(optional) the index of the first album to return. Default: 0 (i.e., the first album). Use with limit to get the next set of albums.
- returns
a Paging object wrapping Albums on success, otherwise it returns Error
- def getArtistRelatedArtists(id: String): Either[Error, List[Artist]]
Gets Spotify catalog information about artists similar to a given artist.
Gets Spotify catalog information about artists similar to a given artist. Similarity is based on analysis of the Spotify community’s listening history.
- id
the Spotify ID for the artist
- returns
a List of up to 20 Artists on success, otherwise it returns Error
- def getArtistTopTracks(id: String, country: String): Either[Error, List[Track]]
Gets Spotify catalog information about an artist’s top tracks by country.
Gets Spotify catalog information about an artist’s top tracks by country.
- id
the Spotify ID for the artist
- country
an ISO 3166-1 alpha-2 country code or the string from_token.
- returns
a List of up to 10 Tracks on success, otherwise it returns Error
- def getArtists(ids: List[String]): Either[Error, List[Artist]]
Gets Spotify catalog information for several artists based on their Spotify IDs.
Gets Spotify catalog information for several artists based on their Spotify IDs.
Objects are returned in the order requested. If an object is not found, a null value is returned in the appropriate position. Duplicate ids in the query will result in duplicate objects in the response.
- ids
a list containing the Spotify IDs for the albums. Maximum: 50 IDs
- returns
a List of Artists on success, otherwise it returns Error
- def getCategories(country: String = "", locale: String = "", limit: Int = 20, offset: Int = 0): Either[Error, Paging[Category]]
Gets a list of categories used to tag items in Spotify (on, for example, the Spotify player’s “Browse” tab).
Gets a list of categories used to tag items in Spotify (on, for example, the Spotify player’s “Browse” tab).
- country
(optional) a country: an ISO 3166-1 alpha-2 country code Provide this parameter if you want to narrow the list of returned categories to those relevant to a particular country. If omitted, the returned items will be globally relevant
- locale
(optional) the desired language, consisting of an ISO 639-1 language code and an ISO 3166-1 alpha-2 country code, joined by an underscore. For example: es_MX, meaning “Spanish (Mexico)”. Provide this parameter if you want the category metadata returned in a particular language. Note that, if locale is not supplied, or if the specified language is not available, all strings will be returned in the Spotify default language (American English). The locale parameter, combined with the country parameter, may give odd results if not carefully matched. For example country=SE&locale=de_DE will return a list of categories relevant to Sweden but as German language strings
- limit
(optional) the maximum number of categories to return. Default: 20. Minimum: 1. Maximum: 50
- offset
(optional) the index of the first item to return. Default: 0 (the first object). Use with limit to get the next set of categories.
- returns
a Paging object wrapping Categorys on success, otherwise it returns Error
- def getCategory(id: String, country: String = "", locale: String = ""): Either[Error, Category]
Gets a single category used to tag items in Spotify (on, for example, the Spotify player’s “Browse” tab).
Gets a single category used to tag items in Spotify (on, for example, the Spotify player’s “Browse” tab).
- id
the Spotify category ID for the category
- country
(optional) a country: an ISO 3166-1 alpha-2 country code. Provide this parameter to ensure that the category exists for a particular country
- locale
(optional) the desired language, consisting of an ISO 639-1 language code and an ISO 3166-1 alpha-2 country code, joined by an underscore. For example: es_MX, meaning "Spanish (Mexico)". Provide this parameter if you want the category strings returned in a particular language. Note that, if locale is not supplied, or if the specified language is not available, the category strings returned will be in the Spotify default language (American English)
- returns
a Category on success, otherwise it returns Error
- def getCategoryPlaylists(id: String, country: String = "", limit: Int = 20, offset: Int = 0): Either[Error, Paging[Playlist]]
Gets a list of Spotify playlists tagged with a particular category.
Gets a list of Spotify playlists tagged with a particular category.
- id
the Spotify category ID for the category
- country
(optional) a country: an ISO 3166-1 alpha-2 country code
- limit
(optional) the maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50
- offset
(optional) the index of the first item to return. Default: 0 (the first object). Use with limit to get the next set of items
- returns
a Paging object wrapping Playlists on success, otherwise it returns Error
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def getCurrentUserPlaylists(limit: Int = 20, offset: Int = 0): Either[Error, Paging[Playlist]]
Gets a list of the playlists owned or followed by the current Spotify user.
Gets a list of the playlists owned or followed by the current Spotify user.
Private playlists are only retrievable for the current user and requires the playlist-read-private scope to have been authorized by the user. Note that this scope alone will not return collaborative playlists, even though they are always private. Collaborative playlists are only retrievable for the current user and requires the playlist-read-collaborative scope to have been authorized by the user.
- limit
(optional) the maximum number of playlists to return. Default: 20. Minimum: 1. Maximum: 50
- offset
(optional) the index of the first playlist to return. Default: 0 (the first object). Maximum offset: 100.000. Use with limit to get the next set of playlists
- returns
a Paging object wrapping Playlists on success, otherwise it returns Error
- def getCurrentUserProfile: Either[Error, User]
Gets detailed profile information about the current user (including the current user’s username).
Gets detailed profile information about the current user (including the current user’s username).
Reading the user’s email address requires the user-read-email scope; reading country and product subscription level requires the user-read-private scope.
N.B. If the user-read-email scope is authorized, the returned User will include the email address that was entered when the user created their Spotify account. This email address is unverified; do not assume that the email address belongs to the user.
- returns
a User on success, otherwise it returns Error
- def getEpisode(id: String, market: String = ""): Either[Error, Episode]
Gets Spotify catalog information for a single episode identified by its unique Spotify ID.
Gets Spotify catalog information for a single episode identified by its unique Spotify ID.
Reading the user’s resume points on episode objects requires the user-read-playback-position scope.
If an episode is unavailable in the given market the HTTP status code in the response header is 404 NOT FOUND.
- id
the Spotify ID for the episode
- market
(optional) an ISO 3166-1 alpha-2 country code. If a country code is specified, only shows and episodes that are available in that market will be returned. If a valid user access token is specified in the request header, the country associated with the user account will take priority over this parameter. Note: If neither market or user country are provided, the content is considered unavailable for the client. Users can view the country that is associated with their account in the account settings
- returns
an Episode on success, otherwise it returns Error
- def getEpisodes(ids: List[String], market: String = ""): Either[Error, List[Episode]]
Gets Spotify catalog information for multiple episodes based on their Spotify IDs.
Gets Spotify catalog information for multiple episodes based on their Spotify IDs.
Objects are returned in the order requested. If an object is not found or unavailable in the given market, a null value is returned in the appropriate position.
- ids
a comma-separated list of the Spotify IDs for the episodes. Maximum: 50 IDs
- market
(optional) an ISO 3166-1 alpha-2 country code. If a country code is specified, only shows and episodes that are available in that market will be returned. If a valid user access token is specified in the request header, the country associated with the user account will take priority over this parameter. Note: If neither market or user country are provided, the content is considered unavailable for the client. Users can view the country that is associated with their account in the account settings
- returns
a List of Episodes on success, otherwise it returns Error
- def getFeaturedPlaylists(locale: String = "", country: String = "", timestamp: String = "", limit: Int = 20, offset: Int = 0): Either[Error, (String, Paging[Playlist])]
Gets a list of Spotify featured playlists (shown, for example, on a Spotify player’s ‘Browse’ tab).
Gets a list of Spotify featured playlists (shown, for example, on a Spotify player’s ‘Browse’ tab).
- locale
(optional) the desired language, consisting of a lowercase ISO 639-1 language code and an uppercase ISO 3166-1 alpha-2 country code, joined by an underscore. For example: es_MX, meaning “Spanish (Mexico)”. Provide this parameter if you want the results returned in a particular language (where available). Note that, if locale is not supplied, or if the specified language is not available, all strings will be returned in the Spotify default language (American English). The locale parameter, combined with the country parameter, may give odd results if not carefully matched. For example country=SE&locale=de_DE will return a list of categories relevant to Sweden but as German language strings
- country
(optional) a country: an ISO 3166-1 alpha-2 country code. Provide this parameter if you want the list of returned items to be relevant to a particular country. If omitted, the returned items will be relevant to all countries
- timestamp
(optional) a timestamp in ISO 8601 format: yyyy-MM-ddTHH:mm:ss. Use this parameter to specify the user’s local time to get results tailored for that specific date and time in the day. If not provided, the response defaults to the current UTC time. Example: “2014-10-23T09:00:00” for a user whose local time is 9AM. If there were no featured playlists (or there is no data) at the specified time, the response will revert to the current UTC time
- limit
(optional) the maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50
- offset
(optional) the index of the first item to return. Default: 0 (the first object). Use with limit to get the next set of items
- returns
a pair containing a message and a Paging object wrapping Playlists on success, otherwise it returns Error
- def getFollowedArtists(limit: Int = 20, after: String = ""): Either[Error, CursorPaging[Artist]]
Gets the current user’s followed artists.
Gets the current user’s followed artists.
Getting details of the artists or users the current user follows requires authorization of the user-follow-read scope.
- limit
(optional) the maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50
- after
(optional) the last artist ID retrieved from the previous request
- returns
a CursorPaging object wrapping Artists on success, otherwise it returns Error
- def getNewReleases(country: String = "", limit: Int = 20, offset: Int = 0): Either[Error, Paging[Album]]
Gets a list of new album releases featured in Spotify (shown, for example, on a Spotify player’s “Browse” tab).
Gets a list of new album releases featured in Spotify (shown, for example, on a Spotify player’s “Browse” tab).
- country
(optional) a country: an ISO 3166-1 alpha-2 country code. Provide this parameter if you want the list of returned items to be relevant to a particular country. If omitted, the returned items will be relevant to all countries
- limit
(optional) the maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50
- offset
(optional) the index of the first item to return. Default: 0 (the first object). Use with limit to get the next set of items
- returns
a Paging object wrapping Albums on success, otherwise it returns Error
- def getPlaylist(playlistID: String, fields: String = "", market: String = ""): Either[Error, Playlist]
Gets a playlist owned by a Spotify user.
Gets a playlist owned by a Spotify user.
Both Public and Private playlists belonging to any user are retrievable on provision of a valid access token.
If an episode is unavailable in the given market, its information will not be included in the response.
- playlistID
the Spotify ID for the playlist
- fields
(optional) filters for the query: a string containing a comma-separated list of the fields to return. If omitted, all fields are returned. For example, to get just the playlist’s description and URI: fields=description,uri. A dot separator can be used to specify non-reoccurring fields, while parentheses can be used to specify reoccurring fields within objects. For example, to get just the added date and user ID of the adder: fields=tracks.items(added_at,added_by.id). Use multiple parentheses to drill down into nested objects, for example: fields=tracks.items(track(name,href,album(name,href))). Fields can be excluded by prefixing them with an exclamation mark, for example: fields=tracks.items(track(name,href,album(!name,href)))
- market
(optional) an ISO 3166-1 alpha-2 country code or the string from_token. Provide this parameter if you want to apply Track Relinking
- returns
a Playlist on success, otherwise it returns Error
- def getPlaylistCoverImage(playlistID: String): Either[Error, List[Image]]
Gets the current image associated with a specific playlist.
Gets the current image associated with a specific playlist.
Current playlist image for both Public and Private playlists of any user are retrievable on provision of a valid access token.
- playlistID
the Spotify ID for the playlist
- returns
a List of Images on success, otherwise it returns Error
- def getPlaylistTracks(playlistID: String, fields: String = "", limit: Int = 100, offset: Int = 0, market: String = ""): Either[Error, Paging[PlaylistTrack]]
Gets full details of the tracks of a playlist owned by a Spotify user.
Gets full details of the tracks of a playlist owned by a Spotify user.
Both Public and Private playlists belonging to any user are retrievable on provision of a valid access token.
- playlistID
the Spotify ID for the playlist
- fields
(optional) Filters for the query: a string representing a comma-separated list of the fields to return. If omitted, all fields are returned. For example, to get just the total number of items and the request limit: fields=total,limit. A dot separator can be used to specify non-reoccurring fields, while parentheses can be used to specify reoccurring fields within objects. For example, to get just the added date and user ID of the adder: fields=items(added_at,added_by.id). Use multiple parentheses to drill down into nested objects, for example: fields=items(track(name,href,album(name,href))). Fields can be excluded by prefixing them with an exclamation mark, for example: fields=items.track.album(!external_urls,images)
- limit
(optional) the maximum number of items to return. Default: 100. Minimum: 1. Maximum: 100
- offset
(optional) the index of the first item to return. Default: 0 (the first object)
- market
(optional) an ISO 3166-1 alpha-2 country code or the string from_token. Provide this parameter if you want to apply Track Relinking
- returns
a Paging object wrapping PlaylistTracks on success, otherwise it returns Error
- def getRecommendations(limit: Int = 20, market: String = "", attributes: Map[String, String] = Map.empty, seedArtists: List[String] = Nil, seedGenres: List[String] = Nil, seedTracks: List[String] = Nil): Either[Error, Recommendations]
Creates a playlist-style listening experience based on seed artists, tracks and genres.
Creates a playlist-style listening experience based on seed artists, tracks and genres. Recommendations are generated based on the available information for a given seed entity and matched against similar artists and tracks. If there is sufficient information about the provided seeds, a list of tracks will be returned together with pool size details. For artists and tracks that are very new or obscure there might not be enough data to generate a list of tracks.
N.B. at least one seed must be provided.
- limit
(optional) the target size of the list of recommended tracks. For seeds with unusually small pools or when highly restrictive filtering is applied, it may be impossible to generate the requested number of recommended tracks. Debugging information for such cases is available in the response. Default: 20. Minimum: 1. Maximum: 100
- market
(optional) an ISO 3166-1 alpha-2 country code or the string from_token. Provide this parameter if you want to apply Track Relinking. Because min_*, max_* and target_* are applied to pools before relinking, the generated results may not precisely match the filters applied. Original, non-relinked tracks are available via the linked_from attribute of the relinked track response
- attributes
(optional) a map containing tunable track attributes. Keys can start by either "max_", "min_" or "target_". See the Spotify documentation for more details.
- seedArtists
a comma separated list of Spotify IDs for seed artists. Up to 5 seed values may be provided in any combination of seed_artists, seed_tracks and seed_genres
- seedGenres
a comma separated list of any genres in the set of available genre seeds. Up to 5 seed values may be provided in any combination of seed_artists, seed_tracks and seed_genres
- seedTracks
a comma separated list of Spotify IDs for a seed track. Up to 5 seed values may be provided in any combination of seed_artists, seed_tracks and seed_genres
- returns
a Recommendations on success, otherwise it returns Error
- def getSavedAlbums(limit: Int = 20, offset: Int = 0, market: String = ""): Either[Error, Paging[SavedAlbum]]
Gets a list of the albums saved in the current Spotify user’s ‘Your Music’ library.
Gets a list of the albums saved in the current Spotify user’s ‘Your Music’ library.
The user-library-read scope must have been authorized by the user.
- limit
(optional) the maximum number of objects to return. Default: 20. Minimum: 1. Maximum: 50
- offset
(optional) the index of the first object to return. Default: 0 (i.e., the first object). Use with limit to get the next set of objects
- market
(optional) an ISO 3166-1 alpha-2 country code or the string from_token. Provide this parameter if you want to apply Track Relinking
- returns
a Paging object wrapping SavedAlbums on success, otherwise it returns Error
- def getSavedShows(limit: Int = 20, offset: Int = 0, market: String = ""): Either[Error, Paging[SavedShow]]
Get a list of shows saved in the current Spotify user’s library.
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.
The user-library-read scope must have been authorized by the user.
If the current user has no shows saved, the response will be an empty array. If a show is unavailable in the given market it is filtered out. The total field in the paging object represents the number of all items, filtered or not, and thus might be larger than the actual total number of observable items.
- limit
(optional) the maximum number of shows to return. Default: 20. Minimum: 1. Maximum: 50
- offset
(optional) the index of the first show to return. Default: 0 (i.e., the first object). Use with limit to get the next set of shows
- market
(optional) an ISO 3166-1 alpha-2 country code or the string from_token. Provide this parameter if you want to apply Track Relinking
- returns
a Paging object wrapping SavedShows on success, otherwise it returns Error
- def getSavedTracks(limit: Int = 20, offset: Int = 0, market: String = ""): Either[Error, Paging[SavedTrack]]
Get a list of shows saved in the current Spotify user’s library.
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.
The user-library-read scope must have been authorized by the user.
- limit
(optional) the maximum number of objects to return. Default: 20. Minimum: 1. Maximum: 50
- offset
(optional) the index of the first object to return. Default: 0 (i.e., the first object). Use with limit to get the next set of objects
- market
(optional) an ISO 3166-1 alpha-2 country code or the string from_token. Provide this parameter if you want to apply Track Relinking
- returns
a Paging object wrapping SavedTracks on success, otherwise it returns Error
- def getShow(id: String, market: String = ""): Either[Error, Show]
Gets Spotify catalog information for a single show identified by its unique Spotify ID.
Gets Spotify catalog information for a single show identified by its unique Spotify ID.
Reading the user’s resume points on episode objects requires the user-read-playback-position scope.
If a show is unavailable in the given market the HTTP status code in the response header is 404 NOT FOUND. Unavailable episodes are filtered out.
- id
the Spotify ID for the show.
- market
(optional) an ISO 3166-1 alpha-2 country code. If a country code is specified, only shows and episodes that are available in that market will be returned. If a valid user access token is specified in the request header, the country associated with the user account will take priority over this parameter. Note: If neither market or user country are provided, the content is considered unavailable for the client. Users can view the country that is associated with their account in the account settings
- returns
a Show on success, otherwise it returns Error
- def getShowEpisodes(id: String, market: String = "", limit: Int = 20, offset: Int = 0): Either[Error, Paging[Episode]]
Gets Spotify catalog information about a show’s episodes.
Gets Spotify catalog information about a show’s episodes. Optional parameters can be used to limit the number of episodes returned.
Reading the user’s resume points on episode objects requires the user-read-playback-position scope.
If a show is unavailable in the given market the HTTP status code in the response header is 404 NOT FOUND. Unavailable episodes are filtered out.
- id
the Spotify ID for the show
- market
(optional) an ISO 3166-1 alpha-2 country code. If a country code is specified, only shows and episodes that are available in that market will be returned. If a valid user access token is specified in the request header, the country associated with the user account will take priority over this parameter. Note: If neither market or user country are provided, the content is considered unavailable for the client. Users can view the country that is associated with their account in the account settings
- limit
(optional) the maximum number of episodes to return. Default: 20. Minimum: 1. Maximum: 50
- offset
(optional) the index of the first episode to return. Default: 0 (the first object). Use with limit to get the next set of episodes
- returns
a Paging object wrapping Episodes on success, otherwise it returns Error
- def getShows(ids: List[String], market: String = ""): Either[Error, List[Show]]
Gets Spotify catalog information for multiple shows based on their Spotify IDs.
Gets Spotify catalog information for multiple shows based on their Spotify IDs.
Reading the user’s resume points on episode objects requires the user-read-playback-position scope.
Objects are returned in the order requested. If an object is not found or unavailable in the given market, a null value is returned in the appropriate position.
- ids
a comma-separated list of the Spotify IDs for the shows. Maximum: 50 IDs
- market
(optional) an ISO 3166-1 alpha-2 country code. If a country code is specified, only shows and episodes that are available in that market will be returned. If a valid user access token is specified in the request header, the country associated with the user account will take priority over this parameter. Note: If neither market or user country are provided, the content is considered unavailable for the client. Users can view the country that is associated with their account in the account settings.
- returns
a List of Shows on success, otherwise it returns Error
- def getTopArtists(limit: Int = 20, offset: Int = 0, timeRange: TimeRange = MediumTerm): Either[Error, Paging[Artist]]
Gets the current user’s top artists based on calculated affinity.
Gets the current user’s top artists based on calculated affinity.
Getting details of a user’s top artists and tracks requires authorization of the user-top-read scope.
- limit
(optional) the number of entities to return. Default: 20. Minimum: 1. Maximum: 50
- offset
(optional) the index of the first entity to return. Default: 0 (i.e., the first track). Use with limit to get the next set of entities
- timeRange
(optional) Over what time frame the affinities are computed. Valid values: LongTerm (calculated from several years of data and including all new data as it becomes available), MediumTerm (approximately last 6 months), ShortTerm (approximately last 4 weeks). Default: MediumTerm.
- returns
a Paging object wrapping Artists on success, otherwise it returns Error
- def getTopTracks(limit: Int = 20, offset: Int = 0, timeRange: TimeRange = MediumTerm): Either[Error, Paging[Track]]
Gets the current user’s top tracks based on calculated affinity.
Gets the current user’s top tracks based on calculated affinity.
Getting details of a user’s top artists and tracks requires authorization of the user-top-read scope.
- limit
(optional) the number of entities to return. Default: 20. Minimum: 1. Maximum: 50
- offset
(optional) the index of the first entity to return. Default: 0 (i.e., the first track). Use with limit to get the next set of entities
- timeRange
(optional) Over what time frame the affinities are computed. Valid values: LongTerm (calculated from several years of data and including all new data as it becomes available), MediumTerm (approximately last 6 months), ShortTerm (approximately last 4 weeks). Default: MediumTerm.
- returns
a Paging object wrapping Tracks on success, otherwise it returns Error
- def getTrack(id: String, market: String = ""): Either[Error, Track]
Gets Spotify catalog information for a single track identified by its unique Spotify ID.
Gets Spotify catalog information for a single track identified by its unique Spotify ID.
- id
the Spotify ID for the track
- market
(optional) an ISO 3166-1 alpha-2 country code or the string from_token. Provide this parameter if you want to apply Track Relinking
- returns
a Track on success, otherwise it returns Error
- def getTrackAudioAnalysis(id: String): Either[Error, AudioAnalysis]
Gets a detailed audio analysis for a single track identified by its unique Spotify ID.
Gets a detailed audio analysis for a single track identified by its unique Spotify ID.
The Audio Analysis endpoint provides low-level audio analysis for all of the tracks in the Spotify catalog. The Audio Analysis describes the track’s structure and musical content, including rhythm, pitch, and timbre. All information is precise to the audio sample.
Many elements of analysis include confidence values, a floating-point number ranging from 0.0 to 1.0. Confidence indicates the reliability of its corresponding attribute. Elements carrying a small confidence value should be considered speculative. There may not be sufficient data in the audio to compute the attribute with high certainty.
- id
the Spotify ID for the track
- returns
an AudioAnalysis on success, otherwise it returns Error
- def getTrackAudioFeatures(id: String): Either[Error, AudioFeatures]
Gets audio feature information for a single track identified by its unique Spotify ID.
Gets audio feature information for a single track identified by its unique Spotify ID.
- id
the Spotify ID for the track
- returns
an AudioFeatures on success, otherwise it returns Error
- def getTracks(ids: List[String], market: String = ""): Either[Error, List[Track]]
Gets Spotify catalog information for multiple tracks based on their Spotify IDs.
Gets Spotify catalog information for multiple tracks based on their Spotify IDs.
Objects are returned in the order requested. If an object is not found, a null value is returned in the appropriate position. Duplicate ids in the query will result in duplicate objects in the response.
- ids
a comma-separated list of the Spotify IDs for the tracks. Maximum: 50 IDs
- market
(optional) an ISO 3166-1 alpha-2 country code or the string from_token. Provide this parameter if you want to apply Track Relinking
- returns
a List of Track on success, otherwise it returns Error
- def getTracksAudioFeatures(ids: List[String]): Either[Error, List[AudioFeatures]]
Gets audio features for multiple tracks based on their Spotify IDs.
Gets audio features for multiple tracks based on their Spotify IDs.
Objects are returned in the order requested. If an object is not found, a null value is returned in the appropriate position. Duplicate ids in the query will result in duplicate objects in the response.
- ids
a comma-separated list of the Spotify IDs for the tracks. Maximum: 100 IDs
- returns
a List of AudioFeatures on success, otherwise it returns Error
- def getUserPlaylists(userID: String, limit: Int = 20, offset: Int = 0): Either[Error, Paging[Playlist]]
Gets a list of the playlists owned or followed by a Spotify user.
Gets a list of the playlists owned or followed by a Spotify user.
Private playlists are only retrievable for the current user and requires the playlist-read-private scope to have been authorized by the user. Note that this scope alone will not return collaborative playlists, even though they are always private. Collaborative playlists are only retrievable for the current user and requires the playlist-read-collaborative scope to have been authorized by the user.
- limit
(optional) the maximum number of playlists to return. Default: 20. Minimum: 1. Maximum: 50
- offset
(optional) the index of the first playlist to return. Default: 0 (the first object). Maximum offset: 100.000. Use with limit to get the next set of playlists
- returns
a Paging object wrapping Playlists on success, otherwise it returns Error
- def getUserProfile(userID: String): Either[Error, User]
Gets public profile information about a Spotify user.
Gets public profile information about a Spotify user.
- userID
the user’s Spotify user ID
- returns
a User on success, otherwise it returns Error
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def isFollowing(idType: String, ids: List[String]): Either[Error, List[Boolean]]
Checks to see if the current user is following one or more artists or other Spotify users.
Checks to see if the current user is following one or more artists or other Spotify users.
Getting details of the artists or users the current user follows requires authorization of the user-follow-read scope.
- idType
the ID type: either artist or user
- ids
a list of the artist or the user Spotify IDs to check. A maximum of 50 IDs can be sent in one request
- returns
a List of Booleans on success (in the same order in which the IDs were specified), otherwise it returns Error
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def removePlaylistItems(playlistID: String, uris: List[URI], positions: List[List[Int]] = Nil, snapshotID: String = ""): Either[Error, String]
Removes one or more items from a user’s playlist.
Removes one or more items from a user’s playlist.
Removing items from a user’s public playlist requires authorization of the playlist-modify-public scope; removing items from a private playlist requires the playlist-modify-private scope.
- playlistID
the Spotify ID for the playlist
- uris
a list of Spotify URIs of the items to remove. Maximum length: 100
- positions
(optional) a list of current positions of the items to remove, in the same order as the uris parameter. Each list of positions is zero-indexed, that is the first item in the playlist has the value 0, the second item 1, and so on. Maximum length: 100
- snapshotID
(optional) the playlist’s snapshot ID against which you want to make the changes. The API will validate that the specified items exist and in the specified positions and make the changes, even if more recent changes have been made to the playlist
- returns
a String representing a snapshot ID (which can be used to identify your playlist version in future requests) on success, otherwise it returns Error
- def removeSavedAlbums(ids: List[String]): Either[Error, Unit]
Removes one or more albums from the current user’s ‘Your Music’ library.
Removes one or more albums from the current user’s ‘Your Music’ library.
Modification of the current user’s “Your Music” collection requires authorization of the user-library-modify scope.
N.B. Changes to a user’s saved albums may not be visible in other Spotify applications immediately.
- ids
a list of the Spotify IDs for the albums. Maximum: 50 IDs.
- returns
Unit on success, otherwise it returns Error
- def removeSavedShows(ids: List[String], market: String = ""): Either[Error, Unit]
Removes one or more shows from the current user’s ‘Your Music’ library.
Removes one or more shows from the current user’s ‘Your Music’ library.
The user-library-modify scope must have been authorized by the user.
N.B. Changes to a user’s saved shows may not be visible in other Spotify applications immediately.
- ids
a list of the Spotify IDs for the shows to be deleted from the user’s library. Maximum: 50 IDs
- market
an ISO 3166-1 alpha-2 country code. If a country code is specified, only shows that are available in that market will be removed. If a valid user access token is specified in the request header, the country associated with the user account will take priority over this parameter. Note: If neither market or user country are provided, the content is considered unavailable for the client. Users can view the country that is associated with their account in the account settings.
- returns
Unit on success, otherwise it returns Error
- def removeSavedTracks(ids: List[String]): Either[Error, Unit]
Removes one or more tracks from the current user’s ‘Your Music’ library.
Removes one or more tracks from the current user’s ‘Your Music’ library.
Modification of the current user’s “Your Music” collection requires authorization of the user-library-modify scope.
N.B. Changes to a user’s saved tracks may not be visible in other Spotify applications immediately.
- ids
a list of the Spotify IDs for the tracks. Maximum: 50 IDs
- returns
Unit on success, otherwise it returns Error
- def reorderPlaylistItems(playlistID: String, rangeStart: Int, insertBefore: Int, rangeLength: Int = 1, snapshotID: String = ""): Either[Error, String]
Reorders an item or a group of items in a playlist.
Reorders an item or a group of items in a playlist.
When reordering items, the timestamp indicating when they were added and the user who added them will be kept untouched. In addition, the users following the playlists won’t be notified about changes in the playlists when the items are reordered.
Reordering items in the current user’s public playlists requires authorization of the playlist-modify-public scope; reordering items in the current user’s private playlist (including collaborative playlists) requires the playlist-modify-private scope.
- playlistID
the Spotify ID for the playlist
- rangeStart
the position of the first item to be reordered
- insertBefore
the position where the items should be inserted. To reorder the items to the end of the playlist, simply set insert_before to the position after the last item. Examples: To reorder the first item to the last position in a playlist with 10 items, set range_start to 0, and insert_before to 10. To reorder the last item in a playlist with 10 items to the start of the playlist, set range_start to 9, and insert_before to 0
- rangeLength
(optional) the amount of items to be reordered. Defaults to 1 if not set. The range of items to be reordered begins from the range_start position, and includes the range_length subsequent items. Example: To move the items at index 9-10 to the start of the playlist, range_start is set to 9, and range_length is set to 2
- snapshotID
(optional) the playlist’s snapshot ID against which you want to make the changes
- returns
a String representing a snapshot ID (which can be used to identify your playlist version in future requests) on success, otherwise it returns Error
- def replacePlaylistItems(playlistID: String, uris: List[URI]): Either[Error, Unit]
Replaces all the items in a playlist, overwriting its existing items.
Replaces all the items in a playlist, overwriting its existing items. This powerful request can be useful for replacing items, re-ordering existing items, or clearing the playlist.
Setting items in the current user’s public playlists requires authorization of the playlist-modify-public scope; setting items in the current user’s private playlist (including collaborative playlists) requires the playlist-modify-private scope.
- playlistID
the Spotify ID for the playlist
- uris
a list of Spotify URIs to set. Maximum length: 100
- returns
Unit on success, otherwise it returns Error
- def requestRefreshedToken(): Unit
Requests refreshed tokens, updating the field authObj.
Requests refreshed tokens, updating the field authObj. No additional action is required by the user.
Access tokens are deliberately set to expire after a short time, after which new tokens may be granted by supplying the refresh token originally obtained during the authorization code exchange.
- def saveAlbums(ids: List[String]): Either[Error, Unit]
Saves one or more albums to the current user’s ‘Your Music’ library.
Saves one or more albums to the current user’s ‘Your Music’ library.
Modification of the current user’s “Your Music” collection requires authorization of the user-library-modify scope.
- ids
a list of the Spotify IDs for the albums. Maximum: 50 IDs
- returns
Unit on success, otherwise it returns Error
- def saveShows(ids: List[String]): Either[Error, Unit]
Saves one or more shows to the current user’s ‘Your Music’ library.
Saves one or more shows to the current user’s ‘Your Music’ library.
The user-library-modify scope must have been authorized by the user.
- ids
a list of the Spotify IDs for the shows to be added to the user’s library. Maximum: 50 IDs
- returns
Unit on success, otherwise it returns Error
- def saveTracks(ids: List[String]): Either[Error, Unit]
Saves one or more tracks to the current user’s ‘Your Music’ library.
Saves one or more tracks to the current user’s ‘Your Music’ library.
Modification of the current user’s “Your Music” collection requires authorization of the user-library-modify scope.
- ids
a list of the Spotify IDs for the tracks. Maximum: 50 IDs
- returns
Unit on success, otherwise it returns Error
- def search(q: String, objectTypes: List[ObjectType], market: String = "", limit: Int = 20, offset: Int = 0, includeExternal: String = ""): Either[Error, List[Paging[Searchable]]]
Gets Spotify Catalog information about albums, artists, playlists, tracks, shows or episodes that match a keyword string.
Gets Spotify Catalog information about albums, artists, playlists, tracks, shows or episodes that match a keyword string.
- q
search query keywords and optional field filters and operators. For example: roadhouse+blues.
- objectTypes
a list of ObjectType to search across. Valid types are: AlbumObj, ArtistObj, TrackObj, ShowObj and EpisodeObj. Search results include hits from all the specified item types
- market
(optional) an ISO 3166-1 alpha-2 country code or the string from_token. If a country code is specified, only artists, albums, and tracks with content that is playable in that market is returned. Note:
- Playlist results are not affected by the market parameter.
- If market is set to from_token, and a valid access token is specified in the request header, only content playable in the country associated with the user account, is returned.
- Users can view the country that is associated with their account in the account settings. A user must grant access to the user-read-private scope prior to when the access token is issued
- limit
(optional) maximum number of results to return. Default: 20 Minimum: 1 Maximum: 50 Note: The limit is applied within each type, not on the total response
- offset
(optional) the index of the first result to return. Default: 0 (the first result). Maximum offset (including limit): 2,000. Use with limit to get the next page of search results
- includeExternal
(optional) possible values: audio If include_external=audio is specified the response will include any relevant audio content that is hosted externally. By default external content is filtered out from responses
- returns
a List of Paging objects wrapping Searchables on success, otherwise it returns Error. Album, Artist, Episode, Show and Track are searchable.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def unfollow(idType: String, ids: List[String]): Either[Error, Unit]
Removes the current user as a follower of one or more artists or other Spotify users.
Removes the current user as a follower of one or more artists or other Spotify users.
Modifying the list of artists or users the current user follows requires authorization of the user-follow-modify scope.
- idType
the ID type: either artist or user
- ids
a list of the artist or the user Spotify IDs. A maximum of 50 IDs can be sent in one request
- returns
Unit on success, otherwise it returns Error
- def unfollowPlaylist(playlistID: String): Either[Error, Unit]
Removes the current user as a follower of a playlist.
Removes the current user as a follower of a playlist.
Unfollowing a publicly followed playlist for a user requires authorization of the playlist-modify-public scope; unfollowing a privately followed playlist requires the playlist-modify-private scope.
- playlistID
the Spotify ID of the playlist that is to be no longer followed
- returns
Unit on success, otherwise it returns Error
- def uploadCustomPlaylistCoverImage(playlistID: String, image: String): Either[Error, Unit]
Replaces the image used to represent a specific playlist.
Replaces the image used to represent a specific playlist.
When the image has been provided, it is forwarded to Spotify's transcoder service in order to generate the three sizes provided in the playlist’s images object. This operation may take a short time, so performing a GET request to the playlist may not immediately return URLs to the updated images.
The used access token must be tied to the user who owns the playlist, and must have the scope ugc-image-upload granted. In addition, the token must also contain playlist-modify-public and/or playlist-modify-private, depending the public status of the playlist you want to update
- playlistID
the Spotify ID for the playlist
- image
a Base64 encoded JPEG image data. Maximum payload size is 256 KB
- returns
Unit on success, otherwise it returns Error
- def uploadCustomPlaylistCoverImage(playlistID: String, image: Array[Byte]): Either[Error, Unit]
Replaces the image used to represent a specific playlist.
Replaces the image used to represent a specific playlist.
When the image has been provided, it is forwarded to Spotify's transcoder service in order to generate the three sizes provided in the playlist’s images object. This operation may take a short time, so performing a GET request to the playlist may not immediately return URLs to the updated images.
The used access token must be tied to the user who owns the playlist, and must have the scope ugc-image-upload granted. In addition, the token must also contain playlist-modify-public and/or playlist-modify-private, depending the public status of the playlist you want to update
- playlistID
the Spotify ID for the playlist
- image
an array of bytes representing the image to upload. Maximum payload size is 256 KB
- returns
Unit on success, otherwise it returns Error
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated