Class SpotifyApi
- java.lang.Object
-
- com.wrapper.spotify.SpotifyApi
-
public class SpotifyApi extends Object
Instances of the SpotifyApi class provide access to the Spotify Web API.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSpotifyApi.BuilderBuilder class for buildingSpotifyApiinstances.
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_AUTHENTICATION_HOSTThe default authentication host of Spotify API calls.static intDEFAULT_AUTHENTICATION_PORTThe default authentication port of Spotify API calls.static StringDEFAULT_AUTHENTICATION_SCHEMEThe default authentication http scheme of Spotify API calls.static StringDEFAULT_HOSTThe default host of Spotify API calls.static IHttpManagerDEFAULT_HTTP_MANAGERA HttpManager configured with default settings.static intDEFAULT_PORTThe default port of Spotify API calls.static StringDEFAULT_SCHEMEThe default http scheme of Spotify API calls.static LoggerLOGGER
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description AddTracksToPlaylistRequest.BuilderaddTracksToPlaylist(String playlist_id, com.google.gson.JsonArray uris)Add tracks to a playlist.AddTracksToPlaylistRequest.BuilderaddTracksToPlaylist(String playlist_id, String[] uris)Add tracks to a playlist.AddTracksToPlaylistRequest.BuilderaddTracksToPlaylist(String user_id, String playlist_id, com.google.gson.JsonArray uris)Deprecated.Playlist IDs are unique for themselves. This parameter is thus no longer used. (https://developer.spotify.com/community/news/2018/06/12/changes-to-playlist-uris/)AddTracksToPlaylistRequest.BuilderaddTracksToPlaylist(String user_id, String playlist_id, String[] uris)Deprecated.Playlist IDs are unique for themselves. This parameter is thus no longer used. (https://developer.spotify.com/community/news/2018/06/12/changes-to-playlist-uris/)AuthorizationCodeRequest.BuilderauthorizationCode(String code)Returns a builder that can be used to build requests for authorization code grants.AuthorizationCodeRequest.BuilderauthorizationCode(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.AuthorizationCodeRefreshRequest.BuilderauthorizationCodeRefresh()Refresh the access token by using authorization code grant.AuthorizationCodeRefreshRequest.BuilderauthorizationCodeRefresh(String client_id, String client_secret, String refresh_token)Refresh the access token by using authorization code grant.AuthorizationCodeUriRequest.BuilderauthorizationCodeUri()Retrieve an URL where the user can give the application permissions.AuthorizationCodeUriRequest.BuilderauthorizationCodeUri(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.ChangePlaylistsDetailsRequest.BuilderchangePlaylistsDetails(String playlist_id)Update a playlists properties.ChangePlaylistsDetailsRequest.BuilderchangePlaylistsDetails(String user_id, String playlist_id)Deprecated.Playlist IDs are unique for themselves. This parameter is thus no longer used. (https://developer.spotify.com/community/news/2018/06/12/changes-to-playlist-uris/)CheckCurrentUserFollowsArtistsOrUsersRequest.BuildercheckCurrentUserFollowsArtistsOrUsers(ModelObjectType type, String[] ids)Check to see if the current user is following one or more artists or other Spotify users.CheckUsersFollowPlaylistRequest.BuildercheckUsersFollowPlaylist(String owner_id, String playlist_id, String[] ids)Check to see if one or more Spotify users are following a specified playlist.CheckUsersSavedAlbumsRequest.BuildercheckUsersSavedAlbums(String... ids)Check if a track is saved in the users "Your Music" library.CheckUsersSavedTracksRequest.BuildercheckUsersSavedTracks(String... ids)Check if a track is saved in the users "Your Music" library.ClientCredentialsRequest.BuilderclientCredentials()Returns a builder that can be used to build requests for client credential grants.static Stringconcat(String[] parts, char character)String concatenation helper method.CreatePlaylistRequest.BuildercreatePlaylist(String user_id, String name)Create a playlist.FollowArtistsOrUsersRequest.BuilderfollowArtistsOrUsers(ModelObjectType type, com.google.gson.JsonArray ids)Add the current user as a follower of one or more artists or other Spotify users.FollowArtistsOrUsersRequest.BuilderfollowArtistsOrUsers(ModelObjectType type, String[] ids)Add the current user as a follower of one or more artists or other Spotify users.FollowPlaylistRequest.BuilderfollowPlaylist(String owner_id, String playlist_id, boolean public_)Add the current user as a follower of a playlist.static StringformatDefaultDate(Date date)Formats a date, using the default spotify format.StringgetAccessToken()Get the access token specified in the API object, which is used for API calls.GetAlbumRequest.BuildergetAlbum(String id)Returns an album with the ID given below.GetAlbumsTracksRequest.BuildergetAlbumsTracks(String id)Returns the tracks of the album with the ID given below.GetArtistRequest.BuildergetArtist(String id)Get an artist.GetArtistsAlbumsRequest.BuildergetArtistsAlbums(String id)Get the albums of a specific artist.GetArtistsRelatedArtistsRequest.BuildergetArtistsRelatedArtists(String id)Get artists related/similar to an artist.GetArtistsTopTracksRequest.BuildergetArtistsTopTracks(String id, com.neovisionaries.i18n.CountryCode country)Get the top tracks of an artist in a specific country.GetAudioAnalysisForTrackRequest.BuildergetAudioAnalysisForTrack(String id)Get a detailed audio analysis for a single track identified by its unique Spotify ID.GetAudioFeaturesForSeveralTracksRequest.BuildergetAudioFeaturesForSeveralTracks(String... ids)Get audio features for multiple tracks based on their Spotify IDs.GetAudioFeaturesForTrackRequest.BuildergetAudioFeaturesForTrack(String id)Get audio features for a track based on its Spotify ID.GetAvailableGenreSeedsRequest.BuildergetAvailableGenreSeeds()Retrieve a list of available genres seed parameter values for recommendations.GetCategoryRequest.BuildergetCategory(String category_id)Get a category.GetCategorysPlaylistsRequest.BuildergetCategorysPlaylists(String category_id)Get the playlists from a specific category.StringgetClientId()Get the application client ID specified in this API object.StringgetClientSecret()Get the application client secret specified in this API object.GetCurrentUsersProfileRequest.BuildergetCurrentUsersProfile()Get detailed profile information about the current user (including the current user’s username).GetCurrentUsersRecentlyPlayedTracksRequest.BuildergetCurrentUsersRecentlyPlayedTracks()Get tracks from the current users recently played tracks.GetCurrentUsersSavedAlbumsRequest.BuildergetCurrentUsersSavedAlbums()Get a list of the albums saved in the current Spotify user’s "Your Music" library.StringgetHost()Get the API host used for API calls.IHttpManagergetHttpManager()Get theIHttpManagerused for API calls.GetInformationAboutUsersCurrentPlaybackRequest.BuildergetInformationAboutUsersCurrentPlayback()Get information about the users current playback state, including track, track progress, and active device.GetListOfCategoriesRequest.BuildergetListOfCategories()Get a list of categories.GetListOfCurrentUsersPlaylistsRequest.BuildergetListOfCurrentUsersPlaylists()Get a list of the playlists owned or followed by the current Spotify user.GetListOfFeaturedPlaylistsRequest.BuildergetListOfFeaturedPlaylists()Get "Featured Playlists" of different countries which may match a specific language.GetListOfNewReleasesRequest.BuildergetListOfNewReleases()Get the newest releases from a specific country.GetListOfUsersPlaylistsRequest.BuildergetListOfUsersPlaylists(String user_id)Get an users playlists.GetPlaylistRequest.BuildergetPlaylist(String playlist_id)Get a playlist.GetPlaylistRequest.BuildergetPlaylist(String user_id, String playlist_id)Deprecated.Playlist IDs are unique for themselves. This parameter is thus no longer used. (https://developer.spotify.com/community/news/2018/06/12/changes-to-playlist-uris/)GetPlaylistCoverImageRequest.BuildergetPlaylistCoverImage(String playlist_id)Get the image used to represent a specific playlist.GetPlaylistCoverImageRequest.BuildergetPlaylistCoverImage(String user_id, String playlist_id)Deprecated.Playlist IDs are unique for themselves. This parameter is thus no longer used. (https://developer.spotify.com/community/news/2018/06/12/changes-to-playlist-uris/)GetPlaylistsTracksRequest.BuildergetPlaylistsTracks(String playlist_id)Get a playlists tracks.GetPlaylistsTracksRequest.BuildergetPlaylistsTracks(String user_id, String playlist_id)Deprecated.Playlist IDs are unique for themselves. This parameter is thus no longer used. (https://developer.spotify.com/community/news/2018/06/12/changes-to-playlist-uris/)IntegergetPort()Get the port used for API calls.IntegergetProxyPassword()Get the proxy password used for API calls.IntegergetProxyPort()Get the proxy port used for API calls.StringgetProxyUrl()Get the proxy URL used for API calls.IntegergetProxyUsername()Get the proxy username used for API calls.GetRecommendationsRequest.BuildergetRecommendations()Create a playlist-style listening experience based on seed artists, tracks and genres.URIgetRedirectURI()Get the redirect URI of the application specified in this API object.StringgetRefreshToken()Get the refresh token specified in the API object.StringgetScheme()Get the scheme used for API calls.GetSeveralAlbumsRequest.BuildergetSeveralAlbums(String... ids)Get multiple albums.GetSeveralArtistsRequest.BuildergetSeveralArtists(String... ids)Get multiple artists.GetSeveralTracksRequest.BuildergetSeveralTracks(String... ids)Get multiple tracks.GetTrackRequest.BuildergetTrack(String id)Get a track.GetUsersAvailableDevicesRequest.BuildergetUsersAvailableDevices()Get information about an users available devices.GetUsersCurrentlyPlayingTrackRequest.BuildergetUsersCurrentlyPlayingTrack()Get the object currently being played on the users Spotify account.GetUsersFollowedArtistsRequest.BuildergetUsersFollowedArtists(ModelObjectType type)Get the current user’s followed artists.GetUsersProfileRequest.BuildergetUsersProfile(String user_id)Get public profile information about a Spotify user.GetUsersSavedTracksRequest.BuildergetUsersSavedTracks()Get an users "Your Music" tracks.GetUsersTopArtistsRequest.BuildergetUsersTopArtists()Get the current users top artists based on calculated affinity.<T extends IArtistTrackModelObject>
GetUsersTopArtistsAndTracksRequest.Builder<T>getUsersTopArtistsAndTracks(ModelObjectType type)Get the current users top artists or tracks based on calculated affinity.GetUsersTopTracksRequest.BuildergetUsersTopTracks()Get the current users top tracks based on calculated affinity.static SimpleDateFormatmakeSimpleDateFormat(String pattern, String id)static DateparseDefaultDate(String date)Parses a date in the default spotify format.PauseUsersPlaybackRequest.BuilderpauseUsersPlayback()Pause playback on the users account.RemoveAlbumsForCurrentUserRequest.BuilderremoveAlbumsForCurrentUser(String... ids)Remove one or more albums from the current users "Your Music" library.RemoveTracksFromPlaylistRequest.BuilderremoveTracksFromPlaylist(String playlist_id, com.google.gson.JsonArray tracks)Delete tracks from a playlistRemoveTracksFromPlaylistRequest.BuilderremoveTracksFromPlaylist(String user_id, String playlist_id, com.google.gson.JsonArray tracks)Deprecated.Playlist IDs are unique for themselves. This parameter is thus no longer used. (https://developer.spotify.com/community/news/2018/06/12/changes-to-playlist-uris/)RemoveUsersSavedTracksRequest.BuilderremoveUsersSavedTracks(String... ids)Remove a track if saved to the users "Your Music" library.ReorderPlaylistsTracksRequest.BuilderreorderPlaylistsTracks(String playlist_id, int range_start, int insert_before)Reorder a track or a group of tracks in a playlist.ReorderPlaylistsTracksRequest.BuilderreorderPlaylistsTracks(String user_id, String playlist_id, int range_start, int insert_before)Deprecated.Playlist IDs are unique for themselves. This parameter is thus no longer used. (https://developer.spotify.com/community/news/2018/06/12/changes-to-playlist-uris/)ReplacePlaylistsTracksRequest.BuilderreplacePlaylistsTracks(String playlist_id, com.google.gson.JsonArray uris)Replace tracks in a playlist.ReplacePlaylistsTracksRequest.BuilderreplacePlaylistsTracks(String playlist_id, String[] uris)Replace tracks in a playlist.ReplacePlaylistsTracksRequest.BuilderreplacePlaylistsTracks(String user_id, String playlist_id, com.google.gson.JsonArray uris)Deprecated.Playlist IDs are unique for themselves. This parameter is thus no longer used. (https://developer.spotify.com/community/news/2018/06/12/changes-to-playlist-uris/)ReplacePlaylistsTracksRequest.BuilderreplacePlaylistsTracks(String user_id, String playlist_id, String[] uris)Deprecated.Playlist IDs are unique for themselves. This parameter is thus no longer used. (https://developer.spotify.com/community/news/2018/06/12/changes-to-playlist-uris/)SaveAlbumsForCurrentUserRequest.BuildersaveAlbumsForCurrentUser(com.google.gson.JsonArray ids)Save albums in the users "Your Music" library.SaveAlbumsForCurrentUserRequest.BuildersaveAlbumsForCurrentUser(String... ids)Save albums in the users "Your Music" library.SaveTracksForUserRequest.BuildersaveTracksForUser(com.google.gson.JsonArray ids)Save tracks in the users "Your Music" library.SaveTracksForUserRequest.BuildersaveTracksForUser(String... ids)Save tracks in the users "Your Music" library.SearchAlbumsRequest.BuildersearchAlbums(String q)Get Spotify catalog information about albums that match a keyword string.SearchArtistsRequest.BuildersearchArtists(String q)Get Spotify catalog information about artists that match a keyword string.SearchItemRequest.BuildersearchItem(String q, String type)Get Spotify catalog information about artists, albums, tracks or playlists that match a keyword string.SearchPlaylistsRequest.BuildersearchPlaylists(String q)Get Spotify catalog information about playlists that match a keyword string.SearchTracksRequest.BuildersearchTracks(String q)Get Spotify catalog information about tracks that match a keyword string.SeekToPositionInCurrentlyPlayingTrackRequest.BuilderseekToPositionInCurrentlyPlayingTrack(int position_ms)Seeks to the given position in the users currently playing track.voidsetAccessToken(String accessToken)Set the access token of the API object.voidsetRefreshToken(String refreshToken)Set the refresh token of the API object.SetRepeatModeOnUsersPlaybackRequest.BuildersetRepeatModeOnUsersPlayback(String state)Set the repeat mode for the users playback.SetVolumeForUsersPlaybackRequest.BuildersetVolumeForUsersPlayback(int volume_percent)Set the volume for the users current playback device.SkipUsersPlaybackToNextTrackRequest.BuilderskipUsersPlaybackToNextTrack()Skips to next track in the users queue.SkipUsersPlaybackToPreviousTrackRequest.BuilderskipUsersPlaybackToPreviousTrack()Skips to previous track in the users queue.StartResumeUsersPlaybackRequest.BuilderstartResumeUsersPlayback()Start a new context or resume current playback on the users active device.ToggleShuffleForUsersPlaybackRequest.BuildertoggleShuffleForUsersPlayback(boolean state)Toggle shuffle on or off for users playback.TransferUsersPlaybackRequest.BuildertransferUsersPlayback(com.google.gson.JsonArray device_ids)Transfer playback to a new device and determine if it should start playing.UnfollowArtistsOrUsersRequest.BuilderunfollowArtistsOrUsers(ModelObjectType type, String[] ids)Remove the current user as a follower of one or more artists or other Spotify users.UnfollowPlaylistRequest.BuilderunfollowPlaylist(String owner_id, String playlist_id)Remove the current user as a follower of a playlist.UploadCustomPlaylistCoverImageRequest.BuilderuploadCustomPlaylistCoverImage(String playlist_id)Replace the image used to represent a specific playlist.UploadCustomPlaylistCoverImageRequest.BuilderuploadCustomPlaylistCoverImage(String user_id, String playlist_id)Deprecated.Playlist IDs are unique for themselves. This parameter is thus no longer used. (https://developer.spotify.com/community/news/2018/06/12/changes-to-playlist-uris/)
-
-
-
Field Detail
-
DEFAULT_AUTHENTICATION_HOST
public static final String DEFAULT_AUTHENTICATION_HOST
The default authentication host of Spotify API calls.- See Also:
- Constant Field Values
-
DEFAULT_AUTHENTICATION_PORT
public static final int DEFAULT_AUTHENTICATION_PORT
The default authentication port of Spotify API calls.- See Also:
- Constant Field Values
-
DEFAULT_AUTHENTICATION_SCHEME
public static final String DEFAULT_AUTHENTICATION_SCHEME
The default authentication http scheme of Spotify API calls.- See Also:
- Constant Field Values
-
DEFAULT_HOST
public static final String DEFAULT_HOST
The default host of Spotify API calls.- See Also:
- Constant Field Values
-
DEFAULT_HTTP_MANAGER
public static final IHttpManager DEFAULT_HTTP_MANAGER
A HttpManager configured with default settings.
-
DEFAULT_PORT
public static final int DEFAULT_PORT
The default port of Spotify API calls.- See Also:
- Constant Field Values
-
DEFAULT_SCHEME
public static final String DEFAULT_SCHEME
The default http scheme of Spotify API calls.- See Also:
- Constant Field Values
-
LOGGER
public static final Logger LOGGER
-
-
Method Detail
-
builder
public static SpotifyApi.Builder builder()
Create a builder for building a new Spotify API instance.- Returns:
- A
SpotifyApi.Builder.
-
concat
public static String concat(String[] parts, char character)
String concatenation helper method.- Parameters:
parts- String parts.character- Separation character.- Returns:
- A string.
-
parseDefaultDate
public static Date parseDefaultDate(String date) throws ParseException
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
public static String formatDefaultDate(Date date)
Formats a date, using the default spotify format.- Parameters:
date- the date to format- Returns:
- the formatted date
-
makeSimpleDateFormat
public static SimpleDateFormat makeSimpleDateFormat(String pattern, String id)
-
getHttpManager
public IHttpManager getHttpManager()
Get theIHttpManagerused for API calls.- Returns:
- An
IHttpManager.
-
getScheme
public String getScheme()
Get the scheme used for API calls. Default:https- Returns:
- A scheme.
-
getHost
public String getHost()
Get the API host used for API calls. Default:"api.spotify.com"- Returns:
- The host address.
-
getPort
public Integer getPort()
Get the port used for API calls. Default:443- Returns:
- A port.
-
getProxyUrl
public String getProxyUrl()
Get the proxy URL used for API calls.- Returns:
- The proxy URL.
-
getProxyPort
public Integer getProxyPort()
Get the proxy port used for API calls.- Returns:
- The proxy port.
-
getProxyUsername
public Integer getProxyUsername()
Get the proxy username used for API calls.- Returns:
- The proxy username.
-
getProxyPassword
public Integer getProxyPassword()
Get the proxy password used for API calls.- Returns:
- The proxy password.
-
getClientId
public String getClientId()
Get the application client ID specified in this API object.- Returns:
- Application client ID.
-
getClientSecret
public String getClientSecret()
Get the application client secret specified in this API object.- Returns:
- Application client secret.
-
getRedirectURI
public URI getRedirectURI()
Get the redirect URI of the application specified in this API object.- Returns:
- Application redirect URI.
-
getAccessToken
public String getAccessToken()
Get the access token specified in the API object, which is used for API calls.- Returns:
- A Spotify Web API access token.
-
setAccessToken
public void setAccessToken(String accessToken)
Set the access token of the API object.- Parameters:
accessToken- A Spotify Web API access token.
-
getRefreshToken
public String getRefreshToken()
Get the refresh token specified in the API object.- Returns:
- A Spotify Web API refresh token.
-
setRefreshToken
public void setRefreshToken(String refreshToken)
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
public AuthorizationCodeRefreshRequest.Builder authorizationCodeRefresh()
Refresh the access token by using authorization code grant.- Returns:
- An
AuthorizationCodeRequest.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, 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
public AuthorizationCodeRequest.Builder authorizationCode(String code)
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.
-
authorizationCodeUri
public AuthorizationCodeUriRequest.Builder authorizationCodeUri(String client_id, URI redirect_uri)
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
public AuthorizationCodeUriRequest.Builder authorizationCodeUri()
Retrieve an URL where the user can give the application permissions.- Returns:
- An
AuthorizationCodeUriRequest.Builder.
-
clientCredentials
public ClientCredentialsRequest.Builder 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
public GetAlbumRequest.Builder getAlbum(String id)
Returns an album with the ID given below.- Parameters:
id- The Spotify album ID of the album you're trying to retrieve.- Returns:
- A
GetAlbumRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
getAlbumsTracks
public GetAlbumsTracksRequest.Builder getAlbumsTracks(String id)
Returns the tracks of the album with the ID given below.- Parameters:
id- The Spotify ID of the album you're trying to retrieve.- Returns:
- A
GetAlbumsTracksRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
getSeveralAlbums
public GetSeveralAlbumsRequest.Builder getSeveralAlbums(String... ids)
Get multiple albums.- Parameters:
ids- The Spotify IDs of all albums you're trying to retrieve. Maximum: 20 IDs.- Returns:
- A
GetSeveralAlbumsRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
getArtist
public GetArtistRequest.Builder getArtist(String id)
Get an artist.- Parameters:
id- The Spotify ID of the artist.- Returns:
- A
GetArtistRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
getArtistsAlbums
public GetArtistsAlbumsRequest.Builder getArtistsAlbums(String id)
Get the albums of a specific artist.- Parameters:
id- The Spotify ID of the artist.- Returns:
- A
GetArtistsAlbumsRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
getArtistsTopTracks
public GetArtistsTopTracksRequest.Builder getArtistsTopTracks(String id, com.neovisionaries.i18n.CountryCode country)
Get the top tracks of an artist in a specific country.- Parameters:
id- The Spotify ID of the artist.country- The ISO 3166-1 alpha-2 country code of the specific country.- Returns:
- A
GetArtistsTopTracksRequest.Builder. - See Also:
- Spotify: URLs & IDs, Wikipedia: ISO 3166-1 alpha-2 country codes
-
getArtistsRelatedArtists
public GetArtistsRelatedArtistsRequest.Builder getArtistsRelatedArtists(String id)
Get artists related/similar to an artist.- Parameters:
id- The Spotify ID of the artist.- Returns:
- A
GetArtistsRelatedArtistsRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
getSeveralArtists
public GetSeveralArtistsRequest.Builder getSeveralArtists(String... ids)
Get multiple artists.- Parameters:
ids- The Spotify IDs of all artists you're trying to retrieve. Maximum: 50 IDs.- Returns:
- A
GetSeveralArtistsRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
getCategory
public GetCategoryRequest.Builder getCategory(String category_id)
Get a category.- Parameters:
category_id- The Spotify category ID for the category.- Returns:
- A
GetCategoryRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
getCategorysPlaylists
public GetCategorysPlaylistsRequest.Builder getCategorysPlaylists(String category_id)
Get the playlists from a specific category.- Parameters:
category_id- The Spotify category ID for the category.- Returns:
- A
GetCategorysPlaylistsRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
getListOfCategories
public GetListOfCategoriesRequest.Builder getListOfCategories()
Get a list of categories.- Returns:
- A
GetListOfCategoriesRequest.Builder.
-
getListOfFeaturedPlaylists
public GetListOfFeaturedPlaylistsRequest.Builder getListOfFeaturedPlaylists()
Get "Featured Playlists" of different countries which may match a specific language.- Returns:
- A
GetListOfFeaturedPlaylistsRequest.Builder.
-
getListOfNewReleases
public GetListOfNewReleasesRequest.Builder getListOfNewReleases()
Get the newest releases from a specific country.- Returns:
- A
GetListOfNewReleasesRequest.Builder.
-
getRecommendations
public GetRecommendationsRequest.Builder getRecommendations()
Create a playlist-style listening experience based on seed artists, tracks and genres.- Returns:
- A
GetRecommendationsRequest.Builder.
-
getAvailableGenreSeeds
public GetAvailableGenreSeedsRequest.Builder getAvailableGenreSeeds()
Retrieve a list of available genres seed parameter values for recommendations.- Returns:
- A
GetAvailableGenreSeedsRequest.Builder.
-
checkCurrentUserFollowsArtistsOrUsers
public CheckCurrentUserFollowsArtistsOrUsersRequest.Builder checkCurrentUserFollowsArtistsOrUsers(ModelObjectType type, String[] ids)
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:
- Spotify: URLs & IDs
-
checkUsersFollowPlaylist
public CheckUsersFollowPlaylistRequest.Builder checkUsersFollowPlaylist(String owner_id, String playlist_id, String[] ids)
Check to see if one or more Spotify users are following a specified playlist.- Parameters:
owner_id- The Spotify User ID of the person who owns the playlist.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
CheckUsersFollowPlaylistRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
followArtistsOrUsers
public FollowArtistsOrUsersRequest.Builder followArtistsOrUsers(ModelObjectType type, String[] ids)
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:
- Spotify: URLs & IDs
-
followArtistsOrUsers
public FollowArtistsOrUsersRequest.Builder followArtistsOrUsers(ModelObjectType type, com.google.gson.JsonArray ids)
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:
- Spotify: URLs & IDs
-
followPlaylist
public FollowPlaylistRequest.Builder followPlaylist(String owner_id, String playlist_id, boolean public_)
Add the current user as a follower of a playlist.- Parameters:
owner_id- The Spotify user ID of the person who owns the playlist.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:
- Spotify: URLs & IDs
-
getUsersFollowedArtists
public GetUsersFollowedArtistsRequest.Builder getUsersFollowedArtists(ModelObjectType type)
Get the current user’s followed artists.- Parameters:
type- The ID type: currently only artist is supported.- Returns:
- A
GetUsersFollowedArtistsRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
unfollowArtistsOrUsers
public UnfollowArtistsOrUsersRequest.Builder unfollowArtistsOrUsers(ModelObjectType type, String[] ids)
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:
- Spotify: URLs & IDs
-
unfollowPlaylist
public UnfollowPlaylistRequest.Builder unfollowPlaylist(String owner_id, String playlist_id)
Remove the current user as a follower of a playlist.- Parameters:
owner_id- The owners username.playlist_id- The playlist's ID.- Returns:
- An
UnfollowPlaylistRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
checkUsersSavedAlbums
public CheckUsersSavedAlbumsRequest.Builder checkUsersSavedAlbums(String... ids)
Check if a track is saved in the users "Your Music" library.- Parameters:
ids- The tracks IDs to check for in the user's Your Music library. Maximum: 50 IDs.- Returns:
- A
CheckUsersSavedAlbumsRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
checkUsersSavedTracks
public CheckUsersSavedTracksRequest.Builder checkUsersSavedTracks(String... ids)
Check if a track is saved in the users "Your Music" library.- Parameters:
ids- The tracks IDs to check for in the user's Your Music library. Maximum: 50 IDs.- Returns:
- A builder object that can be used to check if an user has saved a track.
-
getCurrentUsersSavedAlbums
public GetCurrentUsersSavedAlbumsRequest.Builder getCurrentUsersSavedAlbums()
Get a list of the albums saved in the current Spotify user’s "Your Music" library.- Returns:
- A
GetCurrentUsersSavedAlbumsRequest.Builder.
-
getUsersSavedTracks
public GetUsersSavedTracksRequest.Builder getUsersSavedTracks()
Get an users "Your Music" tracks.- Returns:
- A
GetUsersSavedTracksRequest.Builder.
-
removeAlbumsForCurrentUser
public RemoveAlbumsForCurrentUserRequest.Builder removeAlbumsForCurrentUser(String... ids)
Remove one or more albums from the current users "Your Music" library.- Parameters:
ids- A list of the Spotify IDs. Maximum: 50 IDs.- Returns:
- A
RemoveAlbumsForCurrentUserRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
removeUsersSavedTracks
public RemoveUsersSavedTracksRequest.Builder removeUsersSavedTracks(String... ids)
Remove a track if saved to the users "Your Music" library.- Parameters:
ids- The track IDs to remove from the users Your Music library. Maximum: 50 IDs.- Returns:
- A
RemoveUsersSavedTracksRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
saveAlbumsForCurrentUser
public SaveAlbumsForCurrentUserRequest.Builder saveAlbumsForCurrentUser(String... ids)
Save albums in the users "Your Music" library.- Parameters:
ids- The album IDs to add to the users library. Maximum: 50 IDs.- Returns:
- A
SaveAlbumsForCurrentUserRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
saveAlbumsForCurrentUser
public SaveAlbumsForCurrentUserRequest.Builder saveAlbumsForCurrentUser(com.google.gson.JsonArray ids)
Save albums in the users "Your Music" library.- Parameters:
ids- The album IDs to add to the users library. Maximum: 50 IDs.- Returns:
- A
SaveAlbumsForCurrentUserRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
saveTracksForUser
public SaveTracksForUserRequest.Builder saveTracksForUser(String... ids)
Save tracks in the users "Your Music" library.- Parameters:
ids- The track IDs to add to the users library. Maximum: 50 IDs.- Returns:
- A
SaveTracksForUserRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
saveTracksForUser
public SaveTracksForUserRequest.Builder saveTracksForUser(com.google.gson.JsonArray ids)
Save tracks in the users "Your Music" library.- Parameters:
ids- The track IDs to add to the users library. Maximum: 50 IDs.- Returns:
- A
SaveTracksForUserRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
getUsersTopArtistsAndTracks
public <T extends IArtistTrackModelObject> GetUsersTopArtistsAndTracksRequest.Builder<T> getUsersTopArtistsAndTracks(ModelObjectType type)
Get the current users 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
public GetUsersTopArtistsRequest.Builder getUsersTopArtists()
Get the current users top artists based on calculated affinity.- Returns:
- A
GetUsersTopArtistsRequest.Builder. - See Also:
getUsersTopArtistsAndTracks(ModelObjectType)
-
getUsersTopTracks
public GetUsersTopTracksRequest.Builder getUsersTopTracks()
Get the current users top tracks based on calculated affinity.- Returns:
- A
GetUsersTopTracksRequest.Builder. - See Also:
getUsersTopArtistsAndTracks(ModelObjectType)
-
getInformationAboutUsersCurrentPlayback
public GetInformationAboutUsersCurrentPlaybackRequest.Builder getInformationAboutUsersCurrentPlayback()
Get information about the users current playback state, including track, track progress, and active device.
-
getCurrentUsersRecentlyPlayedTracks
public GetCurrentUsersRecentlyPlayedTracksRequest.Builder getCurrentUsersRecentlyPlayedTracks()
Get tracks from the current users 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.
-
getUsersAvailableDevices
public GetUsersAvailableDevicesRequest.Builder getUsersAvailableDevices()
Get information about an users available devices.- Returns:
- A
GetUsersAvailableDevicesRequest.Builder.
-
getUsersCurrentlyPlayingTrack
public GetUsersCurrentlyPlayingTrackRequest.Builder getUsersCurrentlyPlayingTrack()
Get the object currently being played on the users Spotify account.- Returns:
- A
GetUsersCurrentlyPlayingTrackRequest.Builder.
-
pauseUsersPlayback
public PauseUsersPlaybackRequest.Builder pauseUsersPlayback()
Pause playback on the users account.- Returns:
- A
PauseUsersPlaybackRequest.Builder.
-
seekToPositionInCurrentlyPlayingTrack
public SeekToPositionInCurrentlyPlayingTrackRequest.Builder seekToPositionInCurrentlyPlayingTrack(int position_ms)
Seeks to the given position in the users 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
SeekToPositionInCurrentlyPlayingTrackRequest.Builder.
-
setRepeatModeOnUsersPlayback
public SetRepeatModeOnUsersPlaybackRequest.Builder setRepeatModeOnUsersPlayback(String state)
Set the repeat mode for the users 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
SetRepeatModeOnUsersPlaybackRequest.Builder.
-
setVolumeForUsersPlayback
public SetVolumeForUsersPlaybackRequest.Builder setVolumeForUsersPlayback(int volume_percent)
Set the volume for the users current playback device.- Parameters:
volume_percent- Integer. The volume to set. Must be a value from 0 to 100 inclusive.- Returns:
- A
SetVolumeForUsersPlaybackRequest.Builder.
-
skipUsersPlaybackToNextTrack
public SkipUsersPlaybackToNextTrackRequest.Builder skipUsersPlaybackToNextTrack()
Skips to next track in the users queue.- Returns:
- A
SkipUsersPlaybackToNextTrackRequest.Builder.
-
skipUsersPlaybackToPreviousTrack
public SkipUsersPlaybackToPreviousTrackRequest.Builder skipUsersPlaybackToPreviousTrack()
Skips to previous track in the users 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
seekToPositionInCurrentlyPlayingTrack(int)method.- Returns:
- A
SkipUsersPlaybackToPreviousTrackRequest.Builder.
-
startResumeUsersPlayback
public StartResumeUsersPlaybackRequest.Builder startResumeUsersPlayback()
Start a new context or resume current playback on the users active device.- Returns:
- A
StartResumeUsersPlaybackRequest.Builder.
-
toggleShuffleForUsersPlayback
public ToggleShuffleForUsersPlaybackRequest.Builder toggleShuffleForUsersPlayback(boolean state)
Toggle shuffle on or off for users playback.- Parameters:
state- true: Shuffle user's playback. false: Do not shuffle user's playback.- Returns:
- A
ToggleShuffleForUsersPlaybackRequest.Builder.
-
transferUsersPlayback
public TransferUsersPlaybackRequest.Builder transferUsersPlayback(com.google.gson.JsonArray device_ids)
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
TransferUsersPlaybackRequest.Builder.
-
addTracksToPlaylist
@Deprecated public AddTracksToPlaylistRequest.Builder addTracksToPlaylist(String user_id, String playlist_id, String[] uris)
Deprecated. Playlist IDs are unique for themselves. This parameter is thus no longer used. (https://developer.spotify.com/community/news/2018/06/12/changes-to-playlist-uris/)Add tracks to a playlist.- Parameters:
user_id- The owners username.playlist_id- The playlists ID.uris- URIs of the tracks to add. Maximum: 100 track URIs.- Returns:
- An
AddTracksToPlaylistRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
addTracksToPlaylist
public AddTracksToPlaylistRequest.Builder addTracksToPlaylist(String playlist_id, String[] uris)
Add tracks to a playlist.- Parameters:
playlist_id- The playlists ID.uris- URIs of the tracks to add. Maximum: 100 track URIs.- Returns:
- An
AddTracksToPlaylistRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
addTracksToPlaylist
@Deprecated public AddTracksToPlaylistRequest.Builder addTracksToPlaylist(String user_id, String playlist_id, com.google.gson.JsonArray uris)
Deprecated. Playlist IDs are unique for themselves. This parameter is thus no longer used. (https://developer.spotify.com/community/news/2018/06/12/changes-to-playlist-uris/)Add tracks to a playlist.- Parameters:
user_id- The owners username.playlist_id- The playlists ID.uris- URIs of the tracks to add. Maximum: 100 track URIs.- Returns:
- An
AddTracksToPlaylistRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
addTracksToPlaylist
public AddTracksToPlaylistRequest.Builder addTracksToPlaylist(String playlist_id, com.google.gson.JsonArray uris)
Add tracks to a playlist.- Parameters:
playlist_id- The playlists ID.uris- URIs of the tracks to add. Maximum: 100 track URIs.- Returns:
- An
AddTracksToPlaylistRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
changePlaylistsDetails
@Deprecated public ChangePlaylistsDetailsRequest.Builder changePlaylistsDetails(String user_id, String playlist_id)
Deprecated. Playlist IDs are unique for themselves. This parameter is thus no longer used. (https://developer.spotify.com/community/news/2018/06/12/changes-to-playlist-uris/)Update a playlists properties.- Parameters:
user_id- The owners username.playlist_id- The playlists ID.- Returns:
- A
ChangePlaylistsDetailsRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
changePlaylistsDetails
public ChangePlaylistsDetailsRequest.Builder changePlaylistsDetails(String playlist_id)
Update a playlists properties.- Parameters:
playlist_id- The playlists ID.- Returns:
- A
ChangePlaylistsDetailsRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
createPlaylist
public CreatePlaylistRequest.Builder createPlaylist(String user_id, String name)
Create a playlist.- Parameters:
user_id- The playlists owner.name- The name of the playlist.- Returns:
- A
CreatePlaylistRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
getListOfCurrentUsersPlaylists
public GetListOfCurrentUsersPlaylistsRequest.Builder getListOfCurrentUsersPlaylists()
Get a list of the playlists owned or followed by the current Spotify user.- Returns:
- A
GetListOfCurrentUsersPlaylistsRequest.Builder.
-
getListOfUsersPlaylists
public GetListOfUsersPlaylistsRequest.Builder getListOfUsersPlaylists(String user_id)
Get an users playlists.- Parameters:
user_id- A Spotify ID of the user.- Returns:
- A
GetListOfUsersPlaylistsRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
getPlaylist
@Deprecated public GetPlaylistRequest.Builder getPlaylist(String user_id, String playlist_id)
Deprecated. Playlist IDs are unique for themselves. This parameter is thus no longer used. (https://developer.spotify.com/community/news/2018/06/12/changes-to-playlist-uris/)Get a playlist.- Parameters:
user_id- The playlists owners username.playlist_id- The playlists ID.- Returns:
- A
GetPlaylistRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
getPlaylist
public GetPlaylistRequest.Builder getPlaylist(String playlist_id)
Get a playlist.- Parameters:
playlist_id- The playlists ID.- Returns:
- A
GetPlaylistRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
getPlaylistCoverImage
@Deprecated public GetPlaylistCoverImageRequest.Builder getPlaylistCoverImage(String user_id, String playlist_id)
Deprecated. Playlist IDs are unique for themselves. This parameter is thus no longer used. (https://developer.spotify.com/community/news/2018/06/12/changes-to-playlist-uris/)Get the image used to represent a specific playlist.- Parameters:
user_id- The users Spotify user ID.playlist_id- The Spotify ID for the playlist.- Returns:
- A
GetPlaylistCoverImageRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
getPlaylistCoverImage
public GetPlaylistCoverImageRequest.Builder getPlaylistCoverImage(String playlist_id)
Get the image used to represent a specific playlist.- Parameters:
playlist_id- The Spotify ID for the playlist.- Returns:
- A
GetPlaylistCoverImageRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
getPlaylistsTracks
@Deprecated public GetPlaylistsTracksRequest.Builder getPlaylistsTracks(String user_id, String playlist_id)
Deprecated. Playlist IDs are unique for themselves. This parameter is thus no longer used. (https://developer.spotify.com/community/news/2018/06/12/changes-to-playlist-uris/)Get a playlists tracks.- Parameters:
user_id- The playlists owners username.playlist_id- The playlists ID.- Returns:
- A
GetPlaylistsTracksRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
getPlaylistsTracks
public GetPlaylistsTracksRequest.Builder getPlaylistsTracks(String playlist_id)
Get a playlists tracks.- Parameters:
playlist_id- The playlists ID.- Returns:
- A
GetPlaylistsTracksRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
removeTracksFromPlaylist
@Deprecated public RemoveTracksFromPlaylistRequest.Builder removeTracksFromPlaylist(String user_id, String playlist_id, com.google.gson.JsonArray tracks)
Deprecated. Playlist IDs are unique for themselves. This parameter is thus no longer used. (https://developer.spotify.com/community/news/2018/06/12/changes-to-playlist-uris/)Delete tracks from a playlist- Parameters:
user_id- The owners username.playlist_id- The playlists ID.tracks- URIs of the tracks to remove. Maximum: 100 track URIs.- Returns:
- A
RemoveTracksFromPlaylistRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
removeTracksFromPlaylist
public RemoveTracksFromPlaylistRequest.Builder removeTracksFromPlaylist(String playlist_id, com.google.gson.JsonArray tracks)
Delete tracks from a playlist- Parameters:
playlist_id- The playlists ID.tracks- URIs of the tracks to remove. Maximum: 100 track URIs.- Returns:
- A
RemoveTracksFromPlaylistRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
reorderPlaylistsTracks
@Deprecated public ReorderPlaylistsTracksRequest.Builder reorderPlaylistsTracks(String user_id, String playlist_id, int range_start, int insert_before)
Deprecated. Playlist IDs are unique for themselves. This parameter is thus no longer used. (https://developer.spotify.com/community/news/2018/06/12/changes-to-playlist-uris/)Reorder a track or a group of tracks in a playlist.
When reordering tracks, 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 tracks are reordered.
- Parameters:
user_id- The users Spotify user ID.playlist_id- The Spotify ID for the playlist.range_start- The position of the first track to be reordered.insert_before- The position where the tracks should be inserted. To reorder the tracks to the end of the playlist, simply set insert_before to the position after the last track.- Returns:
- A
ReorderPlaylistsTracksRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
reorderPlaylistsTracks
public ReorderPlaylistsTracksRequest.Builder reorderPlaylistsTracks(String playlist_id, int range_start, int insert_before)
Reorder a track or a group of tracks in a playlist.
When reordering tracks, 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 tracks are reordered.
- Parameters:
playlist_id- The Spotify ID for the playlist.range_start- The position of the first track to be reordered.insert_before- The position where the tracks should be inserted. To reorder the tracks to the end of the playlist, simply set insert_before to the position after the last track.- Returns:
- A
ReorderPlaylistsTracksRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
replacePlaylistsTracks
@Deprecated public ReplacePlaylistsTracksRequest.Builder replacePlaylistsTracks(String user_id, String playlist_id, String[] uris)
Deprecated. Playlist IDs are unique for themselves. This parameter is thus no longer used. (https://developer.spotify.com/community/news/2018/06/12/changes-to-playlist-uris/)Replace tracks in a playlist.- Parameters:
user_id- The owners username.playlist_id- The playlists ID.uris- URIs of the tracks to add. Maximum: 100 track URIs.- Returns:
- A
ReplacePlaylistsTracksRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
replacePlaylistsTracks
public ReplacePlaylistsTracksRequest.Builder replacePlaylistsTracks(String playlist_id, String[] uris)
Replace tracks in a playlist.- Parameters:
playlist_id- The playlists ID.uris- URIs of the tracks to add. Maximum: 100 track URIs.- Returns:
- A
ReplacePlaylistsTracksRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
replacePlaylistsTracks
@Deprecated public ReplacePlaylistsTracksRequest.Builder replacePlaylistsTracks(String user_id, String playlist_id, com.google.gson.JsonArray uris)
Deprecated. Playlist IDs are unique for themselves. This parameter is thus no longer used. (https://developer.spotify.com/community/news/2018/06/12/changes-to-playlist-uris/)Replace tracks in a playlist.- Parameters:
user_id- The owners username.playlist_id- The playlists ID.uris- URIs of the tracks to add. Maximum: 100 track URIs.- Returns:
- A
ReplacePlaylistsTracksRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
replacePlaylistsTracks
public ReplacePlaylistsTracksRequest.Builder replacePlaylistsTracks(String playlist_id, com.google.gson.JsonArray uris)
Replace tracks in a playlist.- Parameters:
playlist_id- The playlists ID.uris- URIs of the tracks to add. Maximum: 100 track URIs.- Returns:
- A
ReplacePlaylistsTracksRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
uploadCustomPlaylistCoverImage
@Deprecated public UploadCustomPlaylistCoverImageRequest.Builder uploadCustomPlaylistCoverImage(String user_id, String playlist_id)
Deprecated. Playlist IDs are unique for themselves. This parameter is thus no longer used. (https://developer.spotify.com/community/news/2018/06/12/changes-to-playlist-uris/)Replace the image used to represent a specific playlist.- Parameters:
user_id- The users Spotify user ID.playlist_id- The Spotify ID for the playlist.- Returns:
- An
UploadCustomPlaylistCoverImageRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
uploadCustomPlaylistCoverImage
public UploadCustomPlaylistCoverImageRequest.Builder uploadCustomPlaylistCoverImage(String playlist_id)
Replace the image used to represent a specific playlist.- Parameters:
playlist_id- The Spotify ID for the playlist.- Returns:
- An
UploadCustomPlaylistCoverImageRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
searchItem
public SearchItemRequest.Builder searchItem(String q, String type)
Get Spotify catalog information about artists, albums, 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, playlist, and track.- Returns:
- A
SearchItemRequest.Builder.
-
searchAlbums
public SearchAlbumsRequest.Builder searchAlbums(String q)
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.
-
searchArtists
public SearchArtistsRequest.Builder searchArtists(String q)
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.
-
searchPlaylists
public SearchPlaylistsRequest.Builder searchPlaylists(String q)
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.
-
searchTracks
public SearchTracksRequest.Builder searchTracks(String q)
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.
-
getAudioAnalysisForTrack
public GetAudioAnalysisForTrackRequest.Builder getAudioAnalysisForTrack(String id)
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
GetAudioAnalysisForTrackRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
getAudioFeaturesForTrack
public GetAudioFeaturesForTrackRequest.Builder getAudioFeaturesForTrack(String id)
Get audio features for a track based on its Spotify ID.- Parameters:
id- The Spotify ID of the track.- Returns:
- A
GetAudioFeaturesForTrackRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
getAudioFeaturesForSeveralTracks
public GetAudioFeaturesForSeveralTracksRequest.Builder getAudioFeaturesForSeveralTracks(String... ids)
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
GetAudioFeaturesForSeveralTracksRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
getSeveralTracks
public GetSeveralTracksRequest.Builder getSeveralTracks(String... ids)
Get multiple tracks.- Parameters:
ids- The Spotify IDs of all tracks you're trying to retrieve. Maximum: 50 IDs.- Returns:
- A
GetSeveralTracksRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
getTrack
public GetTrackRequest.Builder getTrack(String id)
Get a track.- Parameters:
id- The Spotify ID of the track.- Returns:
- A
GetTrackRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
getCurrentUsersProfile
public GetCurrentUsersProfileRequest.Builder getCurrentUsersProfile()
Get detailed profile information about the current user (including the current user’s username).- Returns:
- A
GetCurrentUsersProfileRequest.Builder.
-
getUsersProfile
public GetUsersProfileRequest.Builder getUsersProfile(String user_id)
Get public profile information about a Spotify user.- Parameters:
user_id- The Spotify ID of the user.- Returns:
- A
GetUsersProfileRequest.Builder. - See Also:
- Spotify: URLs & IDs
-
-