spotifywebapipython.models.userprofile

Spotify Web API User Profile object.

Information about the user from their account profile.

UserProfile(root: dict = None)

Initializes a new instance of the class.

Arguments:
  • root (dict): Spotify Web API JSON response in dictionary format, used to load object attributes; otherwise, None to not load attributes.
Country: str

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.

Example: US

EMail: str

The user's email address, as entered by the user when creating their account. Important! This email address is unverified; there is no proof that it actually belongs to the user.

This field is only available when the current user has granted access to the user-read-email scope.

Example: johnsmith@example.com

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: str

The user's Spotify subscription level: premium, free, etc.

The subscription level open can be considered the same as free.

This field is only valid when the current user has granted access to the user-read-private scope; otherwise, it is set to unknown.

def ToDictionary(self) -> dict:

Returns a dictionary representation of the class.

def ToString(self) -> str:

Returns a displayable string representation of the class.