spotify_ex v2.2.1 Spotify.Personalization View Source

Endpoints for retrieving information about the user’s listening habits

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.

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/web-api-personalization-endpoints/

Link to this section Summary

Functions

Implements the hook expected by the Responder behaviour

Get the current user’s top artists based on calculated affinity. Spotify Documentation

Get the current user’s top artists based on calculated affinity

Get the current user’s top tracks based on calculated affinity. Spotify Documentation

Get the current user’s top tracks based on calculated affinity

Base URL

Link to this section Functions

Implements the hook expected by the Responder behaviour

Link to this function

top_artists(conn, params \\ []) View Source

Get the current user’s top artists based on calculated affinity. Spotify Documentation

Method: GET

Optional Params: limit, offset, time_range

Spotify.Personalization.top_artists(conn)
{ :ok, artists: [%Spotify.Artist{..}...], paging: %Paging{next:...} }
Link to this function

top_artists_url(params \\ []) View Source

Get the current user’s top artists based on calculated affinity.

iex> Spotify.Personalization.top_artists_url(limit: 5, time_range: "medium_term")
"https://api.spotify.com/v1/me/top/artists?limit=5&time_range=medium_term"
Link to this function

top_tracks(conn, params \\ []) View Source

Get the current user’s top tracks based on calculated affinity. Spotify Documentation

Method: GET

Optional Params: limit, offset, time_range

Spotify.Personalization.top_tracks(conn)
{ :ok, tracks: [%Spotify.Tracks{..}...], paging: %Paging{next:...} }
Link to this function

top_tracks_url(params \\ []) View Source

Get the current user’s top tracks based on calculated affinity.

iex> Spotify.Personalization.top_tracks_url
"https://api.spotify.com/v1/me/top/tracks"

Base URL