Exspotify.Users (Exspotify v0.1.0)

View Source

Provides functions for interacting with the Users endpoints of the Spotify Web API. See: https://developer.spotify.com/documentation/web-api/reference/users-profile

Summary

Functions

Follow artists or users. Warning: This will change the user's followed artists or users. type: "artist" or "user" https://developer.spotify.com/documentation/web-api/reference/follow-artists-users

Unfollow artists or users. Warning: This will change the user's followed artists or users. type: "artist" or "user" https://developer.spotify.com/documentation/web-api/reference/unfollow-artists-users

Functions

check_if_user_follows_artists_or_users(type, token, ids, context_user_id \\ nil)

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

Check if the current user follows one or more artists or users. type: "artist" or "user" https://developer.spotify.com/documentation/web-api/reference/check-current-user-follows

follow_artists_or_users(type, token, ids, context_user_id \\ nil)

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

Follow artists or users. Warning: This will change the user's followed artists or users. type: "artist" or "user" https://developer.spotify.com/documentation/web-api/reference/follow-artists-users

get_current_user_profile(token)

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

Get the current user's profile. https://developer.spotify.com/documentation/web-api/reference/get-current-users-profile

get_followed_artists(token, opts \\ [])

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

Get the current user's followed artists (paginated). https://developer.spotify.com/documentation/web-api/reference/get-followed-artists

get_user_profile(user_id, token)

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

Get a user's public profile by their Spotify user ID. https://developer.spotify.com/documentation/web-api/reference/get-users-profile

get_user_top_items(type, token, opts \\ [])

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

Get the current user's top artists or tracks (paginated). https://developer.spotify.com/documentation/web-api/reference/get-users-top-artists-and-tracks type: "artists" or "tracks"

unfollow_artists_or_users(type, token, ids, context_user_id \\ nil)

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

Unfollow artists or users. Warning: This will change the user's followed artists or users. type: "artist" or "user" https://developer.spotify.com/documentation/web-api/reference/unfollow-artists-users