Class SpotifyApi
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe default authentication host of Spotify API calls.static final intThe default authentication port of Spotify API calls.static final StringThe default authentication http scheme of Spotify API calls.static final StringThe default host of Spotify API calls.static final IHttpManagerA HttpManager configured with default settings.static final intThe default port of Spotify API calls.static final StringThe default http scheme of Spotify API calls.static final LoggerLogger instance for this class. -
Method Summary
Modifier and TypeMethodDescriptionaddCustomPlaylistCoverImage(String playlist_id) Replace the image used to represent a specific playlist.addItemsToPlaylist(String playlist_id, com.google.gson.JsonArray uris) Add items to a playlist.addItemsToPlaylist(String playlist_id, String[] uris) Add items to a playlist.addItemsToPlaylistDeprecated(String playlist_id, com.google.gson.JsonArray uris) Deprecated.addItemsToPlaylistDeprecated(String playlist_id, String[] uris) Deprecated.UseaddItemsToPlaylist(String, String[])instead.Add a track or an episode to the end of the user's current playback queue.authorizationCode(String code) Returns a builder that can be used to build requests for authorization code grants.authorizationCode(String client_id, String client_secret, String code, URI redirect_uri) Returns a builder that can be used to build requests for authorization code grants.authorizationCodePKCE(String code, String code_verifier) Returns a builder that can be used to build requests for authorization code grants using the Proof Key for Code Exchange (PKCE) flow.authorizationCodePKCE(String client_id, String code, String code_verifier, URI redirect_uri) Returns a builder that can be used to build requests for authorization code grants using the Proof Key for Code Exchange (PKCE) flow.Refresh the access token by using the authorization code flow with Proof Key for Code Exchange (PKCE).authorizationCodePKCERefresh(String client_id, String refresh_token) Refresh the access token by using the authorization code flow with Proof Key for Code Exchange (PKCE).authorizationCodePKCEUri(String code_challenge) Retrieve an URL where the user can give the application permissions using the Proof Key for Code Exchange (PKCE) flow.authorizationCodePKCEUri(String client_id, String code_challenge, URI redirect_uri) Retrieve an URL where the user can give the application permissions using the Proof Key for Code Exchange (PKCE) flow.Refresh the access token by using authorization code grant.authorizationCodeRefresh(String client_id, String client_secret, String refresh_token) Refresh the access token by using authorization code grant.Retrieve an URL where the user can give the application permissions.authorizationCodeUri(String client_id, URI redirect_uri) Retrieve an URL where the user can give the application permissions.static SpotifyApi.Builderbuilder()Create a builder for building a new Spotify API instance.changePlaylistDetails(String playlist_id) Update a playlists properties.checkCurrentUserFollowsArtistsOrUsers(ModelObjectType type, String[] ids) Deprecated.This endpoint has been deprecated by Spotify.checkIfUserFollowsPlaylist(String playlist_id, String[] ids) Deprecated.This endpoint has been deprecated by Spotify.checkUsersSavedAlbums(String... ids) Deprecated.UseCheckUsersSavedItemsRequestinstead.Deprecated.UseCheckUsersSavedItemsRequestinstead.checkUsersSavedEpisodes(String... ids) Deprecated.UseCheckUsersSavedItemsRequestinstead.checkUsersSavedItems(String uris) Check if one or more items are already saved in the current Spotify user's library.checkUsersSavedShows(String... ids) Deprecated.UseCheckUsersSavedItemsRequestinstead.checkUsersSavedTracks(String... ids) Deprecated.UseCheckUsersSavedItemsRequestinstead.Returns a builder that can be used to build requests for client credential grants.static StringString concatenation helper method.createPlaylist(String name) Create a playlist for the current Spotify user.createPlaylistForUser(String user_id, String name) Deprecated.This endpoint is deprecated per the Spotify API specification.followArtistsOrUsers(ModelObjectType type, com.google.gson.JsonArray ids) Deprecated.This endpoint has been deprecated by Spotify.followArtistsOrUsers(ModelObjectType type, String[] ids) Deprecated.This endpoint has been deprecated by Spotify.followPlaylist(String playlist_id, boolean public_) Deprecated.This endpoint has been deprecated by Spotify.static StringformatDefaultDate(Date date) Formats a date, using the default spotify format.Get the access token specified in the API object, which is used for API calls.Get Spotify catalog information for a single album.getAlbumTracks(String id) Get Spotify catalog information about an album's tracks.Get Spotify catalog information for a single artist identified by their unique Spotify ID.Get Spotify catalog information about an artist's albums.Deprecated.Spotify restricted this endpoint on November 27, 2024 as part of a platform security update.Deprecated.This endpoint has been deprecated by Spotify.getAudiobook(String id) Get an audiobook.Get Spotify catalog information about an audiobook's chapters.Get information about an user's available devices.Deprecated.This endpoint has been deprecated by Spotify.getCategoryPlaylists(String category_id) Deprecated.Spotify restricted this endpoint on November 27, 2024 as part of a platform security update.getChapter(String id) Get Spotify catalog information for a single audiobook chapter.Get the application client ID specified in this API object.Get the application client secret specified in this API object.Get the object currently being played on the user's Spotify account.Get a list of the playlists owned or followed by the current Spotify user.Get detailed profile information about the current user (including the current user’s username).getEpisode(String id) Get Spotify catalog information for a single episode identified by its unique Spotify ID.Deprecated.Spotify restricted this endpoint on November 27, 2024 as part of a platform security update.Get the current user’s followed artists.getHost()Get the API host used for API calls.Get theIHttpManagerused for API calls.Deprecated.This endpoint is deprecated per the Spotify API specification.Get information about the user's current playback state, including context, track progress, and active device.getPlaylist(String playlist_id) Get a playlist.getPlaylistCoverImage(String playlist_id) Get the image used to represent a specific playlist.getPlaylistItems(String playlist_id) Get a playlist's items.getPlaylistItemsDeprecated(String playlist_id) Deprecated.UsegetPlaylistItems(String)instead.getPort()Get the port used for API calls.Get the proxy password used for API calls.Get the proxy port used for API calls.Get the proxy URL used for API calls.Get the proxy username used for API calls.Get tracks from the current user's recently played tracks.Deprecated.Spotify restricted this endpoint on November 27, 2024 as part of a platform security update, alongsidegetRecommendations().Deprecated.Spotify restricted this endpoint on November 27, 2024 as part of a platform security update.Get the redirect URI of the application specified in this API object.Get the refresh token specified in the API object.Get the scheme used for API calls.getSeveralAlbums(String ids) Deprecated.This endpoint has been deprecated by Spotify.getSeveralArtists(String ids) Deprecated.This endpoint has been deprecated by Spotify.Deprecated.This endpoint has been deprecated by Spotify.Deprecated.This endpoint is deprecated per the Spotify API specification.getSeveralChapters(String ids) Deprecated.This endpoint has been deprecated by Spotify.getSeveralEpisodes(String ids) Deprecated.This endpoint has been deprecated by Spotify.getSeveralShows(String ids) Deprecated.This endpoint has been deprecated by Spotify.getSeveralTracks(String ids) Deprecated.This endpoint has been deprecated by Spotify.getSeveralTracksAudioFeatures(String... ids) Deprecated.Spotify restricted this endpoint on November 27, 2024 as part of a platform security update.Get Spotify catalog information about a show.Get Spotify catalog information about an show’s episodes.getSingleBrowseCategory(String category_id) Deprecated.This endpoint is deprecated per the Spotify API specification.Get Spotify catalog information for a single track identified by its unique Spotify ID.Deprecated.Spotify restricted this endpoint on November 27, 2024 as part of a platform security update.Deprecated.Spotify restricted this endpoint on November 27, 2024 as part of a platform security update.getUsersPlaylists(String user_id) Deprecated.This endpoint is deprecated per the Spotify API specification.getUsersProfile(String user_id) Deprecated.This endpoint is deprecated per the Spotify API specification.Receive all items from the user's current playback queue.Get a list of the albums saved in the current Spotify user’s "Your Music" library.Get a list of the audiobooks saved in the current Spotify user's library.Get a list of the episodes saved in the current Spotify user's library.Get a list of shows saved in the current Spotify user’s library.Get an user's "Your Music" tracks.Get the current user's top artists based on calculated affinity.Get the current user's top artists or tracks based on calculated affinity.Get the current user's top tracks based on calculated affinity.static SimpleDateFormatmakeSimpleDateFormat(String pattern, String id) Deprecated.SimpleDateFormatis mutable and not thread-safe, so instances returned by this method must not be shared across threads or cached in a static field.static DateparseDefaultDate(String date) Parses a date in the default spotify format.Pause playback on the user's account.Deprecated.This endpoint is deprecated per the Spotify API specification.Deprecated.This endpoint is deprecated per the Spotify API specification.Deprecated.This endpoint is deprecated per the Spotify API specification.removeItemsFromLibrary(String uris) Remove a list of Spotify URIs from the user's library.removePlaylistItems(String playlist_id, com.google.gson.JsonArray tracks) Delete items from a playlistremovePlaylistItemsDeprecated(String playlist_id, com.google.gson.JsonArray tracks) Deprecated.UseremovePlaylistItems(String, JsonArray)instead.Deprecated.This endpoint is deprecated per the Spotify API specification.Deprecated.This endpoint is deprecated per the Spotify API specification.Deprecated.This endpoint is deprecated per the Spotify API specification.Deprecated.This endpoint is deprecated per the Spotify API specification.Deprecated.This endpoint is deprecated per the Spotify API specification.saveItemsToLibrary(String uris) Add one or more items to the current user's library.Deprecated.This endpoint is deprecated per the Spotify API specification.Deprecated.This endpoint is deprecated per the Spotify API specification.Get Spotify catalog information about albums that match a keyword string.Get Spotify catalog information about albums that match a keyword string.Get Spotify catalog information about artists that match a keyword string.Get Spotify catalog information about audiobooks that match a keyword string.Get Spotify catalog information about episodes that match a keyword string.searchForItem(String q, String type) Get Spotify catalog information about artists, albums, episodes, shows, tracks or playlists that match a keyword string.Get Spotify catalog information about playlists that match a keyword string.Get Spotify catalog information about shows that match a keyword string.Get Spotify catalog information about tracks that match a keyword string.seekToPosition(int position_ms) Seeks to the given position in the user's currently playing track.voidsetAccessToken(String accessToken) Set the access token of the API object.setPlaybackVolume(int volume_percent) Set the volume for the user's current playback device.voidsetRefreshToken(String refreshToken) Set the refresh token of the API object.setRepeatMode(String state) Set the repeat mode for the user's playback.Skips to next track in the user's queue.Skips to previous track in the user's queue.Start a new context or resume current playback on the user's active device.togglePlaybackShuffle(boolean state) Toggle shuffle on or off for user's playback.transferPlayback(com.google.gson.JsonArray device_ids) Transfer playback to a new device and determine if it should start playing.unfollowArtistsOrUsers(ModelObjectType type, com.google.gson.JsonArray ids) Deprecated.This endpoint has been deprecated by Spotify.unfollowArtistsOrUsers(ModelObjectType type, String[] ids) Deprecated.This endpoint has been deprecated by Spotify.unfollowPlaylist(String playlist_id) Deprecated.This endpoint has been deprecated by Spotify.updatePlaylistsItemsReorder(String playlist_id, int range_start, int insert_before) Reorder an item or a group of items in a playlist.updatePlaylistsItemsReorderDeprecated(String playlist_id, int range_start, int insert_before) Deprecated.UseupdatePlaylistsItemsReorder(String, int, int)instead.updatePlaylistsItemsReplace(String playlist_id, com.google.gson.JsonArray uris) Replace items in a playlist.updatePlaylistsItemsReplace(String playlist_id, String[] uris) Replace items in a playlist.updatePlaylistsItemsReplaceDeprecated(String playlist_id, com.google.gson.JsonArray uris) Deprecated.UseupdatePlaylistsItemsReplace(String, JsonArray)instead.updatePlaylistsItemsReplaceDeprecated(String playlist_id, String[] uris) Deprecated.UseupdatePlaylistsItemsReplace(String, String[])instead.
-
Field Details
-
DEFAULT_AUTHENTICATION_HOST
The default authentication host of Spotify API calls.- See Also:
-
DEFAULT_AUTHENTICATION_PORT
public static final int DEFAULT_AUTHENTICATION_PORTThe default authentication port of Spotify API calls.- See Also:
-
DEFAULT_AUTHENTICATION_SCHEME
The default authentication http scheme of Spotify API calls.- See Also:
-
DEFAULT_HOST
-
DEFAULT_HTTP_MANAGER
A HttpManager configured with default settings. -
DEFAULT_PORT
public static final int DEFAULT_PORTThe default port of Spotify API calls.- See Also:
-
DEFAULT_SCHEME
-
LOGGER
Logger instance for this class.
-
-
Method Details
-
builder
Create a builder for building a new Spotify API instance.- Returns:
- A
SpotifyApi.Builder.
-
concat
-
parseDefaultDate
Parses a date in the default spotify format.- Parameters:
date- the input date to parse- Returns:
- the pared
Date - Throws:
ParseException- if the date is not in a valid format
-
formatDefaultDate
-
makeSimpleDateFormat
Deprecated.SimpleDateFormatis mutable and not thread-safe, so instances returned by this method must not be shared across threads or cached in a static field. Use aDateTimeFormatterinstead.Creates a SimpleDateFormat with the specified pattern and timezone.- Parameters:
pattern- the date patternid- the timezone ID- Returns:
- a configured SimpleDateFormat instance
-
getHttpManager
Get theIHttpManagerused for API calls.- Returns:
- An
IHttpManager.
-
getScheme
-
getHost
Get the API host used for API calls. Default:"api.spotify.com"- Returns:
- The host address.
-
getPort
-
getProxyUrl
-
getProxyPort
-
getProxyUsername
Get the proxy username used for API calls.- Returns:
- The proxy username.
-
getProxyPassword
Get the proxy password used for API calls.- Returns:
- The proxy password.
-
getClientId
Get the application client ID specified in this API object.- Returns:
- Application client ID.
-
getClientSecret
Get the application client secret specified in this API object.- Returns:
- Application client secret.
-
getRedirectURI
Get the redirect URI of the application specified in this API object.- Returns:
- Application redirect URI.
-
getAccessToken
Get the access token specified in the API object, which is used for API calls.- Returns:
- A Spotify Web API access token.
-
setAccessToken
Set the access token of the API object.- Parameters:
accessToken- A Spotify Web API access token.
-
getRefreshToken
Get the refresh token specified in the API object.- Returns:
- A Spotify Web API refresh token.
-
setRefreshToken
Set the refresh token of the API object.- Parameters:
refreshToken- A Spotify Web API refresh token.
-
authorizationCodeRefresh
public AuthorizationCodeRefreshRequest.Builder authorizationCodeRefresh(String client_id, String client_secret, String refresh_token) Refresh the access token by using authorization code grant.
Requires client ID, client secret, and refresh token to be set.- Parameters:
client_id- When you register your application, Spotify provides you a Client ID.client_secret- When you register your application, Spotify provides you a Client Secret.refresh_token- The refresh token returned from the authorization code exchange.- Returns:
- An
AuthorizationCodeRequest.Builder.
-
authorizationCodeRefresh
Refresh the access token by using authorization code grant.- Returns:
- An
AuthorizationCodeRequest.Builder.
-
authorizationCodePKCERefresh
public AuthorizationCodePKCERefreshRequest.Builder authorizationCodePKCERefresh(String client_id, String refresh_token) Refresh the access token by using the authorization code flow with Proof Key for Code Exchange (PKCE).
Requires client ID and refresh token to be set.- Parameters:
client_id- When you register your application, Spotify provides you a Client ID.refresh_token- The refresh token returned from the authorization code exchange or the last access token refresh.- Returns:
- An
AuthorizationCodePKCERefreshRequest.Builder.
-
authorizationCodePKCERefresh
Refresh the access token by using the authorization code flow with Proof Key for Code Exchange (PKCE).- Returns:
- An
AuthorizationCodePKCERefreshRequest.Builder.
-
authorizationCode
public AuthorizationCodeRequest.Builder authorizationCode(String client_id, String client_secret, String code, URI redirect_uri) Returns a builder that can be used to build requests for authorization code grants.
Requires client ID, client secret, authorization code and redirect URI to be set.- Parameters:
client_id- When you register your application, Spotify provides you a Client ID.client_secret- When you register your application, Spotify provides you a Client Secret.code- The authorization code returned from the initial request to the Account /authorize endpoint.redirect_uri- This parameter is used for validation only (there is no actual redirection). The value of this parameter must exactly match the value of redirect_uri supplied when requesting the authorization code.- Returns:
- An
AuthorizationCodeRequest.Builder.
-
authorizationCode
Returns a builder that can be used to build requests for authorization code grants.
Requires authorization code to be set.- Parameters:
code- The authorization code returned from the initial request to the Account /authorize endpoint.- Returns:
- An
AuthorizationCodeRequest.Builder.
-
authorizationCodePKCE
public AuthorizationCodePKCERequest.Builder authorizationCodePKCE(String client_id, String code, String code_verifier, URI redirect_uri) Returns a builder that can be used to build requests for authorization code grants using the Proof Key for Code Exchange (PKCE) flow.
Requires client ID, authorization code, code verifier and redirect URI to be set.- Parameters:
client_id- When you register your application, Spotify provides you a Client ID.code- The authorization code returned from the initial request to the Account /authorize endpoint.code_verifier- The value of this parameter must match the value of the code_verifier that your app generated beforehand.redirect_uri- This parameter is used for validation only (there is no actual redirection). The value of this parameter must exactly match the value of redirect_uri supplied when requesting the authorization code.- Returns:
- An
AuthorizationCodePKCERequest.Builder. - See Also:
-
authorizationCodePKCE
public AuthorizationCodePKCERequest.Builder authorizationCodePKCE(String code, String code_verifier) Returns a builder that can be used to build requests for authorization code grants using the Proof Key for Code Exchange (PKCE) flow.
Requires authorization code and code verifier to be set.- Parameters:
code- The authorization code returned from the initial request to the Account /authorize endpoint.code_verifier- The value of this parameter must match the value of the code_verifier that your app generated beforehand.- Returns:
- An
AuthorizationCodePKCERequest.Builder. - See Also:
-
authorizationCodeUri
Retrieve an URL where the user can give the application permissions.- Parameters:
client_id- When you register your application, Spotify provides you a Client ID.redirect_uri- This parameter is used for validation only (there is no actual redirection). The value of this parameter must exactly match the value of redirect_uri supplied when requesting the authorization code.- Returns:
- An
AuthorizationCodeUriRequest.Builder.
-
authorizationCodeUri
Retrieve an URL where the user can give the application permissions.- Returns:
- An
AuthorizationCodeUriRequest.Builder.
-
authorizationCodePKCEUri
public AuthorizationCodeUriRequest.Builder authorizationCodePKCEUri(String client_id, String code_challenge, URI redirect_uri) Retrieve an URL where the user can give the application permissions using the Proof Key for Code Exchange (PKCE) flow.- Parameters:
client_id- When you register your application, Spotify provides you a Client ID.code_challenge- The code challenge that your app calculated beforehand. The code challenge is the base64url encoded sha256-hash of the code verifier, which is a cryptographically random string between 43 and 128 characters in length. It can contain letters, digits, underscores, periods, hyphens, or tildes and is generated by your app before each authentication request.redirect_uri- This parameter is used for validation only (there is no actual redirection). The value of this parameter must exactly match the value of redirect_uri supplied when requesting the authorization code.- Returns:
- An
AuthorizationCodeUriRequest.Builder. - See Also:
-
authorizationCodePKCEUri
Retrieve an URL where the user can give the application permissions using the Proof Key for Code Exchange (PKCE) flow.- Parameters:
code_challenge- The code challenge that your app calculated beforehand. The code challenge is the base64url encoded sha256-hash of the code verifier, which is a cryptographically random string between 43 and 128 characters in length. It can contain letters, digits, underscores, periods, hyphens, or tildes and is generated- Returns:
- An
AuthorizationCodeUriRequest.Builder. - See Also:
-
clientCredentials
Returns a builder that can be used to build requests for client credential grants.
Requires client ID and client secret to be set.- Returns:
- A
ClientCredentialsRequest.Builder.
-
getAlbum
Get Spotify catalog information for a single album.- Parameters:
id- The Spotify ID for the album.- Returns:
- A
GetAlbumRequest.Builder. - See Also:
-
getAlbumTracks
Get Spotify catalog information about an album's tracks. Optional parameters can be used to limit the number of tracks returned.- Parameters:
id- The Spotify ID of the album.- Returns:
- A
GetAlbumTracksRequest.Builder. - See Also:
-
getSeveralAlbums
Deprecated.This endpoint has been deprecated by Spotify.Get Spotify catalog information for several albums identified by their Spotify IDs.- Parameters:
ids- A comma-separated list of the Spotify IDs for the albums. Maximum: 20 IDs.- Returns:
- A
GetSeveralAlbumsRequest.Builder. - See Also:
-
getAudiobook
Get an audiobook.- Parameters:
id- The Spotify ID for the audiobook.- Returns:
- A
GetAudiobookRequest.Builder. - See Also:
-
getSeveralAudiobooks
Deprecated.This endpoint has been deprecated by Spotify.Get Spotify catalog information for several audiobooks identified by their Spotify IDs.- Parameters:
ids- A comma-separated list of the Spotify IDs for the audiobooks. Maximum: 50 IDs.- Returns:
- A
GetSeveralAudiobooksRequest.Builder. - See Also:
-
getAudiobookChapters
Get Spotify catalog information about an audiobook's chapters.- Parameters:
id- The Spotify ID for the audiobook.- Returns:
- A
GetAudiobookChaptersRequest.Builder. - See Also:
-
getChapter
Get Spotify catalog information for a single audiobook chapter. Chapters are only available within the US, UK, Canada, Ireland, New Zealand and Australia markets.- Parameters:
id- The Spotify ID for the chapter.- Returns:
- A
GetChapterRequest.Builder. - See Also:
-
getSeveralChapters
Deprecated.This endpoint has been deprecated by Spotify.Get Spotify catalog information for several chapters identified by their Spotify IDs.- Parameters:
ids- A comma-separated list of the Spotify IDs for the chapters. Maximum: 50 IDs.- Returns:
- A
GetSeveralChaptersRequest.Builder. - See Also:
-
getArtist
Get Spotify catalog information for a single artist identified by their unique Spotify ID.- Parameters:
id- The Spotify ID of the artist.- Returns:
- A
GetArtistRequest.Builder. - See Also:
-
getArtistsAlbums
Get Spotify catalog information about an artist's albums.- Parameters:
id- The Spotify ID of the artist.- Returns:
- A
GetArtistsAlbumsRequest.Builder. - See Also:
-
getArtistsRelatedArtists
Deprecated.Spotify restricted this endpoint on November 27, 2024 as part of a platform security update. It is unavailable to apps still in Development Mode without a granted quota extension, and to apps registered on or after that date. Apps that already had Extended Quota Mode access to this endpoint before that date are unaffected and can ignore this notice. Spotify has not announced a replacement.Get Spotify catalog information about artists similar to a given artist. Similarity is based on analysis of the Spotify community's listening history.- Parameters:
id- The Spotify ID of the artist.- Returns:
- A
GetArtistsRelatedArtistsRequest.Builder. - See Also:
-
getArtistsTopTracks
Deprecated.This endpoint has been deprecated by Spotify.Get Spotify catalog information about an artist's top tracks by country.- Parameters:
id- The Spotify ID for the artist.- Returns:
- A
GetArtistsTopTracksRequest.Builder. - See Also:
-
getSeveralArtists
Deprecated.This endpoint has been deprecated by Spotify.Get Spotify catalog information for several artists based on their Spotify IDs.- Parameters:
ids- A comma-separated list of the Spotify IDs for the artists. Maximum: 50 IDs.- Returns:
- A
GetSeveralArtistsRequest.Builder. - See Also:
-
getSeveralBrowseCategories
Deprecated.This endpoint is deprecated per the Spotify API specification.Get a list of categories used to tag items in Spotify.- Returns:
- A
GetSeveralBrowseCategoriesRequest.Builder.
-
getSingleBrowseCategory
@Deprecated public GetSingleBrowseCategoryRequest.Builder getSingleBrowseCategory(String category_id) Deprecated.This endpoint is deprecated per the Spotify API specification.Get a single category used to tag items in Spotify (on, for example, the Spotify player's "Browse" tab).- Parameters:
category_id- The Spotify category ID for the category.- Returns:
- A
GetSingleBrowseCategoryRequest.Builder. - See Also:
-
getNewReleases
Deprecated.This endpoint is deprecated per the Spotify API specification.Get a list of new album releases featured in Spotify.- Returns:
- A
GetNewReleasesRequest.Builder.
-
getCategoryPlaylists
Deprecated.Spotify restricted this endpoint on November 27, 2024 as part of a platform security update. It is unavailable to apps still in Development Mode without a granted quota extension, and to apps registered on or after that date. Apps that already had Extended Quota Mode access to this endpoint before that date are unaffected and can ignore this notice. Spotify has not announced a replacement; searching for playlists by category name via the Search API is the closest approximation.Get the playlists from a specific category.- Parameters:
category_id- The Spotify category ID for the category.- Returns:
- A
GetCategoryPlaylistsRequest.Builder. - See Also:
-
getFeaturedPlaylists
Deprecated.Spotify restricted this endpoint on November 27, 2024 as part of a platform security update. It is unavailable to apps still in Development Mode without a granted quota extension, and to apps registered on or after that date. Apps that already had Extended Quota Mode access to this endpoint before that date are unaffected and can ignore this notice. Spotify has not announced a replacement.Get "Featured Playlists" of different countries which may match a specific language.- Returns:
- A
GetFeaturedPlaylistsRequest.Builder. - See Also:
-
getRecommendations
Deprecated.Spotify restricted this endpoint on November 27, 2024 as part of a platform security update. It is unavailable to apps still in Development Mode without a granted quota extension, and to apps registered on or after that date. Apps that already had Extended Quota Mode access to this endpoint before that date are unaffected and can ignore this notice. Spotify has not announced a replacement.Create a playlist-style listening experience based on seed artists, tracks and genres.- Returns:
- A
GetRecommendationsRequest.Builder. - See Also:
-
getRecommendationGenres
Deprecated.Spotify restricted this endpoint on November 27, 2024 as part of a platform security update, alongsidegetRecommendations(). It is unavailable to apps still in Development Mode without a granted quota extension, and to apps registered on or after that date. Apps that already had Extended Quota Mode access to this endpoint before that date are unaffected and can ignore this notice. Spotify has not announced a replacement.Retrieve a list of available genres seed parameter values for recommendations.- Returns:
- A
GetRecommendationGenresRequest.Builder. - See Also:
-
getEpisode
Get Spotify catalog information for a single episode identified by its unique Spotify ID.- Parameters:
id- The Spotify ID of the episode.- Returns:
- A
GetEpisodeRequest.Builder. - See Also:
-
getSeveralEpisodes
Deprecated.This endpoint has been deprecated by Spotify.Get Spotify catalog information for several episodes based on their Spotify IDs.- Parameters:
ids- A comma-separated list of the Spotify IDs for the episodes. Maximum: 50 IDs.- Returns:
- A
GetSeveralEpisodesRequest.Builder. - See Also:
-
checkCurrentUserFollowsArtistsOrUsers
@Deprecated public CheckCurrentUserFollowsArtistsOrUsersRequest.Builder checkCurrentUserFollowsArtistsOrUsers(ModelObjectType type, String[] ids) Deprecated.This endpoint has been deprecated by Spotify.Check to see if the current user is following one or more artists or other Spotify users.- Parameters:
type- The ID type: either artist or user.ids- A list of the artist or the user Spotify IDs to check. Maximum: 50 IDs.- Returns:
- A
CheckCurrentUserFollowsArtistsOrUsersRequest.Builder. - See Also:
-
checkIfUserFollowsPlaylist
@Deprecated public CheckIfUserFollowsPlaylistRequest.Builder checkIfUserFollowsPlaylist(String playlist_id, String[] ids) Deprecated.This endpoint has been deprecated by Spotify.Check to see if one or more Spotify users are following a specified playlist.- Parameters:
playlist_id- 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
CheckIfUserFollowsPlaylistRequest.Builder. - See Also:
-
followArtistsOrUsers
@Deprecated public FollowArtistsOrUsersRequest.Builder followArtistsOrUsers(ModelObjectType type, String[] ids) Deprecated.This endpoint has been deprecated by Spotify.Add the current user as a follower of one or more artists or other Spotify users.- Parameters:
type- The ID type: either artist or user.ids- A list of the artist or the user Spotify IDs. Maximum: 50 IDs.- Returns:
- A
FollowArtistsOrUsersRequest.Builder. - See Also:
-
followArtistsOrUsers
@Deprecated public FollowArtistsOrUsersRequest.Builder followArtistsOrUsers(ModelObjectType type, com.google.gson.JsonArray ids) Deprecated.This endpoint has been deprecated by Spotify.Add the current user as a follower of one or more artists or other Spotify users.- Parameters:
type- The ID type: either artist or user.ids- A list of the artist or the user Spotify IDs. Maximum: 50 IDs.- Returns:
- A
FollowArtistsOrUsersRequest.Builder. - See Also:
-
followPlaylist
@Deprecated public FollowPlaylistRequest.Builder followPlaylist(String playlist_id, boolean public_) Deprecated.This endpoint has been deprecated by Spotify.Add the current user as a follower of a playlist.- Parameters:
playlist_id- 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_- Default: 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:
- A
FollowPlaylistRequest.Builder. - See Also:
-
getFollowedArtists
Get the current user’s followed artists.- Parameters:
type- The ID type: currently only artist is supported.- Returns:
- A
GetFollowedArtistsRequest.Builder. - See Also:
-
unfollowArtistsOrUsers
@Deprecated public UnfollowArtistsOrUsersRequest.Builder unfollowArtistsOrUsers(ModelObjectType type, String[] ids) Deprecated.This endpoint has been deprecated by Spotify.Remove the current user as a follower of one or more artists or other Spotify users.- Parameters:
type- The ID type: either artist or user.ids- A list of the artist or the user Spotify IDs. Maximum: 50 IDs.- Returns:
- A
UnfollowArtistsOrUsersRequest.Builder. - See Also:
-
unfollowArtistsOrUsers
@Deprecated public UnfollowArtistsOrUsersRequest.Builder unfollowArtistsOrUsers(ModelObjectType type, com.google.gson.JsonArray ids) Deprecated.This endpoint has been deprecated by Spotify.Remove the current user as a follower of one or more artists or other Spotify users.- Parameters:
type- The ID type: either artist or user.ids- A JSON array of the artist or the user Spotify IDs. Maximum: 50 IDs.- Returns:
- A
UnfollowArtistsOrUsersRequest.Builder. - See Also:
-
unfollowPlaylist
Deprecated.This endpoint has been deprecated by Spotify.Remove the current user as a follower of a playlist.- Parameters:
playlist_id- The playlist's ID.- Returns:
- An
UnfollowPlaylistRequest.Builder. - See Also:
-
checkUsersSavedAlbums
Deprecated.UseCheckUsersSavedItemsRequestinstead.Check if one or more albums are already saved in the current Spotify user's 'Your Music' library.- Parameters:
ids- The album IDs to check for in the user's Your Music library. Maximum: 50 IDs.- Returns:
- A
CheckUsersSavedAlbumsRequest.Builder. - See Also:
-
checkUsersSavedShows
Deprecated.UseCheckUsersSavedItemsRequestinstead.Check if one or more shows are already saved in the current Spotify user's library.- Parameters:
ids- The show IDs to check for in the user's Your Music library. Maximum: 50 IDs.- Returns:
- A
CheckUsersSavedShowsRequest.Builder. - See Also:
-
checkUsersSavedEpisodes
Deprecated.UseCheckUsersSavedItemsRequestinstead.Check if one or more episodes are already saved in the current Spotify user's 'Your Episodes' library.- Parameters:
ids- The episode IDs to check for in the user's 'Your Episodes' library. Maximum: 50 IDs.- Returns:
- A
CheckUsersSavedEpisodesRequest.Builder. - See Also:
-
checkUsersSavedTracks
Deprecated.UseCheckUsersSavedItemsRequestinstead.Check if one or more tracks are already saved in the current Spotify user's 'Your Music' library.- Parameters:
ids- The track IDs to check for in the user's Your Music library. Maximum: 50 IDs.- Returns:
- A
CheckUsersSavedTracksRequest.Builder. - See Also:
-
checkUsersSavedAudiobooks
Deprecated.UseCheckUsersSavedItemsRequestinstead.Check if one or more audiobooks are already saved in the current Spotify user's library.- Parameters:
ids- A comma-separated list of the Spotify IDs for the audiobooks. Maximum: 50 IDs.- Returns:
- A
CheckUsersSavedAudiobooksRequest.Builder. - See Also:
-
getUsersSavedAlbums
Get a list of the albums saved in the current Spotify user’s "Your Music" library.- Returns:
- A
GetUsersSavedAlbumsRequest.Builder.
-
getUsersSavedShows
Get a list of shows saved in the current Spotify user’s library.- Returns:
- A
GetUsersSavedShowsRequest.Builder.
-
getUsersSavedEpisodes
Get a list of the episodes saved in the current Spotify user's library. This endpoint is in beta and could change without warning.- Returns:
- A
GetUsersSavedEpisodesRequest.Builder.
-
getUsersSavedAudiobooks
Get a list of the audiobooks saved in the current Spotify user's library.- Returns:
- A
GetUsersSavedAudiobooksRequest.Builder.
-
getUsersSavedTracks
Get an user's "Your Music" tracks.- Returns:
- A
GetUsersSavedTracksRequest.Builder.
-
saveItemsToLibrary
Add one or more items to the current user's library. Accepts Spotify URIs for tracks, albums, episodes, shows, audiobooks, users, and playlists.- Parameters:
uris- A comma-separated list of Spotify URIs to save. Maximum: 40 URIs.- Returns:
- A
SaveItemsToLibraryRequest.Builder.
-
saveAudiobooksForCurrentUser
@Deprecated public SaveAudiobooksForCurrentUserRequest.Builder saveAudiobooksForCurrentUser(String ids) Deprecated.This endpoint is deprecated per the Spotify API specification.Save one or more audiobooks to the current Spotify user's library.- Parameters:
ids- A comma-separated list of the Spotify IDs for the audiobooks. Maximum: 50 IDs.- Returns:
- A
SaveAudiobooksForCurrentUserRequest.Builder. - See Also:
-
removeAudiobooksForCurrentUser
@Deprecated public RemoveAudiobooksForCurrentUserRequest.Builder removeAudiobooksForCurrentUser(String ids) Deprecated.This endpoint is deprecated per the Spotify API specification.Remove one or more audiobooks from the current Spotify user's library.- Parameters:
ids- A comma-separated list of the Spotify IDs for the audiobooks. Maximum: 50 IDs.- Returns:
- A
RemoveAudiobooksForCurrentUserRequest.Builder. - See Also:
-
checkUsersSavedItems
Check if one or more items are already saved in the current Spotify user's library.- Parameters:
uris- A comma-separated list of the Spotify URIs for the items. Maximum: 40 URIs.- Returns:
- A
CheckUsersSavedItemsRequest.Builder. - See Also:
-
saveAlbumsForCurrentUser
Deprecated.This endpoint is deprecated per the Spotify API specification.Save one or more albums to the current user's library.- Parameters:
ids- A comma-separated list of the Spotify IDs for the albums. Maximum: 50 IDs.- Returns:
- A
SaveAlbumsForCurrentUserRequest.Builder. - See Also:
-
removeAlbumsForCurrentUser
Deprecated.This endpoint is deprecated per the Spotify API specification.Remove one or more albums from the current user's library.- Parameters:
ids- A comma-separated list of the Spotify IDs for the albums. Maximum: 50 IDs.- Returns:
- A
RemoveAlbumsForCurrentUserRequest.Builder. - See Also:
-
saveEpisodesForCurrentUser
Deprecated.This endpoint is deprecated per the Spotify API specification.Save one or more episodes to the current user's library.- Parameters:
ids- A comma-separated list of the Spotify IDs for the episodes. Maximum: 50 IDs.- Returns:
- A
SaveEpisodesForCurrentUserRequest.Builder. - See Also:
-
removeEpisodesForCurrentUser
@Deprecated public RemoveEpisodesForCurrentUserRequest.Builder removeEpisodesForCurrentUser(String ids) Deprecated.This endpoint is deprecated per the Spotify API specification.Remove one or more episodes from the current user's library.- Parameters:
ids- A comma-separated list of the Spotify IDs for the episodes. Maximum: 50 IDs.- Returns:
- A
RemoveEpisodesForCurrentUserRequest.Builder. - See Also:
-
saveShowsForCurrentUser
Deprecated.This endpoint is deprecated per the Spotify API specification.Save one or more shows to the current user's library.- Parameters:
ids- A comma-separated list of the Spotify IDs for the shows. Maximum: 50 IDs.- Returns:
- A
SaveShowsForCurrentUserRequest.Builder. - See Also:
-
removeShowsForCurrentUser
Deprecated.This endpoint is deprecated per the Spotify API specification.Remove one or more shows from the current user's library.- Parameters:
ids- A comma-separated list of the Spotify IDs for the shows. Maximum: 50 IDs.- Returns:
- A
RemoveShowsForCurrentUserRequest.Builder. - See Also:
-
saveTracksForCurrentUser
Deprecated.This endpoint is deprecated per the Spotify API specification.Save one or more tracks to the current user's library.- Parameters:
ids- A comma-separated list of the Spotify IDs for the tracks. Maximum: 50 IDs.- Returns:
- A
SaveTracksForCurrentUserRequest.Builder. - See Also:
-
removeUsersSavedTracks
Deprecated.This endpoint is deprecated per the Spotify API specification.Remove one or more tracks from the current user's library.- Parameters:
ids- A comma-separated list of the Spotify IDs for the tracks. Maximum: 50 IDs.- Returns:
- A
RemoveUsersSavedTracksRequest.Builder. - See Also:
-
removeItemsFromLibrary
Remove a list of Spotify URIs from the user's library.- Parameters:
uris- A comma-separated list of Spotify URIs to remove. Maximum: 40 URIs.- Returns:
- A
RemoveItemsFromLibraryRequest.Builder.
-
getUsersTopArtistsAndTracks
public <T extends IArtistTrackModelObject> GetUsersTopArtistsAndTracksRequest.Builder<T> getUsersTopArtistsAndTracks(ModelObjectType type) Get the current user's top artists or tracks based on calculated affinity.
Affinity is a measure of the expected preference an user has for a particular track or artist. It is based on user behavior, including play history, but does not include actions made while in incognito mode. Light or infrequent users of Spotify may not have sufficient play history to generate a full affinity data set.
- Type Parameters:
T- EitherArtistorTrack- Parameters:
type- The type of entity to return. Valid values: artists or tracks.- Returns:
- A
GetUsersTopArtistsAndTracksRequest.Builder.
-
getUsersTopArtists
Get the current user's top artists based on calculated affinity.- Returns:
- A
GetUsersTopArtistsRequest.Builder. - See Also:
-
getUsersTopTracks
Get the current user's top tracks based on calculated affinity.- Returns:
- A
GetUsersTopTracksRequest.Builder. - See Also:
-
getPlaybackState
Get information about the user's current playback state, including context, track progress, and active device.- Returns:
- A
GetPlaybackStateRequest.Builder.
-
getRecentlyPlayedTracks
Get tracks from the current user's recently played tracks.
Returns the most recent 50 tracks played by an user. Note that a track currently playing will not be visible in play history until it has completed. A track must be played for more than 30 seconds to be included in play history.
Any tracks listened to while the user had "Private Session" enabled in their client will not be returned in the list of recently played tracks.
- Returns:
- A
GetRecentlyPlayedTracksRequest.Builder.
-
getAvailableDevices
Get information about an user's available devices.- Returns:
- A
GetAvailableDevicesRequest.Builder.
-
getCurrentlyPlayingTrack
Get the object currently being played on the user's Spotify account.- Returns:
- A
GetCurrentlyPlayingTrackRequest.Builder.
-
pausePlayback
Pause playback on the user's account.- Returns:
- A
PausePlaybackRequest.Builder.
-
seekToPosition
Seeks to the given position in the user's currently playing track.- Parameters:
position_ms- The position in milliseconds to seek to. Must be a positive number. Passing in a position that is greater than the length of the track will cause the player to start playing the next song.- Returns:
- A
SeekToPositionRequest.Builder.
-
setRepeatMode
Set the repeat mode for the user's playback. Options are repeat-track, repeat-context, and off.- Parameters:
state- track, context or off. track will repeat the current track. context will repeat the current context. off will turn repeat off.- Returns:
- A
SetRepeatModeRequest.Builder.
-
setPlaybackVolume
Set the volume for the user's current playback device.- Parameters:
volume_percent- Integer. The volume to set. Must be a value from 0 to 100 inclusive.- Returns:
- A
SetPlaybackVolumeRequest.Builder.
-
skipToNext
Skips to next track in the user's queue.- Returns:
- A
SkipToNextRequest.Builder.
-
skipToPrevious
Skips to previous track in the user's queue.Note: This will ALWAYS skip to the previous track, regardless of the current track’s progress. Returning to the start of the current track should be performed using the
seekToPosition(int)method.- Returns:
- A
SkipToPreviousRequest.Builder.
-
startResumePlayback
Start a new context or resume current playback on the user's active device.- Returns:
- A
StartResumePlaybackRequest.Builder.
-
togglePlaybackShuffle
Toggle shuffle on or off for user's playback.- Parameters:
state- true: Shuffle user's playback. false: Do not shuffle user's playback.- Returns:
- A
TogglePlaybackShuffleRequest.Builder.
-
transferPlayback
Transfer playback to a new device and determine if it should start playing.- Parameters:
device_ids- A JSON array containing the ID of the device on which playback should be started/transferred.
Note: Although an array is accepted, only a single device_id is currently supported.- Returns:
- A
TransferPlaybackRequest.Builder.
-
addItemToPlaybackQueue
Add a track or an episode to the end of the user's current playback queue.- Parameters:
uri- The uri of the item to add to the queue. Must be a track or an episode uri.- Returns:
- A
AddItemToPlaybackQueueRequest.Builder. - See Also:
-
getUsersQueue
Receive all items from the user's current playback queue.- Returns:
- An
GetUsersQueueRequest.Builder.
-
addItemsToPlaylist
Add items to a playlist.Note: If you want to add a large number of items (>50), use
addItemsToPlaylist(String, JsonArray)to not exceed the maximum URI length.- Parameters:
playlist_id- The playlists ID.uris- URIs of the tracks or episodes to add. Maximum: 100 item URIs.- Returns:
- An
AddItemsToPlaylistRequest.Builder. - See Also:
-
addItemsToPlaylist
public AddItemsToPlaylistRequest.Builder addItemsToPlaylist(String playlist_id, com.google.gson.JsonArray uris) Add items to a playlist.- Parameters:
playlist_id- The playlists ID.uris- URIs of the tracks or episodes to add. Maximum: 100 item URIs.- Returns:
- An
AddItemsToPlaylistRequest.Builder. - See Also:
-
addItemsToPlaylistDeprecated
@Deprecated public AddItemsToPlaylistDeprecatedRequest.Builder addItemsToPlaylistDeprecated(String playlist_id, String[] uris) Deprecated.UseaddItemsToPlaylist(String, String[])instead.Add items to a playlist (deprecated endpoint).Note: If you want to add a large number of items (>50), use
addItemsToPlaylistDeprecated(String, JsonArray)to not exceed the maximum URI length.- Parameters:
playlist_id- The playlists ID.uris- URIs of the tracks or episodes to add. Maximum: 100 item URIs.- Returns:
- An
AddItemsToPlaylistDeprecatedRequest.Builder. - See Also:
-
addItemsToPlaylistDeprecated
@Deprecated public AddItemsToPlaylistDeprecatedRequest.Builder addItemsToPlaylistDeprecated(String playlist_id, com.google.gson.JsonArray uris) Deprecated.UseaddItemsToPlaylist(String, JsonArray)instead.Add items to a playlist (deprecated endpoint).- Parameters:
playlist_id- The playlists ID.uris- URIs of the tracks or episodes to add. Maximum: 100 item URIs.- Returns:
- An
AddItemsToPlaylistDeprecatedRequest.Builder. - See Also:
-
changePlaylistDetails
Update a playlists properties.- Parameters:
playlist_id- The playlists ID.- Returns:
- A
ChangePlaylistDetailsRequest.Builder. - See Also:
-
createPlaylist
Create a playlist for the current Spotify user.- Parameters:
name- The name for the new playlist.- Returns:
- A
CreatePlaylistRequest.Builder.
-
getUsersPlaylists
Deprecated.This endpoint is deprecated per the Spotify API specification.Get a list of the playlists owned or followed by a Spotify user.- Parameters:
user_id- The user's Spotify user ID.- Returns:
- A
GetUsersPlaylistsRequest.Builder. - See Also:
-
createPlaylistForUser
@Deprecated public CreatePlaylistForUserRequest.Builder createPlaylistForUser(String user_id, String name) Deprecated.This endpoint is deprecated per the Spotify API specification.Create a playlist for a Spotify user.- Parameters:
user_id- The user's Spotify user ID.name- The name for the new playlist.- Returns:
- A
CreatePlaylistForUserRequest.Builder. - See Also:
-
getCurrentUsersPlaylists
Get a list of the playlists owned or followed by the current Spotify user.- Returns:
- A
GetCurrentUsersPlaylistsRequest.Builder.
-
getPlaylist
Get a playlist.- Parameters:
playlist_id- The playlists ID.- Returns:
- A
GetPlaylistRequest.Builder. - See Also:
-
getPlaylistCoverImage
Get the image used to represent a specific playlist.- Parameters:
playlist_id- The Spotify ID for the playlist.- Returns:
- A
GetPlaylistCoverImageRequest.Builder. - See Also:
-
getPlaylistItems
Get a playlist's items.- Parameters:
playlist_id- The playlists ID.- Returns:
- A
GetPlaylistItemsRequest.Builder. - See Also:
-
getPlaylistItemsDeprecated
@Deprecated public GetPlaylistItemsDeprecatedRequest.Builder getPlaylistItemsDeprecated(String playlist_id) Deprecated.UsegetPlaylistItems(String)instead.Get full details of the tracks or episodes of a playlist owned by a Spotify user (deprecated endpoint).- Parameters:
playlist_id- The playlists ID.- Returns:
- A
GetPlaylistItemsDeprecatedRequest.Builder. - See Also:
-
removePlaylistItems
public RemovePlaylistItemsRequest.Builder removePlaylistItems(String playlist_id, com.google.gson.JsonArray tracks) Delete items from a playlist- Parameters:
playlist_id- The playlists ID.tracks- URIs of the items to remove. Maximum: 100 track or episode URIs.- Returns:
- A
RemovePlaylistItemsRequest.Builder. - See Also:
-
removePlaylistItemsDeprecated
@Deprecated public RemovePlaylistItemsDeprecatedRequest.Builder removePlaylistItemsDeprecated(String playlist_id, com.google.gson.JsonArray tracks) Deprecated.UseremovePlaylistItems(String, JsonArray)instead.Delete items from a playlist (deprecated endpoint).- Parameters:
playlist_id- The playlists ID.tracks- URIs of the items to remove. Maximum: 100 track or episode URIs.- Returns:
- A
RemovePlaylistItemsDeprecatedRequest.Builder. - See Also:
-
updatePlaylistsItemsReorder
public UpdatePlaylistsItemsReorderRequest.Builder updatePlaylistsItemsReorder(String playlist_id, int range_start, int insert_before) Reorder 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.
- Parameters:
playlist_id- The Spotify ID for the playlist.range_start- The position of the first item to be reordered.insert_before- 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.- Returns:
- A
UpdatePlaylistsItemsReorderRequest.Builder. - See Also:
-
updatePlaylistsItemsReorderDeprecated
@Deprecated public UpdatePlaylistsItemsReorderDeprecatedRequest.Builder updatePlaylistsItemsReorderDeprecated(String playlist_id, int range_start, int insert_before) Deprecated.UseupdatePlaylistsItemsReorder(String, int, int)instead.Reorder an item or a group of items in a playlist (deprecated endpoint).- Parameters:
playlist_id- The Spotify ID for the playlist.range_start- The position of the first item to be reordered.insert_before- 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.- Returns:
- A
UpdatePlaylistsItemsReorderDeprecatedRequest.Builder. - See Also:
-
updatePlaylistsItemsReplace
public UpdatePlaylistsItemsReplaceRequest.Builder updatePlaylistsItemsReplace(String playlist_id, String[] uris) Replace items in a playlist.- Parameters:
playlist_id- The playlists ID.uris- URIs of the items to set. Maximum: 100 track or episode URIs.- Returns:
- A
UpdatePlaylistsItemsReplaceRequest.Builder. - See Also:
-
updatePlaylistsItemsReplace
public UpdatePlaylistsItemsReplaceRequest.Builder updatePlaylistsItemsReplace(String playlist_id, com.google.gson.JsonArray uris) Replace items in a playlist.- Parameters:
playlist_id- The playlists ID.uris- URIs of the items to add. Maximum: 100 track or episode URIs.- Returns:
- A
UpdatePlaylistsItemsReplaceRequest.Builder. - See Also:
-
updatePlaylistsItemsReplaceDeprecated
@Deprecated public UpdatePlaylistsItemsReplaceDeprecatedRequest.Builder updatePlaylistsItemsReplaceDeprecated(String playlist_id, String[] uris) Deprecated.UseupdatePlaylistsItemsReplace(String, String[])instead.Replace items in a playlist (deprecated endpoint).- Parameters:
playlist_id- The playlists ID.uris- URIs of the items to set. Maximum: 100 track or episode URIs.- Returns:
- A
UpdatePlaylistsItemsReplaceDeprecatedRequest.Builder. - See Also:
-
updatePlaylistsItemsReplaceDeprecated
@Deprecated public UpdatePlaylistsItemsReplaceDeprecatedRequest.Builder updatePlaylistsItemsReplaceDeprecated(String playlist_id, com.google.gson.JsonArray uris) Deprecated.UseupdatePlaylistsItemsReplace(String, JsonArray)instead.Replace items in a playlist (deprecated endpoint).- Parameters:
playlist_id- The playlists ID.uris- URIs of the items to add. Maximum: 100 track or episode URIs.- Returns:
- A
UpdatePlaylistsItemsReplaceDeprecatedRequest.Builder. - See Also:
-
addCustomPlaylistCoverImage
Replace the image used to represent a specific playlist.- Parameters:
playlist_id- The Spotify ID for the playlist.- Returns:
- An
AddCustomPlaylistCoverImageRequest.Builder. - See Also:
-
searchForItem
Get Spotify catalog information about artists, albums, episodes, shows, tracks or playlists that match a keyword string.- Parameters:
q- The search query's keywords (and optional field filters and operators).type- A comma-separated list of item types to search across. Valid types are: album, artist, episode, show, playlist and track.- Returns:
- A
SearchForItemRequest.Builder.
-
searchAlbums
Get Spotify catalog information about albums that match a keyword string.- Parameters:
q- The search query's keywords (and optional field filters and operators).- Returns:
- A
SearchAlbumsRequest.Builder.
-
searchAlbumsSpecial
Get Spotify catalog information about albums that match a keyword string.This method exists because the searches API returns the undocumented property
totalTracks, which is included by this method's return type.- Parameters:
q- The search query's keywords (and optional field filters and operators).- Returns:
- A
SearchAlbumsSpecialRequest.Builder.
-
searchArtists
Get Spotify catalog information about artists that match a keyword string.- Parameters:
q- The search query's keywords (and optional field filters and operators).- Returns:
- A
SearchArtistsRequest.Builder.
-
searchAudiobooks
Get Spotify catalog information about audiobooks that match a keyword string.- Parameters:
q- The search query's keywords (and optional field filters and operators).- Returns:
- A
SearchAudiobooksRequest.Builder.
-
searchEpisodes
Get Spotify catalog information about episodes that match a keyword string.- Parameters:
q- The search query's keywords (and optional field filters and operators).- Returns:
- A
SearchEpisodesRequest.Builder.
-
searchPlaylists
Get Spotify catalog information about playlists that match a keyword string.- Parameters:
q- The search query's keywords (and optional field filters and operators).- Returns:
- A
SearchPlaylistsRequest.Builder.
-
searchShows
Get Spotify catalog information about shows that match a keyword string.- Parameters:
q- The search query's keywords (and optional field filters and operators).- Returns:
- A
SearchShowsRequest.Builder.
-
searchTracks
Get Spotify catalog information about tracks that match a keyword string.- Parameters:
q- The search query's keywords (and optional field filters and operators).- Returns:
- A
SearchTracksRequest.Builder.
-
getShow
Get Spotify catalog information about a show. A show is either 'episodic' (containing episodes) or 'non-episodic' (containing audio only, non-episodic content).- Parameters:
id- The Spotify ID of the show.- Returns:
- A
GetShowRequest.Builder. - See Also:
-
getShowEpisodes
Get Spotify catalog information about an show’s episodes.- Parameters:
id- The Spotify ID of the show.- Returns:
- A
GetShowEpisodesRequest.Builder. - See Also:
-
getSeveralShows
Deprecated.This endpoint has been deprecated by Spotify.Get Spotify catalog information for several shows based on their Spotify IDs.- Parameters:
ids- A comma-separated list of the Spotify IDs for the shows. Maximum: 50 IDs.- Returns:
- A
GetSeveralShowsRequest.Builder. - See Also:
-
getTracksAudioAnalysis
Deprecated.Spotify restricted this endpoint on November 27, 2024 as part of a platform security update. It is unavailable to apps still in Development Mode without a granted quota extension, and to apps registered on or after that date. Apps that already had Extended Quota Mode access to this endpoint before that date are unaffected and can ignore this notice. Spotify has not announced a replacement.Get a detailed audio analysis for a single track identified by its unique Spotify ID.- Parameters:
id- The Spotify ID for the track.- Returns:
- A
GetTracksAudioAnalysisRequest.Builder. - See Also:
-
getTracksAudioFeatures
Deprecated.Spotify restricted this endpoint on November 27, 2024 as part of a platform security update. It is unavailable to apps still in Development Mode without a granted quota extension, and to apps registered on or after that date. Apps that already had Extended Quota Mode access to this endpoint before that date are unaffected and can ignore this notice. Spotify has not announced a replacement.Get audio features for a track based on its Spotify ID.- Parameters:
id- The Spotify ID of the track.- Returns:
- A
GetTracksAudioFeaturesRequest.Builder. - See Also:
-
getSeveralTracksAudioFeatures
@Deprecated public GetSeveralTracksAudioFeaturesRequest.Builder getSeveralTracksAudioFeatures(String... ids) Deprecated.Spotify restricted this endpoint on November 27, 2024 as part of a platform security update. It is unavailable to apps still in Development Mode without a granted quota extension, and to apps registered on or after that date. Apps that already had Extended Quota Mode access to this endpoint before that date are unaffected and can ignore this notice. Spotify has not announced a replacement.Get audio features for multiple tracks based on their Spotify IDs.- Parameters:
ids- A comma-separated list of the Spotify IDs for the tracks. Maximum: 100 IDs.- Returns:
- A
GetSeveralTracksAudioFeaturesRequest.Builder. - See Also:
-
getTrack
Get Spotify catalog information for a single track identified by its unique Spotify ID.- Parameters:
id- The Spotify ID of the track.- Returns:
- A
GetTrackRequest.Builder. - See Also:
-
getSeveralTracks
Deprecated.This endpoint has been deprecated by Spotify.Get Spotify catalog information for multiple tracks based on their Spotify IDs.- Parameters:
ids- A comma-separated list of the Spotify IDs for the tracks. Maximum: 50 IDs.- Returns:
- A
GetSeveralTracksRequest.Builder. - See Also:
-
getUsersProfile
Deprecated.This endpoint is deprecated per the Spotify API specification.Get public profile information about a Spotify user.- Parameters:
user_id- The user's Spotify user ID.- Returns:
- A
GetUsersProfileRequest.Builder. - See Also:
-
getCurrentUsersProfile
Get detailed profile information about the current user (including the current user’s username).- Returns:
- A
GetCurrentUsersProfileRequest.Builder.
-
getAvailableMarkets
Deprecated.This endpoint has been deprecated by Spotify.Get a list of the markets where Spotify is available.- Returns:
- A
GetAvailableMarketsRequest.Builder.
-
addItemsToPlaylist(String, JsonArray)instead.