spotify_ex v0.1.2 Spotify.Personalization

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/

Summary

Functions

Defines the Personalization struct

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

Functions

__struct__()

Defines the Personalization struct.

top_artists(conn, params \\ [])

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:...} }
top_artists_url(params \\ [])

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"
top_tracks(conn, params \\ [])

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:...} }
top_tracks_url(params \\ [])

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"
url()

Base URL