Exspotify.Tracks (Exspotify v0.1.0)

View Source

Provides functions for interacting with the Tracks endpoints of the Spotify Web API. Deprecated endpoints (audio features, audio analysis, recommendations) are not included. See: https://developer.spotify.com/documentation/web-api/reference/tracks

Summary

Functions

Check if one or more tracks are saved in the current user's library. Returns a list of booleans corresponding to the track IDs. https://developer.spotify.com/documentation/web-api/reference/check-users-saved-tracks

Get Spotify catalog information for several tracks based on their Spotify IDs. https://developer.spotify.com/documentation/web-api/reference/get-several-tracks

Get Spotify catalog information for a single track by its unique Spotify ID. https://developer.spotify.com/documentation/web-api/reference/get-track

Get a list of the tracks saved in the current Spotify user's library (paginated). Returns a Paging struct containing saved tracks with added_at timestamps. https://developer.spotify.com/documentation/web-api/reference/get-users-saved-tracks

Functions

check_users_saved_tracks(track_ids, token)

@spec check_users_saved_tracks([String.t()], String.t()) ::
  {:ok, [boolean()]} | {:error, Exspotify.Error.t()}

Check if one or more tracks are saved in the current user's library. Returns a list of booleans corresponding to the track IDs. https://developer.spotify.com/documentation/web-api/reference/check-users-saved-tracks

get_several_tracks(track_ids, token)

@spec get_several_tracks([String.t()], String.t()) ::
  {:ok, [Exspotify.Structs.Track.t()]} | {:error, Exspotify.Error.t()}

Get Spotify catalog information for several tracks based on their Spotify IDs. https://developer.spotify.com/documentation/web-api/reference/get-several-tracks

get_track(track_id, token)

@spec get_track(String.t(), String.t()) ::
  {:ok, Exspotify.Structs.Track.t()} | {:error, Exspotify.Error.t()}

Get Spotify catalog information for a single track by its unique Spotify ID. https://developer.spotify.com/documentation/web-api/reference/get-track

get_users_saved_tracks(token, opts \\ [])

@spec get_users_saved_tracks(
  String.t(),
  keyword()
) :: {:ok, Exspotify.Structs.Paging.t()} | {:error, Exspotify.Error.t()}

Get a list of the tracks saved in the current Spotify user's library (paginated). Returns a Paging struct containing saved tracks with added_at timestamps. https://developer.spotify.com/documentation/web-api/reference/get-users-saved-tracks

remove_users_saved_tracks(track_ids, token)

@spec remove_users_saved_tracks([String.t()], String.t()) ::
  {:ok, any()} | {:error, Exspotify.Error.t()}

Remove one or more tracks from the current user's library. https://developer.spotify.com/documentation/web-api/reference/remove-tracks-user

save_tracks_for_current_user(track_ids, token)

@spec save_tracks_for_current_user([String.t()], String.t()) ::
  {:ok, any()} | {:error, Exspotify.Error.t()}

Save one or more tracks to the current user's library. https://developer.spotify.com/documentation/web-api/reference/save-tracks-user