spotify_ex v2.2.1 Spotify.Album View Source
Functions for retrieving information about albums.
Some endpoints return collections. Spotify wraps the collection in a paging object, this API does the same. A single piece of data will not be wrapped, however in some instances an objet key can contain a collection wrapped in a paging object, for example, requesting several albums will not give you a paging object for the albums, but the tracks will be wrapped in one.
There are two functions for each endpoint, one that actually makes the request, and one that provides the endpoint:
Spotify.Playist.create_playlist(conn, "foo", "bar") # makes the POST request.
Spotify.Playist.create_playlist_url("foo", "bar") # provides the url for the request.
Link to this section Summary
Functions
Implement the callback required by the Responder behavior
Check if one or more albums is already saved in the current Spotify user’s “Your Music” library. Spotify Documentation
Check if one or more albums is already saved in the current Spotify user’s “Your Music” library
Get Spotify catalog information for a single album. Spotify Documentation
Get Spotify catalog information about an album’s tracks. Spotify Documentation
Get Spotify catalog information about an album’s tracks
Get Spotify catalog information for a single album
Get Spotify catalog information for multiple albums identified by their Spotify IDs. Spotify Documentation
Get Spotify catalog information for multiple albums identified by their Spotify IDs
Get Spotify catalog information about an artist’s albums. Optional parameters can be specified in the query string to filter and sort the response
Get Spotify catalog information about an artist’s albums. Optional parameters can be specified in the query string to filter and sort the response
Get a list of the albums saved in the current Spotify user’s “Your Music” library. Spotify Documentation
Get a list of the albums saved in the current Spotify user’s “Your Music” library
Get a list of new album releases featured in Spotify Spotify Documentation
Get a list of new album releases featured in Spotify
Remove one or more albums from the current user’s “Your Music” library. Spotify Documentation
Remove one or more albums from the current user’s “Your Music” library
Save one or more albums to the current user’s “Your Music” library. Spotify Documentation
Save one or more albums to the current user’s “Your Music” library. Spotify Documentation
Link to this section Functions
build_response(body) View Source
Implement the callback required by the Responder behavior
check_albums(conn, params) View Source
Check if one or more albums is already saved in the current Spotify user’s “Your Music” library. Spotify Documentation
Method: GET
Spotify.Album.check_albums(ids: "1,4")
# => [true, false] (Album 1 is in the user's library, 4 is not)
check_albums_url(params) View Source
Check if one or more albums is already saved in the current Spotify user’s “Your Music” library.
iex> Spotify.Album.check_albums_url(ids: "1,4")
"https://api.spotify.com/v1/me/albums/contains?ids=1%2C4"
get_album(conn, id, params \\ []) View Source
Get Spotify catalog information for a single album. Spotify Documentation
Method: GET
Optional Params: market
Spotify.Album.get_album(conn, "4")
# => { :ok, %Spotify.Album{...} }
get_album_tracks(conn, id, params \\ []) View Source
Get Spotify catalog information about an album’s tracks. Spotify Documentation
Method: GET
Optional Params: limit
, offset
, market
Spotify.Album.get_album_tracks("1")
# => { :ok, %Paging{items: [%Spotify.Tracks{}, ...] } }
get_album_tracks_url(id, params \\ []) View Source
Get Spotify catalog information about an album’s tracks.
iex> Spotify.Album.get_album_tracks_url("4")
"https://api.spotify.com/v1/albums/4/tracks"
get_album_url(id, params \\ []) View Source
Get Spotify catalog information for a single album.
iex> Spotify.Album.get_album_url("4")
"https://api.spotify.com/v1/albums/4"
get_albums(conn, params) View Source
Get Spotify catalog information for multiple albums identified by their Spotify IDs. Spotify Documentation
Method: GET
Optional Params: market
Spotify.Album.get_albums(conn, ids: "1,4")
# => { :ok, %Spotify.Album{...} }
get_albums_url(params) View Source
Get Spotify catalog information for multiple albums identified by their Spotify IDs.
iex> Spotify.Album.get_albums_url(ids: "1,3")
"https://api.spotify.com/v1/albums?ids=1%2C3"
get_artists_albums(conn, id) View Source
Get Spotify catalog information about an artist’s albums. Optional parameters can be specified in the query string to filter and sort the response.
Method: GET
Spotify.Album.get_arists_albums(conn, "4")
# => { :ok, %Paging{items: [%Album{}, ..]} }
get_artists_albums_url(id) View Source
Get Spotify catalog information about an artist’s albums. Optional parameters can be specified in the query string to filter and sort the response.
iex> Spotify.Album.get_artists_albums_url("4")
"https://api.spotify.com/v1/artists/4/albums"
handle_response(arg) View Source
my_albums(conn, params) View Source
Get a list of the albums saved in the current Spotify user’s “Your Music” library. Spotify Documentation
Method: GET
Optional Params: limit
, offset
, market
Spotify.Album.my_albums(conn, limit: 5)
# => { :ok, %Paging{items: [%Album{}, ...]} }
my_albums_url(params) View Source
Get a list of the albums saved in the current Spotify user’s “Your Music” library.
iex> Spotify.Album.my_albums_url(limit: 5)
"https://api.spotify.com/v1/me/albums?limit=5"
new_releases(conn, params \\ []) View Source
Get a list of new album releases featured in Spotify Spotify Documentation
Method: GET
Optional Params: country
, limit
, offset
Spotify.Album.new_releases(conn, country: "US")
# => { :ok, %Paging{items: [%Album{}, ..]} }
new_releases_url(params) View Source
Get a list of new album releases featured in Spotify
iex> Spotify.Album.new_releases_url(country: "US")
"https://api.spotify.com/v1/browse/new-releases?country=US"
remove_albums(conn, params) View Source
Remove one or more albums from the current user’s “Your Music” library. Spotify Documentation
Method: DELETE
Spotify.Album.remove_albums(conn, ids: "1,4")
# => :ok
remove_albums_url(params) View Source
Remove one or more albums from the current user’s “Your Music” library.
iex> Spotify.Album.remove_albums_url(ids: "1,4") "https://api.spotify.com/v1/me/albums?ids=1%2C4"
save_albums(conn, params) View Source
Save one or more albums to the current user’s “Your Music” library. Spotify Documentation
Method: PUT
Required Params: ids
Spotify.Album.save_albums(conn, ids: "1,4")
# => :ok
save_albums_url(params) View Source
Save one or more albums to the current user’s “Your Music” library. Spotify Documentation
iex> Spotify.Album.save_albums_url(ids: "1,4")
"https://api.spotify.com/v1/me/albums?ids=1%2C4"