Class SpotifyApi
java.lang.Object
se.michaelthelin.spotify.SpotifyApi
Instances of the SpotifyApi class provide access to the Spotify Web API.
-
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) Add one or more items to a user's playlist.addItemsToPlaylistDeprecated(String playlist_id) Deprecated.This endpoint has been deprecated by Spotify.Add an item to be played next in 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) Change a playlist's name and public/private state.Deprecated.This endpoint has been deprecated by Spotify.checkIfUserFollowsPlaylist(String playlist_id) Deprecated.This endpoint has been deprecated by Spotify.Deprecated.This endpoint has been deprecated by Spotify.Deprecated.This endpoint has been deprecated by Spotify.Deprecated.This endpoint has been deprecated by Spotify.checkUsersSavedItems(String uris) Check if one or more items are already saved in the current user's library.Deprecated.This endpoint has been deprecated by Spotify.Deprecated.This endpoint has been deprecated by Spotify.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 has been deprecated by Spotify.followArtistsOrUsers(ModelObjectType type, List<String> ids) Deprecated.This endpoint has been deprecated by Spotify.followPlaylist(String playlist_id) 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.This endpoint has been deprecated by Spotify.Deprecated.This endpoint has been deprecated by Spotify.getAudiobook(String id) Get Spotify catalog information for a single audiobook.Get Spotify catalog information about an audiobook's chapters.Get information about a user’s available Spotify Connect devices.Deprecated.This endpoint has been deprecated by Spotify.getCategoryPlaylists(String category_id) Deprecated.This endpoint has been deprecated by Spotify.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.This endpoint has been deprecated by Spotify.Get the current user's followed artists.getHost()Get the API host used for API calls.Get theIHttpManagerused for API calls.Deprecated.This endpoint has been deprecated by Spotify.Get information about the user’s current playback state, including track or episode, progress, and active device.getPlaylist(String playlist_id) Get a playlist owned by a Spotify user.getPlaylistCoverImage(String playlist_id) Get the current image associated with a specific playlist.getPlaylistItems(String playlist_id) Get full details of the items of a playlist owned by a Spotify user.getPlaylistItemsDeprecated(String playlist_id) Deprecated.This endpoint has been deprecated by Spotify.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.This endpoint has been deprecated by Spotify.Deprecated.This endpoint has been deprecated by Spotify.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 has been deprecated by Spotify.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.Deprecated.This endpoint has been deprecated by Spotify.Get Spotify catalog information for a single show identified by its unique Spotify ID.Get Spotify catalog information about an show’s episodes.getSingleBrowseCategory(String category_id) Deprecated.This endpoint has been deprecated by Spotify.Get Spotify catalog information for a single track identified by its unique Spotify ID.Deprecated.This endpoint has been deprecated by Spotify.Deprecated.This endpoint has been deprecated by Spotify.getUsersPlaylists(String user_id) Deprecated.This endpoint has been deprecated by Spotify.getUsersProfile(String user_id) Deprecated.This endpoint has been deprecated by Spotify.Get the list of objects that make up the user's 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 'Your Music' 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 a list of the songs saved in the current Spotify user's 'Your Music' library.Get the current user's top artists or tracks based on calculated affinity.Get the current user's top artists or tracks based on calculated affinity.Get the current user's top artists or 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 has been deprecated by Spotify.Deprecated.This endpoint has been deprecated by Spotify.Deprecated.This endpoint has been deprecated by Spotify.removeItemsFromLibrary(String uris) Remove one or more items from the current user's library.removePlaylistItems(String playlist_id, List<String> items) Remove one or more items from a user's playlist.removePlaylistItemsDeprecated(String playlist_id, List<String> tracks) Deprecated.This endpoint has been deprecated by Spotify.Deprecated.This endpoint has been deprecated by Spotify.removeUsersSavedTracks(List<String> ids) Deprecated.This endpoint has been deprecated by Spotify.Deprecated.This endpoint has been deprecated by Spotify.Deprecated.This endpoint has been deprecated by Spotify.Deprecated.This endpoint has been deprecated by Spotify.saveItemsToLibrary(String uris) Add one or more items to the current user's library.Deprecated.This endpoint has been deprecated by Spotify.Deprecated.This endpoint has been deprecated by Spotify.Get Spotify catalog information about albums, artists, playlists, tracks, shows, episodes or audiobooks that match a keyword string.Get Spotify catalog information about albums, artists, playlists, tracks, shows, episodes or audiobooks that match a keyword string.Get Spotify catalog information about albums, artists, playlists, tracks, shows, episodes or audiobooks that match a keyword string.Get Spotify catalog information about albums, artists, playlists, tracks, shows, episodes or audiobooks that match a keyword string.Get Spotify catalog information about albums, artists, playlists, tracks, shows, episodes or audiobooks that match a keyword string.searchForItem(String q, String type) Get Spotify catalog information about albums, artists, playlists, tracks, shows, episodes or audiobooks that match a keyword string.Get Spotify catalog information about albums, artists, playlists, tracks, shows, episodes or audiobooks that match a keyword string.Get Spotify catalog information about albums, artists, playlists, tracks, shows, episodes or audiobooks that match a keyword string.Get Spotify catalog information about albums, artists, playlists, tracks, shows, episodes or audiobooks that match a keyword string.seekToPosition(Integer 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(Integer 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(List<String> device_ids) Transfer playback to a new device and optionally begin playback.unfollowArtistsOrUsers(ModelObjectType type, List<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) Either reorder or replace items in a playlist depending on the request's parameters.updatePlaylistsItemsReorderDeprecated(String playlist_id) Deprecated.This endpoint has been deprecated by Spotify.updatePlaylistsItemsReplace(String playlist_id) Either reorder or replace items in a playlist depending on the request's parameters.updatePlaylistsItemsReplaceDeprecated(String playlist_id) Deprecated.This endpoint has been deprecated by Spotify.
-
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.
-
checkUsersSavedAlbums
Deprecated.This endpoint has been deprecated by Spotify.Check if one or more albums is already saved in the current Spotify user's 'Your Music' library. Note: This endpoint is deprecated. Use Check User's Saved Items instead.- Parameters:
ids- A comma-separated list of the Spotify IDs for the albums. Maximum: 20 IDs.- Returns:
- A
CheckUsersSavedAlbumsRequest.Builder. - See Also:
-
getAlbum
Get Spotify catalog information for a single album.- Parameters:
id- The Spotify ID of 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:
-
getNewReleases
Deprecated.This endpoint has been deprecated by Spotify.Get a list of new album releases featured in Spotify (shown, for example, on a Spotify player’s “Browse” tab).- Returns:
- A
GetNewReleasesRequest.Builder. - See Also:
-
getSeveralAlbums
Deprecated.This endpoint has been deprecated by Spotify.Get Spotify catalog information for multiple 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:
-
getUsersSavedAlbums
Get a list of the albums saved in the current Spotify user's 'Your Music' library.- Returns:
- A
GetUsersSavedAlbumsRequest.Builder. - See Also:
-
removeAlbumsForCurrentUser
@Deprecated public RemoveAlbumsForCurrentUserRequest.Builder removeAlbumsForCurrentUser(List<String> ids) Deprecated.This endpoint has been deprecated by Spotify.Remove one or more albums from the current user's 'Your Music' library. Note: This endpoint is deprecated. Use Remove Items from Library instead.- Parameters:
ids- A JSON array of the Spotify IDs. For example:["4iV5W9uYEdYUVa79Axb7Rh", "1301WleyT98MSxVHPZCA6M"]
A maximum of 50 items can be specified in one request. Note: if theidsparameter is present in the query string, any IDs listed here in the body will be ignored.- Returns:
- A
RemoveAlbumsForCurrentUserRequest.Builder. - See Also:
-
saveAlbumsForCurrentUser
@Deprecated public SaveAlbumsForCurrentUserRequest.Builder saveAlbumsForCurrentUser(List<String> ids) Deprecated.This endpoint has been deprecated by Spotify.Save one or more albums to the current user's 'Your Music' library. Note: This endpoint is deprecated. Use Save Items to Library instead.- Parameters:
ids- A JSON array of the Spotify IDs. For example:["4iV5W9uYEdYUVa79Axb7Rh", "1301WleyT98MSxVHPZCA6M"]
A maximum of 50 items can be specified in one request. Note: if theidsparameter is present in the query string, any IDs listed here in the body will be ignored.- Returns:
- A
SaveAlbumsForCurrentUserRequest.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.This endpoint has been deprecated by Spotify.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 of 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:
-
checkUsersSavedAudiobooks
Deprecated.This endpoint has been deprecated by Spotify.Check if one or more audiobooks are already saved in the current Spotify user's library. Note: This endpoint is deprecated. Use Check User's Saved Items instead.- Parameters:
ids- A comma-separated list of the Spotify IDs. For example:ids=18yVqkdbdRvS24c0Ilj2ci,1HGw3J3NxZO1TP1BTtVhpZ. Maximum: 50 IDs.- Returns:
- A
CheckUsersSavedAudiobooksRequest.Builder. - See Also:
-
getAudiobookChapters
Get Spotify catalog information about an audiobook's chapters. Audiobooks are only available within the US, UK, Canada, Ireland, New Zealand and Australia markets.- Parameters:
id- The Spotify ID for the audiobook.- Returns:
- A
GetAudiobookChaptersRequest.Builder. - See Also:
-
getAudiobook
Get Spotify catalog information for a single audiobook. Audiobooks are only available within the US, UK, Canada, Ireland, New Zealand and Australia markets.- 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. Audiobooks are only available within the US, UK, Canada, Ireland, New Zealand and Australia markets.- Parameters:
ids- A comma-separated list of the Spotify IDs. For example:ids=18yVqkdbdRvS24c0Ilj2ci,1HGw3J3NxZO1TP1BTtVhpZ. Maximum: 50 IDs.- Returns:
- A
GetSeveralAudiobooksRequest.Builder. - See Also:
-
getUsersSavedAudiobooks
Get a list of the audiobooks saved in the current Spotify user's 'Your Music' library.- Returns:
- A
GetUsersSavedAudiobooksRequest.Builder. - See Also:
-
removeAudiobooksForCurrentUser
@Deprecated public RemoveAudiobooksForCurrentUserRequest.Builder removeAudiobooksForCurrentUser(String ids) Deprecated.This endpoint has been deprecated by Spotify.Remove one or more audiobooks from the Spotify user's library. Note: This endpoint is deprecated. Use Remove Items from Library instead.- Parameters:
ids- A comma-separated list of the Spotify IDs. For example:ids=18yVqkdbdRvS24c0Ilj2ci,1HGw3J3NxZO1TP1BTtVhpZ. Maximum: 50 IDs.- Returns:
- A
RemoveAudiobooksForCurrentUserRequest.Builder. - See Also:
-
saveAudiobooksForCurrentUser
@Deprecated public SaveAudiobooksForCurrentUserRequest.Builder saveAudiobooksForCurrentUser(String ids) Deprecated.This endpoint has been deprecated by Spotify.Save one or more audiobooks to the current Spotify user's library. Note: This endpoint is deprecated. Use Save Items to Library instead.- Parameters:
ids- A comma-separated list of the Spotify IDs. For example:ids=18yVqkdbdRvS24c0Ilj2ci,1HGw3J3NxZO1TP1BTtVhpZ. Maximum: 50 IDs.- Returns:
- A
SaveAudiobooksForCurrentUserRequest.Builder. - See Also:
-
getSeveralBrowseCategories
Deprecated.This endpoint has been deprecated by Spotify.Get a list of categories used to tag items in Spotify (on, for example, the Spotify player’s “Browse” tab).- Returns:
- A
GetSeveralBrowseCategoriesRequest.Builder. - See Also:
-
getSingleBrowseCategory
@Deprecated public GetSingleBrowseCategoryRequest.Builder getSingleBrowseCategory(String category_id) Deprecated.This endpoint has been deprecated by Spotify.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:
-
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 audiobook chapters identified by their Spotify IDs. Chapters are only available within the US, UK, Canada, Ireland, New Zealand and Australia markets.- Parameters:
ids- A comma-separated list of the Spotify IDs. For example:ids=0IsXVP0JmcB2adSE338GkK,3ZXb8FKZGU0EHALYX6uCzU. Maximum: 50 IDs.- Returns:
- A
GetSeveralChaptersRequest.Builder. - See Also:
-
checkUsersSavedEpisodes
Deprecated.This endpoint has been deprecated by Spotify.Check if one or more episodes is already saved in the current Spotify user's 'Your Episodes' library. Note: This endpoint is deprecated. Use Check User's Saved Items instead.- Parameters:
ids- A comma-separated list of the Spotify IDs for the episodes. Maximum: 50 IDs.- Returns:
- A
CheckUsersSavedEpisodesRequest.Builder. - See Also:
-
getEpisode
Get Spotify catalog information for a single episode identified by its unique Spotify ID.- Parameters:
id- The Spotify ID for 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:
-
getUsersSavedEpisodes
Get a list of the episodes saved in the current Spotify user's library.- Returns:
- A
GetUsersSavedEpisodesRequest.Builder. - See Also:
-
removeEpisodesForCurrentUser
@Deprecated public RemoveEpisodesForCurrentUserRequest.Builder removeEpisodesForCurrentUser(List<String> ids) Deprecated.This endpoint has been deprecated by Spotify.Remove one or more episodes from the current user's library. Note: This endpoint is deprecated. Use Remove Items from Library instead.- Parameters:
ids- A JSON array of the Spotify IDs.
A maximum of 50 items can be specified in one request. Note: if theidsparameter is present in the query string, any IDs listed here in the body will be ignored.- Returns:
- A
RemoveEpisodesForCurrentUserRequest.Builder. - See Also:
-
saveEpisodesForCurrentUser
@Deprecated public SaveEpisodesForCurrentUserRequest.Builder saveEpisodesForCurrentUser(List<String> ids) Deprecated.This endpoint has been deprecated by Spotify.Save one or more episodes to the current user's library. Note: This endpoint is deprecated. Use Save Items to Library instead.- Parameters:
ids- A JSON array of the Spotify IDs.
A maximum of 50 items can be specified in one request. Note: if theidsparameter is present in the query string, any IDs listed here in the body will be ignored.- Returns:
- A
SaveEpisodesForCurrentUserRequest.Builder. - See Also:
-
getRecommendationGenres
Deprecated.This endpoint has been deprecated by Spotify.Retrieve a list of available genres seed parameter values for recommendations.- Returns:
- A
GetRecommendationGenresRequest.Builder. - See Also:
-
checkUsersSavedItems
Check if one or more items are already saved in the current user's library. Accepts Spotify URIs for tracks, albums, episodes, shows, audiobooks, artists, users, and playlists.- Parameters:
uris- A comma-separated list of Spotify URIs. Maximum: 40 URIs. Supported URI types: -spotify:track:{id}-spotify:album:{id}-spotify:episode:{id}-spotify:show:{id}-spotify:audiobook:{id}-spotify:artist:{id}-spotify:user:{id}-spotify:playlist:{id}- Returns:
- A
CheckUsersSavedItemsRequest.Builder. - See Also:
-
removeItemsFromLibrary
Remove one or more items from 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. Maximum: 40 URIs. Supported URI types: -spotify:track:{id}-spotify:album:{id}-spotify:episode:{id}-spotify:show:{id}-spotify:audiobook:{id}-spotify:user:{id}-spotify:playlist:{id}- Returns:
- A
RemoveItemsFromLibraryRequest.Builder. - See Also:
-
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. Maximum: 40 URIs. Supported URI types: -spotify:track:{id}-spotify:album:{id}-spotify:episode:{id}-spotify:show:{id}-spotify:audiobook:{id}-spotify:user:{id}-spotify:playlist:{id}- Returns:
- A
SaveItemsToLibraryRequest.Builder. - See Also:
-
getAvailableMarkets
Deprecated.This endpoint has been deprecated by Spotify.Get the list of markets where Spotify is available.- Returns:
- A
GetAvailableMarketsRequest.Builder. - See Also:
-
addItemToPlaybackQueue
Add an item to be played next in the user's current playback queue. This API only works for users who have Spotify Premium. The order of execution is not guaranteed when you use this API with other Player API endpoints.- 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:
-
getAvailableDevices
Get information about a user’s available Spotify Connect devices. Some device models are not supported and will not be listed in the API response.- Returns:
- A
GetAvailableDevicesRequest.Builder. - See Also:
-
getCurrentlyPlayingTrack
Get the object currently being played on the user's Spotify account.- Returns:
- A
GetCurrentlyPlayingTrackRequest.Builder. - See Also:
-
getPlaybackState
Get information about the user’s current playback state, including track or episode, progress, and active device.- Returns:
- A
GetPlaybackStateRequest.Builder. - See Also:
-
getRecentlyPlayedTracks
Get tracks from the current user's recently played tracks. Note: Currently doesn't support podcast episodes.- Returns:
- A
GetRecentlyPlayedTracksRequest.Builder. - See Also:
-
getUsersQueue
Get the list of objects that make up the user's queue.- Returns:
- A
GetUsersQueueRequest.Builder. - See Also:
-
pausePlayback
Pause playback on the user's account. This API only works for users who have Spotify Premium. The order of execution is not guaranteed when you use this API with other Player API endpoints.- Returns:
- A
PausePlaybackRequest.Builder. - See Also:
-
seekToPosition
Seeks to the given position in the user’s currently playing track. This API only works for users who have Spotify Premium. The order of execution is not guaranteed when you use this API with other Player API endpoints.- 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. - See Also:
-
setPlaybackVolume
Set the volume for the user’s current playback device. This API only works for users who have Spotify Premium. The order of execution is not guaranteed when you use this API with other Player API endpoints.- Parameters:
volume_percent- The volume to set. Must be a value from 0 to 100 inclusive.- Returns:
- A
SetPlaybackVolumeRequest.Builder. - See Also:
-
setRepeatMode
Set the repeat mode for the user's playback. This API only works for users who have Spotify Premium. The order of execution is not guaranteed when you use this API with other Player API endpoints.- 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. - See Also:
-
skipToNext
Skips to next track in the user’s queue. This API only works for users who have Spotify Premium. The order of execution is not guaranteed when you use this API with other Player API endpoints.- Returns:
- A
SkipToNextRequest.Builder. - See Also:
-
skipToPrevious
Skips to previous track in the user’s queue. This API only works for users who have Spotify Premium. The order of execution is not guaranteed when you use this API with other Player API endpoints.- Returns:
- A
SkipToPreviousRequest.Builder. - See Also:
-
startResumePlayback
Start a new context or resume current playback on the user's active device. This API only works for users who have Spotify Premium. The order of execution is not guaranteed when you use this API with other Player API endpoints.- Returns:
- A
StartResumePlaybackRequest.Builder. - See Also:
-
togglePlaybackShuffle
Toggle shuffle on or off for user’s playback. This API only works for users who have Spotify Premium. The order of execution is not guaranteed when you use this API with other Player API endpoints.- Parameters:
state- true : Shuffle user's playback.
false : Do not shuffle user's playback.- Returns:
- A
TogglePlaybackShuffleRequest.Builder. - See Also:
-
transferPlayback
Transfer playback to a new device and optionally begin playback. This API only works for users who have Spotify Premium. The order of execution is not guaranteed when you use this API with other Player API endpoints.- Parameters:
device_ids- A JSON array containing the ID of the device on which playback should be started/transferred.
For example:{device_ids:["74ASZWbe4lXaubB36ztrGX"]}
_Note: Although an array is accepted, only a single device_id is currently supported. Supplying more than one will return400 Bad Request_- Returns:
- A
TransferPlaybackRequest.Builder. - See Also:
-
addItemsToPlaylistDeprecated
@Deprecated public AddItemsToPlaylistDeprecatedRequest.Builder addItemsToPlaylistDeprecated(String playlist_id) Deprecated.This endpoint has been deprecated by Spotify.Deprecated: Use Add Items to Playlist instead. Add one or more items to a user's playlist.- Parameters:
playlist_id- The Spotify ID of the playlist.- Returns:
- A
AddItemsToPlaylistDeprecatedRequest.Builder. - See Also:
-
addItemsToPlaylist
Add one or more items to a user's playlist.- Parameters:
playlist_id- The Spotify ID of the playlist.- Returns:
- A
AddItemsToPlaylistRequest.Builder. - See Also:
-
changePlaylistDetails
Change a playlist's name and public/private state. (The user must, of course, own the playlist.)- Parameters:
playlist_id- The Spotify ID of the playlist.- Returns:
- A
ChangePlaylistDetailsRequest.Builder. - See Also:
-
createPlaylistForUser
@Deprecated public CreatePlaylistForUserRequest.Builder createPlaylistForUser(String user_id, String name) Deprecated.This endpoint has been deprecated by Spotify.Deprecated: Use Create Playlist instead. Create a playlist for a Spotify user. (The playlist will be empty until you add tracks.) Each user is generally limited to a maximum of 11000 playlists.- Parameters:
user_id- 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.- Returns:
- A
CreatePlaylistForUserRequest.Builder. - See Also:
-
createPlaylist
Create a playlist for the current Spotify user. (The playlist will be empty until you add tracks.) Each user is generally limited to a maximum of 11000 playlists.- Parameters:
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.- Returns:
- A
CreatePlaylistRequest.Builder. - See Also:
-
getCategoryPlaylists
Deprecated.This endpoint has been deprecated by Spotify.Get a list of Spotify playlists tagged with a particular category.- Parameters:
category_id- The Spotify category ID for the category.- Returns:
- A
GetCategoryPlaylistsRequest.Builder. - See Also:
-
getCurrentUsersPlaylists
Get a list of the playlists owned or followed by the current Spotify user.- Returns:
- A
GetCurrentUsersPlaylistsRequest.Builder. - See Also:
-
getFeaturedPlaylists
Deprecated.This endpoint has been deprecated by Spotify.Get a list of Spotify featured playlists (shown, for example, on a Spotify player's 'Browse' tab).- Returns:
- A
GetFeaturedPlaylistsRequest.Builder. - See Also:
-
getPlaylistCoverImage
Get the current image associated with a specific playlist.- Parameters:
playlist_id- The Spotify ID of the playlist.- Returns:
- A
GetPlaylistCoverImageRequest.Builder. - See Also:
-
getPlaylistItemsDeprecated
@Deprecated public GetPlaylistItemsDeprecatedRequest.Builder getPlaylistItemsDeprecated(String playlist_id) Deprecated.This endpoint has been deprecated by Spotify.Deprecated: Use Get Playlist Items instead. Get full details of the items of a playlist owned by a Spotify user.- Parameters:
playlist_id- The Spotify ID of the playlist.- Returns:
- A
GetPlaylistItemsDeprecatedRequest.Builder. - See Also:
-
getPlaylistItems
Get full details of the items of a playlist owned by a Spotify user. Note: This endpoint is only accessible for playlists owned by the current user or playlists the user is a collaborator of. A403 Forbiddenstatus code will be returned if the user is neither the owner nor a collaborator of the playlist.- Parameters:
playlist_id- The Spotify ID of the playlist.- Returns:
- A
GetPlaylistItemsRequest.Builder. - See Also:
-
getPlaylist
Get a playlist owned by a Spotify user.- Parameters:
playlist_id- The Spotify ID of the playlist.- Returns:
- A
GetPlaylistRequest.Builder. - See Also:
-
getUsersPlaylists
Deprecated.This endpoint has been deprecated by Spotify.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:
-
removePlaylistItemsDeprecated
@Deprecated public RemovePlaylistItemsDeprecatedRequest.Builder removePlaylistItemsDeprecated(String playlist_id, List<String> tracks) Deprecated.This endpoint has been deprecated by Spotify.Deprecated: Use Remove Playlist Items instead. Remove one or more items from a user's playlist.- Parameters:
playlist_id- The Spotify ID of the playlist.tracks- An array of objects containing Spotify URIs of the tracks or episodes to remove. For example:{ "tracks": [{ "uri": "spotify:track:4iV5W9uYEdYUVa79Axb7Rh" },{ "uri": "spotify:track:1301WleyT98MSxVHPZCA6M" }] }. A maximum of 100 objects can be sent at once. Pass the uri values; each is sent as {@code {"uri": value}}.- Returns:
- A
RemovePlaylistItemsDeprecatedRequest.Builder. - See Also:
-
removePlaylistItems
public RemovePlaylistItemsRequest.Builder removePlaylistItems(String playlist_id, List<String> items) Remove one or more items from a user's playlist.- Parameters:
playlist_id- The Spotify ID of the playlist.items- An array of objects containing Spotify URIs of the tracks or episodes to remove. For example:{ "items": [{ "uri": "spotify:track:4iV5W9uYEdYUVa79Axb7Rh" },{ "uri": "spotify:track:1301WleyT98MSxVHPZCA6M" }] }. A maximum of 100 objects can be sent at once. Pass the uri values; each is sent as {@code {"uri": value}}.- Returns:
- A
RemovePlaylistItemsRequest.Builder. - See Also:
-
updatePlaylistsItemsReorderDeprecated
@Deprecated public UpdatePlaylistsItemsReorderDeprecatedRequest.Builder updatePlaylistsItemsReorderDeprecated(String playlist_id) Deprecated.This endpoint has been deprecated by Spotify.Deprecated: Use Update Playlist Items instead. Either reorder or replace items in a playlist depending on the request's parameters. To reorder items, includerange_start,insert_before,range_lengthandsnapshot_idin the request's body. To replace items, includeurisas either a query parameter or in the request's body. Replacing items in a playlist will overwrite its existing items. This operation can be used for replacing or clearing items in a playlist.
Note: Replace and reorder are mutually exclusive operations which share the same endpoint, but have different parameters. These operations can't be applied together in a single request.- Parameters:
playlist_id- The Spotify ID of the playlist.- Returns:
- A
UpdatePlaylistsItemsReorderDeprecatedRequest.Builder. - See Also:
-
updatePlaylistsItemsReorder
Either reorder or replace items in a playlist depending on the request's parameters. To reorder items, includerange_start,insert_before,range_lengthandsnapshot_idin the request's body. To replace items, includeurisas either a query parameter or in the request's body. Replacing items in a playlist will overwrite its existing items. This operation can be used for replacing or clearing items in a playlist.
Note: Replace and reorder are mutually exclusive operations which share the same endpoint, but have different parameters. These operations can't be applied together in a single request.- Parameters:
playlist_id- The Spotify ID of the playlist.- Returns:
- A
UpdatePlaylistsItemsReorderRequest.Builder. - See Also:
-
updatePlaylistsItemsReplaceDeprecated
@Deprecated public UpdatePlaylistsItemsReplaceDeprecatedRequest.Builder updatePlaylistsItemsReplaceDeprecated(String playlist_id) Deprecated.This endpoint has been deprecated by Spotify.Deprecated: Use Update Playlist Items instead. Either reorder or replace items in a playlist depending on the request's parameters. To reorder items, includerange_start,insert_before,range_lengthandsnapshot_idin the request's body. To replace items, includeurisas either a query parameter or in the request's body. Replacing items in a playlist will overwrite its existing items. This operation can be used for replacing or clearing items in a playlist.
Note: Replace and reorder are mutually exclusive operations which share the same endpoint, but have different parameters. These operations can't be applied together in a single request.- Parameters:
playlist_id- The Spotify ID of the playlist.- Returns:
- A
UpdatePlaylistsItemsReplaceDeprecatedRequest.Builder. - See Also:
-
updatePlaylistsItemsReplace
Either reorder or replace items in a playlist depending on the request's parameters. To reorder items, includerange_start,insert_before,range_lengthandsnapshot_idin the request's body. To replace items, includeurisas either a query parameter or in the request's body. Replacing items in a playlist will overwrite its existing items. This operation can be used for replacing or clearing items in a playlist.
Note: Replace and reorder are mutually exclusive operations which share the same endpoint, but have different parameters. These operations can't be applied together in a single request.- Parameters:
playlist_id- The Spotify ID of the playlist.- Returns:
- A
UpdatePlaylistsItemsReplaceRequest.Builder. - See Also:
-
searchForItem
Get Spotify catalog information about albums, artists, playlists, tracks, shows, episodes or audiobooks that match a keyword string. Audiobooks are only available within the US, UK, Canada, Ireland, New Zealand and Australia markets.- Parameters:
q- Your search query. You can narrow down your search using field filters. The available filters arealbum,artist,track,year,upc,tag:hipster,tag:new,isrc, andgenre. Each field filter only applies to certain result types. Theartistandyearfilters can be used while searching albums, artists and tracks. You can filter on a singleyearor a range (e.g. 1955-1960).
Thealbumfilter can be used while searching albums and tracks.
Thegenrefilter can be used while searching artists and tracks.
Theisrcandtrackfilters can be used while searching tracks.
Theupc,tag:newandtag:hipsterfilters can only be used while searching albums. Thetag:newfilter will return albums released in the past two weeks andtag:hipstercan be used to return only albums with the lowest 10% popularity.type- A comma-separated list of item types to search across. Search results include hits from all the specified item types. For example:q=abacab&type=album,trackreturns both albums and tracks matching "abacab".- Returns:
- A
SearchForItemRequest.Builder. - See Also:
-
searchAlbums
Get Spotify catalog information about albums, artists, playlists, tracks, shows, episodes or audiobooks that match a keyword string. Audiobooks are only available within the US, UK, Canada, Ireland, New Zealand and Australia markets.- Parameters:
q- Your search query. You can narrow down your search using field filters. The available filters arealbum,artist,track,year,upc,tag:hipster,tag:new,isrc, andgenre. Each field filter only applies to certain result types. Theartistandyearfilters can be used while searching albums, artists and tracks. You can filter on a singleyearor a range (e.g. 1955-1960).
Thealbumfilter can be used while searching albums and tracks.
Thegenrefilter can be used while searching artists and tracks.
Theisrcandtrackfilters can be used while searching tracks.
Theupc,tag:newandtag:hipsterfilters can only be used while searching albums. Thetag:newfilter will return albums released in the past two weeks andtag:hipstercan be used to return only albums with the lowest 10% popularity.- Returns:
- A
SearchAlbumsRequest.Builder. - See Also:
-
searchArtists
Get Spotify catalog information about albums, artists, playlists, tracks, shows, episodes or audiobooks that match a keyword string. Audiobooks are only available within the US, UK, Canada, Ireland, New Zealand and Australia markets.- Parameters:
q- Your search query. You can narrow down your search using field filters. The available filters arealbum,artist,track,year,upc,tag:hipster,tag:new,isrc, andgenre. Each field filter only applies to certain result types. Theartistandyearfilters can be used while searching albums, artists and tracks. You can filter on a singleyearor a range (e.g. 1955-1960).
Thealbumfilter can be used while searching albums and tracks.
Thegenrefilter can be used while searching artists and tracks.
Theisrcandtrackfilters can be used while searching tracks.
Theupc,tag:newandtag:hipsterfilters can only be used while searching albums. Thetag:newfilter will return albums released in the past two weeks andtag:hipstercan be used to return only albums with the lowest 10% popularity.- Returns:
- A
SearchArtistsRequest.Builder. - See Also:
-
searchAudiobooks
Get Spotify catalog information about albums, artists, playlists, tracks, shows, episodes or audiobooks that match a keyword string. Audiobooks are only available within the US, UK, Canada, Ireland, New Zealand and Australia markets.- Parameters:
q- Your search query. You can narrow down your search using field filters. The available filters arealbum,artist,track,year,upc,tag:hipster,tag:new,isrc, andgenre. Each field filter only applies to certain result types. Theartistandyearfilters can be used while searching albums, artists and tracks. You can filter on a singleyearor a range (e.g. 1955-1960).
Thealbumfilter can be used while searching albums and tracks.
Thegenrefilter can be used while searching artists and tracks.
Theisrcandtrackfilters can be used while searching tracks.
Theupc,tag:newandtag:hipsterfilters can only be used while searching albums. Thetag:newfilter will return albums released in the past two weeks andtag:hipstercan be used to return only albums with the lowest 10% popularity.- Returns:
- A
SearchAudiobooksRequest.Builder. - See Also:
-
searchEpisodes
Get Spotify catalog information about albums, artists, playlists, tracks, shows, episodes or audiobooks that match a keyword string. Audiobooks are only available within the US, UK, Canada, Ireland, New Zealand and Australia markets.- Parameters:
q- Your search query. You can narrow down your search using field filters. The available filters arealbum,artist,track,year,upc,tag:hipster,tag:new,isrc, andgenre. Each field filter only applies to certain result types. Theartistandyearfilters can be used while searching albums, artists and tracks. You can filter on a singleyearor a range (e.g. 1955-1960).
Thealbumfilter can be used while searching albums and tracks.
Thegenrefilter can be used while searching artists and tracks.
Theisrcandtrackfilters can be used while searching tracks.
Theupc,tag:newandtag:hipsterfilters can only be used while searching albums. Thetag:newfilter will return albums released in the past two weeks andtag:hipstercan be used to return only albums with the lowest 10% popularity.- Returns:
- A
SearchEpisodesRequest.Builder. - See Also:
-
searchPlaylists
Get Spotify catalog information about albums, artists, playlists, tracks, shows, episodes or audiobooks that match a keyword string. Audiobooks are only available within the US, UK, Canada, Ireland, New Zealand and Australia markets.- Parameters:
q- Your search query. You can narrow down your search using field filters. The available filters arealbum,artist,track,year,upc,tag:hipster,tag:new,isrc, andgenre. Each field filter only applies to certain result types. Theartistandyearfilters can be used while searching albums, artists and tracks. You can filter on a singleyearor a range (e.g. 1955-1960).
Thealbumfilter can be used while searching albums and tracks.
Thegenrefilter can be used while searching artists and tracks.
Theisrcandtrackfilters can be used while searching tracks.
Theupc,tag:newandtag:hipsterfilters can only be used while searching albums. Thetag:newfilter will return albums released in the past two weeks andtag:hipstercan be used to return only albums with the lowest 10% popularity.- Returns:
- A
SearchPlaylistsRequest.Builder. - See Also:
-
searchShows
Get Spotify catalog information about albums, artists, playlists, tracks, shows, episodes or audiobooks that match a keyword string. Audiobooks are only available within the US, UK, Canada, Ireland, New Zealand and Australia markets.- Parameters:
q- Your search query. You can narrow down your search using field filters. The available filters arealbum,artist,track,year,upc,tag:hipster,tag:new,isrc, andgenre. Each field filter only applies to certain result types. Theartistandyearfilters can be used while searching albums, artists and tracks. You can filter on a singleyearor a range (e.g. 1955-1960).
Thealbumfilter can be used while searching albums and tracks.
Thegenrefilter can be used while searching artists and tracks.
Theisrcandtrackfilters can be used while searching tracks.
Theupc,tag:newandtag:hipsterfilters can only be used while searching albums. Thetag:newfilter will return albums released in the past two weeks andtag:hipstercan be used to return only albums with the lowest 10% popularity.- Returns:
- A
SearchShowsRequest.Builder. - See Also:
-
searchTracks
Get Spotify catalog information about albums, artists, playlists, tracks, shows, episodes or audiobooks that match a keyword string. Audiobooks are only available within the US, UK, Canada, Ireland, New Zealand and Australia markets.- Parameters:
q- Your search query. You can narrow down your search using field filters. The available filters arealbum,artist,track,year,upc,tag:hipster,tag:new,isrc, andgenre. Each field filter only applies to certain result types. Theartistandyearfilters can be used while searching albums, artists and tracks. You can filter on a singleyearor a range (e.g. 1955-1960).
Thealbumfilter can be used while searching albums and tracks.
Thegenrefilter can be used while searching artists and tracks.
Theisrcandtrackfilters can be used while searching tracks.
Theupc,tag:newandtag:hipsterfilters can only be used while searching albums. Thetag:newfilter will return albums released in the past two weeks andtag:hipstercan be used to return only albums with the lowest 10% popularity.- Returns:
- A
SearchTracksRequest.Builder. - See Also:
-
searchAlbumsSpecial
Get Spotify catalog information about albums, artists, playlists, tracks, shows, episodes or audiobooks that match a keyword string. Audiobooks are only available within the US, UK, Canada, Ireland, New Zealand and Australia markets.- Parameters:
q- Your search query. You can narrow down your search using field filters. The available filters arealbum,artist,track,year,upc,tag:hipster,tag:new,isrc, andgenre. Each field filter only applies to certain result types. Theartistandyearfilters can be used while searching albums, artists and tracks. You can filter on a singleyearor a range (e.g. 1955-1960).
Thealbumfilter can be used while searching albums and tracks.
Thegenrefilter can be used while searching artists and tracks.
Theisrcandtrackfilters can be used while searching tracks.
Theupc,tag:newandtag:hipsterfilters can only be used while searching albums. Thetag:newfilter will return albums released in the past two weeks andtag:hipstercan be used to return only albums with the lowest 10% popularity.- Returns:
- A
SearchAlbumsSpecialRequest.Builder. - See Also:
-
checkUsersSavedShows
Deprecated.This endpoint has been deprecated by Spotify.Check if one or more shows is already saved in the current Spotify user's library. Note: This endpoint is deprecated. Use Check User's Saved Items instead.- Parameters:
ids- A comma-separated list of the Spotify IDs for the shows. Maximum: 50 IDs.- Returns:
- A
CheckUsersSavedShowsRequest.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:
-
getShowEpisodes
Get Spotify catalog information about an show’s episodes. Optional parameters can be used to limit the number of episodes returned.- Parameters:
id- The Spotify ID for the show.- Returns:
- A
GetShowEpisodesRequest.Builder. - See Also:
-
getShow
Get Spotify catalog information for a single show identified by its unique Spotify ID.- Parameters:
id- The Spotify ID for the show.- Returns:
- A
GetShowRequest.Builder. - See Also:
-
getUsersSavedShows
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.- Returns:
- A
GetUsersSavedShowsRequest.Builder. - See Also:
-
removeShowsForCurrentUser
Deprecated.This endpoint has been deprecated by Spotify.Delete one or more shows from current Spotify user's library. Note: This endpoint is deprecated. Use Remove Items from Library instead.- Parameters:
ids- A comma-separated list of the Spotify IDs for the shows. Maximum: 50 IDs.- Returns:
- A
RemoveShowsForCurrentUserRequest.Builder. - See Also:
-
saveShowsForCurrentUser
Deprecated.This endpoint has been deprecated by Spotify.Save one or more shows to current Spotify user's library. Note: This endpoint is deprecated. Use Save Items to Library instead.- Parameters:
ids- A comma-separated list of the Spotify IDs for the shows. Maximum: 50 IDs.- Returns:
- A
SaveShowsForCurrentUserRequest.Builder. - See Also:
-
checkUsersSavedTracks
Deprecated.This endpoint has been deprecated by Spotify.Check if one or more tracks is already saved in the current Spotify user's 'Your Music' library. Note: This endpoint is deprecated. Use Check User's Saved Items instead.- Parameters:
ids- A comma-separated list of the Spotify IDs. For example:ids=4iV5W9uYEdYUVa79Axb7Rh,1301WleyT98MSxVHPZCA6M. Maximum: 50 IDs.- Returns:
- A
CheckUsersSavedTracksRequest.Builder. - See Also:
-
getRecommendations
Deprecated.This endpoint has been deprecated by Spotify.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.- Returns:
- A
GetRecommendationsRequest.Builder. - See Also:
-
getSeveralTracksAudioFeatures
@Deprecated public GetSeveralTracksAudioFeaturesRequest.Builder getSeveralTracksAudioFeatures(String ids) Deprecated.This endpoint has been deprecated by Spotify.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:
-
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 example:ids=4iV5W9uYEdYUVa79Axb7Rh,1301WleyT98MSxVHPZCA6M. Maximum: 50 IDs.- Returns:
- A
GetSeveralTracksRequest.Builder. - See Also:
-
getTrack
Get Spotify catalog information for a single track identified by its unique Spotify ID.- Parameters:
id- The Spotify ID for the track.- Returns:
- A
GetTrackRequest.Builder. - See Also:
-
getTracksAudioAnalysis
Deprecated.This endpoint has been deprecated by Spotify.Get a low-level audio analysis for a track in the Spotify catalog. The audio analysis describes the track’s structure and musical content, including rhythm, pitch, and timbre.- Parameters:
id- The Spotify ID for the track.- Returns:
- A
GetTracksAudioAnalysisRequest.Builder. - See Also:
-
getTracksAudioFeatures
Deprecated.This endpoint has been deprecated by Spotify.Get audio feature information for a single track identified by its unique Spotify ID.- Parameters:
id- The Spotify ID for the track.- Returns:
- A
GetTracksAudioFeaturesRequest.Builder. - See Also:
-
getUsersSavedTracks
Get a list of the songs saved in the current Spotify user's 'Your Music' library.- Returns:
- A
GetUsersSavedTracksRequest.Builder. - See Also:
-
removeUsersSavedTracks
Deprecated.This endpoint has been deprecated by Spotify.Remove one or more tracks from the current user's 'Your Music' library. Note: This endpoint is deprecated. Use Remove Items from Library instead.- Parameters:
ids- A JSON array of the Spotify IDs. For example:["4iV5W9uYEdYUVa79Axb7Rh", "1301WleyT98MSxVHPZCA6M"]
A maximum of 50 items can be specified in one request. Note: if theidsparameter is present in the query string, any IDs listed here in the body will be ignored.- Returns:
- A
RemoveUsersSavedTracksRequest.Builder. - See Also:
-
saveTracksForCurrentUser
Deprecated.This endpoint has been deprecated by Spotify.Save one or more tracks to the current user's 'Your Music' library. Note: This endpoint is deprecated. Use Save Items to Library instead.- Returns:
- A
SaveTracksForCurrentUserRequest.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. Note: This endpoint is deprecated. Use Check User's Saved Items instead.- Parameters:
type- The ID type: eitherartistoruser.ids- A comma-separated list of the artist or the user Spotify IDs to check. For example:ids=74ASZWbe4lXaubB36ztrGX,08td7MxkoHQkXnWAYD8d6Q. A maximum of 50 IDs can be sent in one request.- Returns:
- A
CheckCurrentUserFollowsArtistsOrUsersRequest.Builder. - See Also:
-
checkIfUserFollowsPlaylist
@Deprecated public CheckIfUserFollowsPlaylistRequest.Builder checkIfUserFollowsPlaylist(String playlist_id) Deprecated.This endpoint has been deprecated by Spotify.Check to see if the current user is following a specified playlist. Note: This endpoint is deprecated. Use Check User's Saved Items instead.- Parameters:
playlist_id- The Spotify ID of the playlist.- Returns:
- A
CheckIfUserFollowsPlaylistRequest.Builder. - See Also:
-
followArtistsOrUsers
@Deprecated public FollowArtistsOrUsersRequest.Builder followArtistsOrUsers(ModelObjectType type, List<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. Note: This endpoint is deprecated. Use Save Items to Library instead.- Parameters:
type- The ID type.ids- A JSON array of the artist or user Spotify IDs. For example:{ids:["74ASZWbe4lXaubB36ztrGX", "08td7MxkoHQkXnWAYD8d6Q"]}. A maximum of 50 IDs can be sent in one request. Note: if theidsparameter is present in the query string, any IDs listed here in the body will be ignored.- Returns:
- A
FollowArtistsOrUsersRequest.Builder. - See Also:
-
followPlaylist
Deprecated.This endpoint has been deprecated by Spotify.Add the current user as a follower of a playlist. Note: This endpoint is deprecated. Use Save Items to Library instead.- Parameters:
playlist_id- The Spotify ID of the playlist.- Returns:
- A
FollowPlaylistRequest.Builder. - See Also:
-
getCurrentUsersProfile
Get detailed profile information about the current user (including the current user's username).- Returns:
- A
GetCurrentUsersProfileRequest.Builder. - See Also:
-
getFollowedArtists
Get the current user's followed artists.- Parameters:
type- The ID type: currently onlyartistis supported.- Returns:
- A
GetFollowedArtistsRequest.Builder. - See Also:
-
getUsersProfile
Deprecated.This endpoint has been deprecated by Spotify.Get public profile information about a Spotify user.- Parameters:
user_id- The user's Spotify user ID.- Returns:
- A
GetUsersProfileRequest.Builder. - See Also:
-
unfollowArtistsOrUsers
@Deprecated public UnfollowArtistsOrUsersRequest.Builder unfollowArtistsOrUsers(ModelObjectType type, List<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. Note: This endpoint is deprecated. Use Remove Items from Library instead.- Parameters:
type- The ID type: eitherartistoruser.ids- A JSON array of the artist or user Spotify IDs. For example:{ids:["74ASZWbe4lXaubB36ztrGX", "08td7MxkoHQkXnWAYD8d6Q"]}. A maximum of 50 IDs can be sent in one request. Note: if theidsparameter is present in the query string, any IDs listed here in the body will be ignored.- 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. Note: This endpoint is deprecated. Use Remove Items from Library instead.- Parameters:
playlist_id- The Spotify ID of the playlist.- Returns:
- A
UnfollowPlaylistRequest.Builder. - See Also:
-
getUsersTopArtists
Get the current user's top artists or tracks based on calculated affinity.- Returns:
- A
GetUsersTopArtistsRequest.Builder. - See Also:
-
getUsersTopTracks
Get the current user's top artists or tracks based on calculated affinity.- Returns:
- A
GetUsersTopTracksRequest.Builder. - See Also:
-
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.
-
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:
-