There is a guide to make your own Spotify Wrapped .Document which has two python a block shared. One of them to use Spotify developer api and other one about to how to use it.
album']['name'] artist = data['album']['artists']['name'] spotify_url = data['external_urls']['spotify'] track_info = [name, album, artist, spotify_url] return track_info def list_tracks(self, track_ids_list): sp = self.spotify_connection() tracks = [] for i in range(len(track_ids_list)): time.sleep(1) track = self.get_track_info(track_ids_list[i]) tracks.append(track) return tracks def create_df_list(self, your_tracks_list): df = pd.DataFrame(your_tracks_list,columns = ['name','album','artist','spotify_url']) return df def load_csv(self, df): df.to_csv('spotify_wrapped.csv',header=True,index=False) Above python script handle getting data with api and process it. Your main script will be below python code block. spotify_wrapped.py from spotify_api_data import SpotifyAPI spotify_api = SpotifyAPI(client_id="Your Client ID", client_secret="Your Client Scret", redirect_uri=" scope="user-top-read")
id: 778753ca168c4b4693c58736b748f654 - page: 1
get_top_tracks(time_range="long_term") track_ids = spotify_api.get_track_ids(top_tracks_long) wrapped_list = spotify_api.list_tracks(track_ids) df_track_list = spotify_api.create_df_list(wrapped_list) load_csv_file = spotify_api.load_csv(df_track_list) To Take ID and Secret: 1-You must have a spotify account 2- go this link and login 3-create a app You can define your redirect_uri whatever you want. I choose as
id: 1992cdbca30e30b96eebc0e5b0fe88b1 - page: 2