public class SpotifyApi extends Object
| Modifier and Type | Class | Description |
|---|---|---|
static class |
SpotifyApi.Builder |
Builder class for building
SpotifyApi instances. |
| Modifier and Type | Field | Description |
|---|---|---|
static String |
DEFAULT_AUTHENTICATION_HOST |
The default authentication host of Spotify API calls.
|
static int |
DEFAULT_AUTHENTICATION_PORT |
The default authentication port of Spotify API calls.
|
static String |
DEFAULT_AUTHENTICATION_SCHEME |
The default authentication http scheme of Spotify API calls.
|
static String |
DEFAULT_HOST |
The default host of Spotify API calls.
|
static IHttpManager |
DEFAULT_HTTP_MANAGER |
A HttpManager configured with default settings.
|
static int |
DEFAULT_PORT |
The default port of Spotify API calls.
|
static String |
DEFAULT_SCHEME |
The default http scheme of Spotify API calls.
|
static Logger |
LOGGER |
| Modifier and Type | Method | Description |
|---|---|---|
AddTracksToPlaylistRequest.Builder |
addTracksToPlaylist(String playlist_id,
com.google.gson.JsonArray uris) |
Add tracks to a playlist.
|
AddTracksToPlaylistRequest.Builder |
addTracksToPlaylist(String playlist_id,
String[] uris) |
Add tracks to a playlist.
|
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/)
|
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/)
|
AuthorizationCodeRequest.Builder |
authorizationCode(String code) |
Returns a builder that can be used to build requests for authorization code grants.
|
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.
|
AuthorizationCodeRefreshRequest.Builder |
authorizationCodeRefresh() |
Refresh the access token by using authorization code grant.
|
AuthorizationCodeRefreshRequest.Builder |
authorizationCodeRefresh(String client_id,
String client_secret,
String refresh_token) |
Refresh the access token by using authorization code grant.
|
AuthorizationCodeUriRequest.Builder |
authorizationCodeUri() |
Retrieve an URL where the user can give the application permissions.
|
AuthorizationCodeUriRequest.Builder |
authorizationCodeUri(String client_id,
URI redirect_uri) |
Retrieve an URL where the user can give the application permissions.
|
static SpotifyApi.Builder |
builder() |
Create a builder for building a new Spotify API instance.
|
ChangePlaylistsDetailsRequest.Builder |
changePlaylistsDetails(String playlist_id) |
Update a playlists properties.
|
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/)
|
CheckCurrentUserFollowsArtistsOrUsersRequest.Builder |
checkCurrentUserFollowsArtistsOrUsers(ModelObjectType type,
String[] ids) |
Check to see if the current user is following one or more artists or other Spotify users.
|
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.
|
CheckUsersSavedAlbumsRequest.Builder |
checkUsersSavedAlbums(String... ids) |
Check if a track is saved in the users "Your Music" library.
|
CheckUsersSavedTracksRequest.Builder |
checkUsersSavedTracks(String... ids) |
Check if a track is saved in the users "Your Music" library.
|
ClientCredentialsRequest.Builder |
clientCredentials() |
Returns a builder that can be used to build requests for client credential grants.
|
static String |
concat(String[] parts,
char character) |
String concatenation helper method.
|
CreatePlaylistRequest.Builder |
createPlaylist(String user_id,
String name) |
Create a playlist.
|
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.
|
FollowArtistsOrUsersRequest.Builder |
followArtistsOrUsers(ModelObjectType type,
String[] ids) |
Add the current user as a follower of one or more artists or other Spotify users.
|
FollowPlaylistRequest.Builder |
followPlaylist(String playlist_id,
boolean public_) |
Add the current user as a follower of a playlist.
|
FollowPlaylistRequest.Builder |
followPlaylist(String owner_id,
String playlist_id,
boolean public_) |
Add the current user as a follower of a playlist.
|
static String |
formatDefaultDate(Date date) |
Formats a date, using the default spotify format.
|
String |
getAccessToken() |
Get the access token specified in the API object, which is used for API calls.
|
GetAlbumRequest.Builder |
getAlbum(String id) |
Returns an album with the ID given below.
|
GetAlbumsTracksRequest.Builder |
getAlbumsTracks(String id) |
Returns the tracks of the album with the ID given below.
|
GetArtistRequest.Builder |
getArtist(String id) |
Get an artist.
|
GetArtistsAlbumsRequest.Builder |
getArtistsAlbums(String id) |
Get the albums of a specific artist.
|
GetArtistsRelatedArtistsRequest.Builder |
getArtistsRelatedArtists(String id) |
Get artists related/similar to an artist.
|
GetArtistsTopTracksRequest.Builder |
getArtistsTopTracks(String id,
com.neovisionaries.i18n.CountryCode country) |
Get the top tracks of an artist in a specific country.
|
GetAudioAnalysisForTrackRequest.Builder |
getAudioAnalysisForTrack(String id) |
Get a detailed audio analysis for a single track identified by its unique Spotify ID.
|
GetAudioFeaturesForSeveralTracksRequest.Builder |
getAudioFeaturesForSeveralTracks(String... ids) |
Get audio features for multiple tracks based on their Spotify IDs.
|
GetAudioFeaturesForTrackRequest.Builder |
getAudioFeaturesForTrack(String id) |
Get audio features for a track based on its Spotify ID.
|
GetAvailableGenreSeedsRequest.Builder |
getAvailableGenreSeeds() |
Retrieve a list of available genres seed parameter values for recommendations.
|
GetCategoryRequest.Builder |
getCategory(String category_id) |
Get a category.
|
GetCategorysPlaylistsRequest.Builder |
getCategorysPlaylists(String category_id) |
Get the playlists from a specific category.
|
String |
getClientId() |
Get the application client ID specified in this API object.
|
String |
getClientSecret() |
Get the application client secret specified in this API object.
|
GetCurrentUsersProfileRequest.Builder |
getCurrentUsersProfile() |
Get detailed profile information about the current user (including the current user’s username).
|
GetCurrentUsersRecentlyPlayedTracksRequest.Builder |
getCurrentUsersRecentlyPlayedTracks() |
Get tracks from the current users recently played tracks.
|
GetCurrentUsersSavedAlbumsRequest.Builder |
getCurrentUsersSavedAlbums() |
Get a list of the albums saved in the current Spotify user’s "Your Music" library.
|
String |
getHost() |
Get the API host used for API calls.
|
IHttpManager |
getHttpManager() |
Get the
IHttpManager used for API calls. |
GetInformationAboutUsersCurrentPlaybackRequest.Builder |
getInformationAboutUsersCurrentPlayback() |
Get information about the users current playback state, including track, track progress, and active device.
|
GetListOfCategoriesRequest.Builder |
getListOfCategories() |
Get a list of categories.
|
GetListOfCurrentUsersPlaylistsRequest.Builder |
getListOfCurrentUsersPlaylists() |
Get a list of the playlists owned or followed by the current Spotify user.
|
GetListOfFeaturedPlaylistsRequest.Builder |
getListOfFeaturedPlaylists() |
Get "Featured Playlists" of different countries which may match a specific language.
|
GetListOfNewReleasesRequest.Builder |
getListOfNewReleases() |
Get the newest releases from a specific country.
|
GetListOfUsersPlaylistsRequest.Builder |
getListOfUsersPlaylists(String user_id) |
Get an users playlists.
|
GetPlaylistRequest.Builder |
getPlaylist(String playlist_id) |
Get a playlist.
|
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/)
|
GetPlaylistCoverImageRequest.Builder |
getPlaylistCoverImage(String playlist_id) |
Get the image used to represent a specific playlist.
|
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/)
|
GetPlaylistsTracksRequest.Builder |
getPlaylistsTracks(String playlist_id) |
Get a playlists tracks.
|
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/)
|
Integer |
getPort() |
Get the port used for API calls.
|
Integer |
getProxyPassword() |
Get the proxy password used for API calls.
|
Integer |
getProxyPort() |
Get the proxy port used for API calls.
|
String |
getProxyUrl() |
Get the proxy URL used for API calls.
|
Integer |
getProxyUsername() |
Get the proxy username used for API calls.
|
GetRecommendationsRequest.Builder |
getRecommendations() |
Create a playlist-style listening experience based on seed artists, tracks and genres.
|
URI |
getRedirectURI() |
Get the redirect URI of the application specified in this API object.
|
String |
getRefreshToken() |
Get the refresh token specified in the API object.
|
String |
getScheme() |
Get the scheme used for API calls.
|
GetSeveralAlbumsRequest.Builder |
getSeveralAlbums(String... ids) |
Get multiple albums.
|
GetSeveralArtistsRequest.Builder |
getSeveralArtists(String... ids) |
Get multiple artists.
|
GetSeveralTracksRequest.Builder |
getSeveralTracks(String... ids) |
Get multiple tracks.
|
GetTrackRequest.Builder |
getTrack(String id) |
Get a track.
|
GetUsersAvailableDevicesRequest.Builder |
getUsersAvailableDevices() |
Get information about an users available devices.
|
GetUsersCurrentlyPlayingTrackRequest.Builder |
getUsersCurrentlyPlayingTrack() |
Get the object currently being played on the users Spotify account.
|
GetUsersFollowedArtistsRequest.Builder |
getUsersFollowedArtists(ModelObjectType type) |
Get the current user’s followed artists.
|
GetUsersProfileRequest.Builder |
getUsersProfile(String user_id) |
Get public profile information about a Spotify user.
|
GetUsersSavedTracksRequest.Builder |
getUsersSavedTracks() |
Get an users "Your Music" tracks.
|
GetUsersTopArtistsRequest.Builder |
getUsersTopArtists() |
Get the current users top artists based on calculated affinity.
|
<T extends IArtistTrackModelObject> |
getUsersTopArtistsAndTracks(ModelObjectType type) |
Get the current users top artists or tracks based on calculated affinity.
|
GetUsersTopTracksRequest.Builder |
getUsersTopTracks() |
Get the current users top tracks based on calculated affinity.
|
static SimpleDateFormat |
makeSimpleDateFormat(String pattern,
String id) |
|
static Date |
parseDefaultDate(String date) |
Parses a date in the default spotify format.
|
PauseUsersPlaybackRequest.Builder |
pauseUsersPlayback() |
Pause playback on the users account.
|
RemoveAlbumsForCurrentUserRequest.Builder |
removeAlbumsForCurrentUser(String... ids) |
Remove one or more albums from the current users "Your Music" library.
|
RemoveTracksFromPlaylistRequest.Builder |
removeTracksFromPlaylist(String playlist_id,
com.google.gson.JsonArray tracks) |
Delete tracks from a playlist
|
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/)
|
RemoveUsersSavedTracksRequest.Builder |
removeUsersSavedTracks(String... ids) |
Remove a track if saved to the users "Your Music" library.
|
ReorderPlaylistsTracksRequest.Builder |
reorderPlaylistsTracks(String playlist_id,
int range_start,
int insert_before) |
Reorder a track or a group of tracks in a playlist.
|
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/)
|
ReplacePlaylistsTracksRequest.Builder |
replacePlaylistsTracks(String playlist_id,
com.google.gson.JsonArray uris) |
Replace tracks in a playlist.
|
ReplacePlaylistsTracksRequest.Builder |
replacePlaylistsTracks(String playlist_id,
String[] uris) |
Replace tracks in a playlist.
|
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/)
|
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/)
|
SaveAlbumsForCurrentUserRequest.Builder |
saveAlbumsForCurrentUser(com.google.gson.JsonArray ids) |
Save albums in the users "Your Music" library.
|
SaveAlbumsForCurrentUserRequest.Builder |
saveAlbumsForCurrentUser(String... ids) |
Save albums in the users "Your Music" library.
|
SaveTracksForUserRequest.Builder |
saveTracksForUser(com.google.gson.JsonArray ids) |
Save tracks in the users "Your Music" library.
|
SaveTracksForUserRequest.Builder |
saveTracksForUser(String... ids) |
Save tracks in the users "Your Music" library.
|
SearchAlbumsRequest.Builder |
searchAlbums(String q) |
Get Spotify catalog information about albums that match a keyword string.
|
SearchArtistsRequest.Builder |
searchArtists(String q) |
Get Spotify catalog information about artists that match a keyword string.
|
SearchItemRequest.Builder |
searchItem(String q,
String type) |
Get Spotify catalog information about artists, albums, tracks or playlists that match a keyword string.
|
SearchPlaylistsRequest.Builder |
searchPlaylists(String q) |
Get Spotify catalog information about playlists that match a keyword string.
|
SearchTracksRequest.Builder |
searchTracks(String q) |
Get Spotify catalog information about tracks that match a keyword string.
|
SeekToPositionInCurrentlyPlayingTrackRequest.Builder |
seekToPositionInCurrentlyPlayingTrack(int position_ms) |
Seeks to the given position in the users currently playing track.
|
void |
setAccessToken(String accessToken) |
Set the access token of the API object.
|
void |
setRefreshToken(String refreshToken) |
Set the refresh token of the API object.
|
SetRepeatModeOnUsersPlaybackRequest.Builder |
setRepeatModeOnUsersPlayback(String state) |
Set the repeat mode for the users playback.
|
SetVolumeForUsersPlaybackRequest.Builder |
setVolumeForUsersPlayback(int volume_percent) |
Set the volume for the users current playback device.
|
SkipUsersPlaybackToNextTrackRequest.Builder |
skipUsersPlaybackToNextTrack() |
Skips to next track in the users queue.
|
SkipUsersPlaybackToPreviousTrackRequest.Builder |
skipUsersPlaybackToPreviousTrack() |
Skips to previous track in the users queue.
|
StartResumeUsersPlaybackRequest.Builder |
startResumeUsersPlayback() |
Start a new context or resume current playback on the users active device.
|
ToggleShuffleForUsersPlaybackRequest.Builder |
toggleShuffleForUsersPlayback(boolean state) |
Toggle shuffle on or off for users playback.
|
TransferUsersPlaybackRequest.Builder |
transferUsersPlayback(com.google.gson.JsonArray device_ids) |
Transfer playback to a new device and determine if it should start playing.
|
UnfollowArtistsOrUsersRequest.Builder |
unfollowArtistsOrUsers(ModelObjectType type,
String[] ids) |
Remove the current user as a follower of one or more artists or other Spotify users.
|
UnfollowPlaylistRequest.Builder |
unfollowPlaylist(String playlist_id) |
Remove the current user as a follower of a playlist.
|
UnfollowPlaylistRequest.Builder |
unfollowPlaylist(String owner_id,
String playlist_id) |
Remove the specified user as a follower of a playlist.
|
UploadCustomPlaylistCoverImageRequest.Builder |
uploadCustomPlaylistCoverImage(String playlist_id) |
Replace the image used to represent a specific playlist.
|
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/)
|
public static final String DEFAULT_AUTHENTICATION_HOST
public static final int DEFAULT_AUTHENTICATION_PORT
public static final String DEFAULT_AUTHENTICATION_SCHEME
public static final String DEFAULT_HOST
public static final IHttpManager DEFAULT_HTTP_MANAGER
public static final int DEFAULT_PORT
public static final String DEFAULT_SCHEME
public static final Logger LOGGER
public static SpotifyApi.Builder builder()
SpotifyApi.Builder.public static String concat(String[] parts, char character)
parts - String parts.character - Separation character.public static Date parseDefaultDate(String date) throws ParseException
date - the input date to parseDateParseException - if the date is not in a valid formatpublic static String formatDefaultDate(Date date)
date - the date to formatpublic static SimpleDateFormat makeSimpleDateFormat(String pattern, String id)
public IHttpManager getHttpManager()
IHttpManager used for API calls.IHttpManager.public String getScheme()
httpspublic String getHost()
"api.spotify.com"public Integer getPort()
443public String getProxyUrl()
public Integer getProxyPort()
public Integer getProxyUsername()
public Integer getProxyPassword()
public String getClientId()
public String getClientSecret()
public URI getRedirectURI()
public String getAccessToken()
public void setAccessToken(String accessToken)
accessToken - A Spotify Web API access token.public String getRefreshToken()
public void setRefreshToken(String refreshToken)
refreshToken - A Spotify Web API refresh token.public AuthorizationCodeRefreshRequest.Builder authorizationCodeRefresh(String client_id, String client_secret, String refresh_token)
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.AuthorizationCodeRequest.Builder.public AuthorizationCodeRefreshRequest.Builder authorizationCodeRefresh()
AuthorizationCodeRequest.Builder.public AuthorizationCodeRequest.Builder authorizationCode(String client_id, String client_secret, String code, URI redirect_uri)
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.AuthorizationCodeRequest.Builder.public AuthorizationCodeRequest.Builder authorizationCode(String code)
code - The authorization code returned from the initial request to the Account /authorize endpoint.AuthorizationCodeRequest.Builder.public AuthorizationCodeUriRequest.Builder authorizationCodeUri(String client_id, URI redirect_uri)
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.AuthorizationCodeUriRequest.Builder.public AuthorizationCodeUriRequest.Builder authorizationCodeUri()
AuthorizationCodeUriRequest.Builder.public ClientCredentialsRequest.Builder clientCredentials()
ClientCredentialsRequest.Builder.public GetAlbumRequest.Builder getAlbum(String id)
id - The Spotify album ID of the album you're trying to retrieve.GetAlbumRequest.Builder.public GetAlbumsTracksRequest.Builder getAlbumsTracks(String id)
id - The Spotify ID of the album you're trying to retrieve.GetAlbumsTracksRequest.Builder.public GetSeveralAlbumsRequest.Builder getSeveralAlbums(String... ids)
ids - The Spotify IDs of all albums you're trying to retrieve. Maximum: 20 IDs.GetSeveralAlbumsRequest.Builder.public GetArtistRequest.Builder getArtist(String id)
id - The Spotify ID of the artist.GetArtistRequest.Builder.public GetArtistsAlbumsRequest.Builder getArtistsAlbums(String id)
id - The Spotify ID of the artist.GetArtistsAlbumsRequest.Builder.public GetArtistsTopTracksRequest.Builder getArtistsTopTracks(String id, com.neovisionaries.i18n.CountryCode country)
id - The Spotify ID of the artist.country - The ISO 3166-1 alpha-2 country code of the specific country.GetArtistsTopTracksRequest.Builder.public GetArtistsRelatedArtistsRequest.Builder getArtistsRelatedArtists(String id)
id - The Spotify ID of the artist.GetArtistsRelatedArtistsRequest.Builder.public GetSeveralArtistsRequest.Builder getSeveralArtists(String... ids)
ids - The Spotify IDs of all artists you're trying to retrieve. Maximum: 50 IDs.GetSeveralArtistsRequest.Builder.public GetCategoryRequest.Builder getCategory(String category_id)
category_id - The Spotify category ID for the category.GetCategoryRequest.Builder.public GetCategorysPlaylistsRequest.Builder getCategorysPlaylists(String category_id)
category_id - The Spotify category ID for the category.GetCategorysPlaylistsRequest.Builder.public GetListOfCategoriesRequest.Builder getListOfCategories()
GetListOfCategoriesRequest.Builder.public GetListOfFeaturedPlaylistsRequest.Builder getListOfFeaturedPlaylists()
GetListOfFeaturedPlaylistsRequest.Builder.public GetListOfNewReleasesRequest.Builder getListOfNewReleases()
GetListOfNewReleasesRequest.Builder.public GetRecommendationsRequest.Builder getRecommendations()
GetRecommendationsRequest.Builder.public GetAvailableGenreSeedsRequest.Builder getAvailableGenreSeeds()
GetAvailableGenreSeedsRequest.Builder.public CheckCurrentUserFollowsArtistsOrUsersRequest.Builder checkCurrentUserFollowsArtistsOrUsers(ModelObjectType type, String[] ids)
type - The ID type: either artist or user.ids - A list of the artist or the user Spotify IDs to check. Maximum: 50 IDs.CheckCurrentUserFollowsArtistsOrUsersRequest.Builder.public CheckUsersFollowPlaylistRequest.Builder checkUsersFollowPlaylist(String owner_id, String playlist_id, String[] ids)
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.CheckUsersFollowPlaylistRequest.Builder.public FollowArtistsOrUsersRequest.Builder followArtistsOrUsers(ModelObjectType type, String[] ids)
type - The ID type: either artist or user.ids - A list of the artist or the user Spotify IDs. Maximum: 50 IDs.FollowArtistsOrUsersRequest.Builder.public FollowArtistsOrUsersRequest.Builder followArtistsOrUsers(ModelObjectType type, com.google.gson.JsonArray ids)
type - The ID type: either artist or user.ids - A list of the artist or the user Spotify IDs. Maximum: 50 IDs.FollowArtistsOrUsersRequest.Builder.public FollowPlaylistRequest.Builder followPlaylist(String owner_id, String playlist_id, boolean public_)
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.FollowPlaylistRequest.Builder.public FollowPlaylistRequest.Builder followPlaylist(String playlist_id, boolean public_)
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.FollowPlaylistRequest.Builder.public GetUsersFollowedArtistsRequest.Builder getUsersFollowedArtists(ModelObjectType type)
type - The ID type: currently only artist is supported.GetUsersFollowedArtistsRequest.Builder.public UnfollowArtistsOrUsersRequest.Builder unfollowArtistsOrUsers(ModelObjectType type, String[] ids)
type - The ID type: either artist or user.ids - A list of the artist or the user Spotify IDs. Maximum: 50 IDs.UnfollowArtistsOrUsersRequest.Builder.public UnfollowPlaylistRequest.Builder unfollowPlaylist(String owner_id, String playlist_id)
owner_id - The owners username.playlist_id - The playlist's ID.UnfollowPlaylistRequest.Builder.public UnfollowPlaylistRequest.Builder unfollowPlaylist(String playlist_id)
playlist_id - The playlist's ID.UnfollowPlaylistRequest.Builder.public CheckUsersSavedAlbumsRequest.Builder checkUsersSavedAlbums(String... ids)
ids - The tracks IDs to check for in the user's Your Music library. Maximum: 50 IDs.CheckUsersSavedAlbumsRequest.Builder.public CheckUsersSavedTracksRequest.Builder checkUsersSavedTracks(String... ids)
ids - The tracks IDs to check for in the user's Your Music library. Maximum: 50 IDs.public GetCurrentUsersSavedAlbumsRequest.Builder getCurrentUsersSavedAlbums()
GetCurrentUsersSavedAlbumsRequest.Builder.public GetUsersSavedTracksRequest.Builder getUsersSavedTracks()
GetUsersSavedTracksRequest.Builder.public RemoveAlbumsForCurrentUserRequest.Builder removeAlbumsForCurrentUser(String... ids)
ids - A list of the Spotify IDs. Maximum: 50 IDs.RemoveAlbumsForCurrentUserRequest.Builder.public RemoveUsersSavedTracksRequest.Builder removeUsersSavedTracks(String... ids)
ids - The track IDs to remove from the users Your Music library. Maximum: 50 IDs.RemoveUsersSavedTracksRequest.Builder.public SaveAlbumsForCurrentUserRequest.Builder saveAlbumsForCurrentUser(String... ids)
ids - The album IDs to add to the users library. Maximum: 50 IDs.SaveAlbumsForCurrentUserRequest.Builder.public SaveAlbumsForCurrentUserRequest.Builder saveAlbumsForCurrentUser(com.google.gson.JsonArray ids)
ids - The album IDs to add to the users library. Maximum: 50 IDs.SaveAlbumsForCurrentUserRequest.Builder.public SaveTracksForUserRequest.Builder saveTracksForUser(String... ids)
ids - The track IDs to add to the users library. Maximum: 50 IDs.SaveTracksForUserRequest.Builder.public SaveTracksForUserRequest.Builder saveTracksForUser(com.google.gson.JsonArray ids)
ids - The track IDs to add to the users library. Maximum: 50 IDs.SaveTracksForUserRequest.Builder.public <T extends IArtistTrackModelObject> GetUsersTopArtistsAndTracksRequest.Builder<T> getUsersTopArtistsAndTracks(ModelObjectType type)
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.
T - Either Artist or
Tracktype - The type of entity to return. Valid values: artists or tracks.GetUsersTopArtistsAndTracksRequest.Builder.public GetUsersTopArtistsRequest.Builder getUsersTopArtists()
GetUsersTopArtistsRequest.Builder.getUsersTopArtistsAndTracks(ModelObjectType)public GetUsersTopTracksRequest.Builder getUsersTopTracks()
GetUsersTopTracksRequest.Builder.getUsersTopArtistsAndTracks(ModelObjectType)public GetInformationAboutUsersCurrentPlaybackRequest.Builder getInformationAboutUsersCurrentPlayback()
public GetCurrentUsersRecentlyPlayedTracksRequest.Builder getCurrentUsersRecentlyPlayedTracks()
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.
public GetUsersAvailableDevicesRequest.Builder getUsersAvailableDevices()
GetUsersAvailableDevicesRequest.Builder.public GetUsersCurrentlyPlayingTrackRequest.Builder getUsersCurrentlyPlayingTrack()
GetUsersCurrentlyPlayingTrackRequest.Builder.public PauseUsersPlaybackRequest.Builder pauseUsersPlayback()
PauseUsersPlaybackRequest.Builder.public SeekToPositionInCurrentlyPlayingTrackRequest.Builder seekToPositionInCurrentlyPlayingTrack(int position_ms)
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.SeekToPositionInCurrentlyPlayingTrackRequest.Builder.public SetRepeatModeOnUsersPlaybackRequest.Builder setRepeatModeOnUsersPlayback(String state)
state - track, context or off. track will repeat the current track. context will repeat the current
context. off will turn repeat off.SetRepeatModeOnUsersPlaybackRequest.Builder.public SetVolumeForUsersPlaybackRequest.Builder setVolumeForUsersPlayback(int volume_percent)
volume_percent - Integer. The volume to set. Must be a value from 0 to 100 inclusive.SetVolumeForUsersPlaybackRequest.Builder.public SkipUsersPlaybackToNextTrackRequest.Builder skipUsersPlaybackToNextTrack()
SkipUsersPlaybackToNextTrackRequest.Builder.public SkipUsersPlaybackToPreviousTrackRequest.Builder skipUsersPlaybackToPreviousTrack()
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.
SkipUsersPlaybackToPreviousTrackRequest.Builder.public StartResumeUsersPlaybackRequest.Builder startResumeUsersPlayback()
StartResumeUsersPlaybackRequest.Builder.public ToggleShuffleForUsersPlaybackRequest.Builder toggleShuffleForUsersPlayback(boolean state)
state - true: Shuffle user's playback. false: Do not shuffle user's playback.ToggleShuffleForUsersPlaybackRequest.Builder.public TransferUsersPlaybackRequest.Builder transferUsersPlayback(com.google.gson.JsonArray device_ids)
device_ids - A JSON array containing the ID of the device on which playback should be started/transferred.
TransferUsersPlaybackRequest.Builder.@Deprecated public AddTracksToPlaylistRequest.Builder addTracksToPlaylist(String user_id, String playlist_id, String[] uris)
user_id - The owners username.playlist_id - The playlists ID.uris - URIs of the tracks to add. Maximum: 100 track URIs.AddTracksToPlaylistRequest.Builder.public AddTracksToPlaylistRequest.Builder addTracksToPlaylist(String playlist_id, String[] uris)
playlist_id - The playlists ID.uris - URIs of the tracks to add. Maximum: 100 track URIs.AddTracksToPlaylistRequest.Builder.@Deprecated public AddTracksToPlaylistRequest.Builder addTracksToPlaylist(String user_id, String playlist_id, com.google.gson.JsonArray uris)
user_id - The owners username.playlist_id - The playlists ID.uris - URIs of the tracks to add. Maximum: 100 track URIs.AddTracksToPlaylistRequest.Builder.public AddTracksToPlaylistRequest.Builder addTracksToPlaylist(String playlist_id, com.google.gson.JsonArray uris)
playlist_id - The playlists ID.uris - URIs of the tracks to add. Maximum: 100 track URIs.AddTracksToPlaylistRequest.Builder.@Deprecated public ChangePlaylistsDetailsRequest.Builder changePlaylistsDetails(String user_id, String playlist_id)
user_id - The owners username.playlist_id - The playlists ID.ChangePlaylistsDetailsRequest.Builder.public ChangePlaylistsDetailsRequest.Builder changePlaylistsDetails(String playlist_id)
playlist_id - The playlists ID.ChangePlaylistsDetailsRequest.Builder.public CreatePlaylistRequest.Builder createPlaylist(String user_id, String name)
user_id - The playlists owner.name - The name of the playlist.CreatePlaylistRequest.Builder.public GetListOfCurrentUsersPlaylistsRequest.Builder getListOfCurrentUsersPlaylists()
GetListOfCurrentUsersPlaylistsRequest.Builder.public GetListOfUsersPlaylistsRequest.Builder getListOfUsersPlaylists(String user_id)
user_id - A Spotify ID of the user.GetListOfUsersPlaylistsRequest.Builder.@Deprecated public GetPlaylistRequest.Builder getPlaylist(String user_id, String playlist_id)
user_id - The playlists owners username.playlist_id - The playlists ID.GetPlaylistRequest.Builder.public GetPlaylistRequest.Builder getPlaylist(String playlist_id)
playlist_id - The playlists ID.GetPlaylistRequest.Builder.@Deprecated public GetPlaylistCoverImageRequest.Builder getPlaylistCoverImage(String user_id, String playlist_id)
user_id - The users Spotify user ID.playlist_id - The Spotify ID for the playlist.GetPlaylistCoverImageRequest.Builder.public GetPlaylistCoverImageRequest.Builder getPlaylistCoverImage(String playlist_id)
playlist_id - The Spotify ID for the playlist.GetPlaylistCoverImageRequest.Builder.@Deprecated public GetPlaylistsTracksRequest.Builder getPlaylistsTracks(String user_id, String playlist_id)
user_id - The playlists owners username.playlist_id - The playlists ID.GetPlaylistsTracksRequest.Builder.public GetPlaylistsTracksRequest.Builder getPlaylistsTracks(String playlist_id)
playlist_id - The playlists ID.GetPlaylistsTracksRequest.Builder.@Deprecated public RemoveTracksFromPlaylistRequest.Builder removeTracksFromPlaylist(String user_id, String playlist_id, com.google.gson.JsonArray tracks)
user_id - The owners username.playlist_id - The playlists ID.tracks - URIs of the tracks to remove. Maximum: 100 track URIs.RemoveTracksFromPlaylistRequest.Builder.public RemoveTracksFromPlaylistRequest.Builder removeTracksFromPlaylist(String playlist_id, com.google.gson.JsonArray tracks)
playlist_id - The playlists ID.tracks - URIs of the tracks to remove. Maximum: 100 track URIs.RemoveTracksFromPlaylistRequest.Builder.@Deprecated public ReorderPlaylistsTracksRequest.Builder reorderPlaylistsTracks(String user_id, String playlist_id, int range_start, int insert_before)
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.
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.ReorderPlaylistsTracksRequest.Builder.public ReorderPlaylistsTracksRequest.Builder reorderPlaylistsTracks(String playlist_id, int range_start, int insert_before)
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.
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.ReorderPlaylistsTracksRequest.Builder.@Deprecated public ReplacePlaylistsTracksRequest.Builder replacePlaylistsTracks(String user_id, String playlist_id, String[] uris)
user_id - The owners username.playlist_id - The playlists ID.uris - URIs of the tracks to add. Maximum: 100 track URIs.ReplacePlaylistsTracksRequest.Builder.public ReplacePlaylistsTracksRequest.Builder replacePlaylistsTracks(String playlist_id, String[] uris)
playlist_id - The playlists ID.uris - URIs of the tracks to add. Maximum: 100 track URIs.ReplacePlaylistsTracksRequest.Builder.@Deprecated public ReplacePlaylistsTracksRequest.Builder replacePlaylistsTracks(String user_id, String playlist_id, com.google.gson.JsonArray uris)
user_id - The owners username.playlist_id - The playlists ID.uris - URIs of the tracks to add. Maximum: 100 track URIs.ReplacePlaylistsTracksRequest.Builder.public ReplacePlaylistsTracksRequest.Builder replacePlaylistsTracks(String playlist_id, com.google.gson.JsonArray uris)
playlist_id - The playlists ID.uris - URIs of the tracks to add. Maximum: 100 track URIs.ReplacePlaylistsTracksRequest.Builder.@Deprecated public UploadCustomPlaylistCoverImageRequest.Builder uploadCustomPlaylistCoverImage(String user_id, String playlist_id)
user_id - The users Spotify user ID.playlist_id - The Spotify ID for the playlist.UploadCustomPlaylistCoverImageRequest.Builder.public UploadCustomPlaylistCoverImageRequest.Builder uploadCustomPlaylistCoverImage(String playlist_id)
playlist_id - The Spotify ID for the playlist.UploadCustomPlaylistCoverImageRequest.Builder.public SearchItemRequest.Builder searchItem(String q, String type)
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.SearchItemRequest.Builder.public SearchAlbumsRequest.Builder searchAlbums(String q)
q - The search query's keywords (and optional field filters and operators).SearchAlbumsRequest.Builder.public SearchArtistsRequest.Builder searchArtists(String q)
q - The search query's keywords (and optional field filters and operators).SearchArtistsRequest.Builder.public SearchPlaylistsRequest.Builder searchPlaylists(String q)
q - The search query's keywords (and optional field filters and operators).SearchPlaylistsRequest.Builder.public SearchTracksRequest.Builder searchTracks(String q)
q - The search query's keywords (and optional field filters and operators).SearchTracksRequest.Builder.public GetAudioAnalysisForTrackRequest.Builder getAudioAnalysisForTrack(String id)
id - The Spotify ID for the track.GetAudioAnalysisForTrackRequest.Builder.public GetAudioFeaturesForTrackRequest.Builder getAudioFeaturesForTrack(String id)
id - The Spotify ID of the track.GetAudioFeaturesForTrackRequest.Builder.public GetAudioFeaturesForSeveralTracksRequest.Builder getAudioFeaturesForSeveralTracks(String... ids)
ids - A comma-separated list of the Spotify IDs for the tracks. Maximum: 100 IDs.GetAudioFeaturesForSeveralTracksRequest.Builder.public GetSeveralTracksRequest.Builder getSeveralTracks(String... ids)
ids - The Spotify IDs of all tracks you're trying to retrieve. Maximum: 50 IDs.GetSeveralTracksRequest.Builder.public GetTrackRequest.Builder getTrack(String id)
id - The Spotify ID of the track.GetTrackRequest.Builder.public GetCurrentUsersProfileRequest.Builder getCurrentUsersProfile()
GetCurrentUsersProfileRequest.Builder.public GetUsersProfileRequest.Builder getUsersProfile(String user_id)
user_id - The Spotify ID of the user.GetUsersProfileRequest.Builder.Copyright © 2019. All rights reserved.