Users
API #
Implementation to make API calls with.
Parameters:
-
access_flow(AuthorizationCodeFlow | ClientCredentialsFlow) –Access flow to use for api requests.
get_current_users_profile #
get_current_users_profile() -> OwnUser
Get detailed profile information about the current user.
Optional Authorization Scopes
USER_READ_PRIVATE- required to access the current user's subscription details.USER_READ_EMAIL- required to access the current user's email.
Returns:
-
OwnUser–The current user.
get_users_top_items #
get_users_top_items(type: TopItemType, *, limit: MissingOr[int] = MISSING, offset: MissingOr[int] = MISSING, time_range: MissingOr[TimeRange] = MISSING) -> Paginator[Artist] | Paginator[TrackWithSimpleArtist]
Get the current user's top artists or tracks based on calculated affinity.
Required Authorization Scope
Parameters:
-
type(TopItemType) –The type of entity to return.
-
limit(int, default:20) –The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50.
-
offset(int, default:0) –The index of the first item to return. Default: 0 (the first item)
-
time_range(TimeRange, default:Medium Term) –Over what time frame the affinities are computed.
Returns:
-
Paginator[Artist]–A paginator who's items are a list of artists.
-
Paginator[TrackWithSimpleArtist]–A paginator who's items are a list of tracks.
get_users_profile #
follow_playlist #
Add the current user as a follower of a playlist.
Optional Authorization Scopes
PLAYLIST_MODIFY_PUBLIC - required to add the playlist to the current user's public playlists. PLAYLIST_MODIFY_PRIVATE - required to add the playlist to the current user's private playlists.
Parameters:
unfollow_playlist #
unfollow_playlist(playlist_id: str) -> None
Remove the current user as a follower of a playlist.
Optional Authorization Scopes
PLAYLIST_MODIFY_PUBLIC- required to remove the playlist from the current user's public playlists.PLAYLIST_MODIFY_PRIVATE- required to remove the playlist from the current user's private playlists.
Parameters:
-
playlist_id(str) –The ID of the playlist.
get_followed_artists #
get_followed_artists(after: MissingOr[str] = MISSING, limit: MissingOr[int] = MISSING) -> CursorPaginator[Artist]
Get the current user's followed artists.
Required Authorization Scope
Parameters:
-
after(str, default:MISSING) –The last artist ID retrieved from the previous request.
-
limit(int, default:20) –The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50.
Returns:
-
CursorPaginator[Artist]–A paginator who's items are a list of artists.
follow_artists_or_users #
Add the current user as a follower of one or more artists or other Spotify users.
Required Authorization Scope
Parameters:
unfollow_artists_or_users #
Remove the current user as a follower of one or more artists or other Spotify users.
Required Authorization Scope
Parameters:
check_if_user_follows_artists_or_users #
SimpleUser #
A simplified user.
User #
A user.
OwnUser #
A user with additional information.
display_name #
display_name: str | None
The name displayed on the user's profile. None if not available.
country #
country: str | None = None
The country of the user, as set in the user's account profile. An ISO 3166-1 alpha-2 country code. This field is only available when the current user has granted access to the USER_READ_PRIVATE scope.
email #
email: str | None = None
The user's email address, as entered by the user when creating their account. This field is only available when the current user has granted access to the USER_READ_EMAIL scope.
Warning
This email address is unverified; there is no proof that it actually belongs to the user.
explicit_content #
explicit_content: ExplicitContent | None = None
The user's explicit content settings. This field is only available when the current user has granted access to the USER_READ_PRIVATE scope.
product #
product: SubscriptionLevel | None = None
The user's Spotify subscription level. This field is only available when the current user has granted access to the USER_READ_PRIVATE scope.