spotify_ex v0.1.4 Spotify.Artist

Functions for retrieving information about artists and for managing a user’s followed artists.

Some of the endpoints in the offical docs are not implemented in this module.

  • Following and Unfollowing an artist is also the same endpoint as following a user, so related functions live in Spotify.Follow.

  • Top artists is also the same function for top tracks, it lives in Spotify.Personalization.

  • Artist’s albums lives in Spotify.Albums.

    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.

    https://developer.spotify.com/web-api/artist-endpoints/

Summary

Functions

Get the current user’s followed artists

Get the current user’s followed artists

Callback implementation for Responder.build_response/1

Get Spotify catalog information for a single artist identified by their unique Spotify ID. Spotify Documenation

Get Spotify catalog information for a single artist identified by their unique Spotify ID

Get Spotify catalog information for several artists based on their Spotify IDs. Spotify Documenation

Get Spotify catalog information for several artists based on their Spotify IDs

Get Spotify catalog information about artists similar to a given artist. Spotify Documenation

Get Spotify catalog information about artists similar to a given artist

Get Spotify catalog information about an artist’s top tracks by country. Spotify Documenation

Get Spotify catalog information about an artist’s top tracks by country

Functions

artists_I_follow(conn, params \\ [])

Get the current user’s followed artists.

Method: GET

Optional Params: type, limit, after

Spotify.Artist.artists_I_follow_url(conn)
# => { :ok, %Paging{items: [%Artist{}, ...]} }
artists_I_follow_url(params)

Get the current user’s followed artists.

iex> Spotify.Artist.artists_I_follow_url(limit: 5)
"https://api.spotify.com/v1/me/following?type=artist&limit=5"
build_artists(artists)
build_response(body)

Callback implementation for Responder.build_response/1.

get_artist(conn, id)

Get Spotify catalog information for a single artist identified by their unique Spotify ID. Spotify Documenation

Method: GET

Spotify.Artist.get_artist(conn, "4")
# => { :ok, %Artist{}}
get_artist_url(id)

Get Spotify catalog information for a single artist identified by their unique Spotify ID.

iex> Spotify.Artist.get_artist_url("4")
"https://api.spotify.com/v1/artists/4"
get_artists(conn, list)

Get Spotify catalog information for several artists based on their Spotify IDs. Spotify Documenation

Method: GET

Required Params: ids

Spotify.Artist.get_artists(conn, ids: "1,4")
# => { :ok, [%Artist{}, ...] }
get_artists_url(params)

Get Spotify catalog information for several artists based on their Spotify IDs.

iex> Spotify.Artist.get_artists_url(ids: "1,4")
"https://api.spotify.com/v1/artists?ids=1%2C4"
get_top_tracks(conn, id, params)

Get Spotify catalog information about an artist’s top tracks by country. Spotify Documenation

Method: GET

Required Params: country

Spotify.get_top_tracks(conn, "4", country: "US")
# => { :ok, [%Track{}, ...] }
get_top_tracks_url(id, params)

Get Spotify catalog information about an artist’s top tracks by country.

iex> Spotify.Artist.get_top_tracks_url("4", country: "US")
"https://api.spotify.com/v1/artists/4/top-tracks?country=US"