bioinformaticsgx / Spotify-Music-Data-Analysis

Music Data Analysis
https://uwgabrielxu.github.io/Spotify-Music-Data-Analysis/
MIT License
99 stars 12 forks source link

Hey man loved the data visualization project. #2

Open shashwatnegi69 opened 4 years ago

shashwatnegi69 commented 4 years ago

There seeems to be a problem in using the spotify api. Also the access token has expired. I'm new to this so would you mind explaining me what should i do in order to get the dataset. Also right now the individual year csv files generated in the first code are empty with nothing but the column heading.

I hope you would help me with my query.

chaksoham commented 4 years ago

Try using spotipy a python wrapper over spotify api. Create your own access token by going to the spotify developer website and use it. The data is coming empty because the api's are getting any data. (401 error code I guess )

shashwatnegi69 commented 4 years ago

Ok, so i

Try using spotipy a python wrapper over spotify api. Create your own access token by going to the spotify developer website and use it. The data is coming empty because the api's are getting any data. (401 error code I guess )

Ok, so I created my own access token and replaced it, but the csv files which are being generated are still empty. It is not showing any error just blank files

chaksoham commented 4 years ago

CLIENT_ID = CLIENT_SECRET = token = util.oauth2.SpotifyClientCredentials(client_id=CLIENT_ID, client_secret=CLIENT_SECRET)

cache_token = token.get_access_token() spotify = spotipy.Spotify(cache_token)

results = spotify.artists(artist_ids)

check what results give read the documentation of the various api to see what to send https://github.com/chaksoham/Music-Analysis/blob/master/pds-final-project.ipynb see here how I have used it, in my repo.