Toplists

class spotify.ToplistBrowser(type, region[, callback, userdata])

A ToplistBrowser object.

The browser is a sequence of spotify.Album, spotify.Artist or spotify.Track depending on the type argument given when creating the object.

Parameters:
  • type – one of 'albums', 'artists' or 'tracks'.
  • region

    one of:

    • 'all' for global toplists
    • a two letters country code (e.g 'SE', 'FR')
    • 'current' for the current logged in user’s toplists
    • a spotify.User object to see this user’s toplists
  • callback – a function with signature (ToplistBrowser tb, userdata)
  • userdata – any object you would like to access in the callback
is_loaded()
Returns:True if the object’s metadata is loaded.
error()
Returns:None or an error message associated with the error.