Spotify-Audio-analysis-API can get the the json file on https://spotify-audio-analysis.glitch.me/
it can also get the songs id in playlist or current playing song
you can get everything in spotify_api.ipynb
- step1. to get id and secret in spotify development dashboard
https://developer.spotify.com/dashboard/login - step2. if you want to get current playing song need to get key on
https://developer.spotify.com/documentation/web-api/reference/player/get-the-users-currently-playing-track/
from sung_spotify import SpotifyAPI
client_id = '7b53768ec42646b08540bc929483ef5e'
client_secret = 'ca356e9b3e6f4216af17442bbbd48b0d'
spotify = SpotifyAPI(client_id, client_secret)
spotify.perform_auth()
access_token = spotify.access_token
singer = '周杰倫'
song_name = '簡單愛'
track_id = spotify.search_id(singer,song_name)
print(singer,song_name,track_id)
200 in step one
周杰倫 簡單愛 5Jtg0qcTKMHq3HjPVGRFAi
#use id to search Spotify Audio analysis
#singer & song_name only use to save file
spotify.analysis(singer,song_name,track_id)
200 in audio-analysis
success save audio-analysis_周杰倫_簡單愛.json
you can copy play list id on spotify app
spotify.playlist_songid('37i9dQZF1DX4sWSpwq3LiO')
200
save playlist as Peaceful Piano.csv
key = 'BQBl9AfhhgYBqHFMFaS_q4H1hA0mRi_9pJ-co4JYNYT6zmGshYaY2tLDiU5Hns6f8DFLbZ6iz5oQKKXR8wKDjEIusoPiVI5HhRlxRLRqXo0dBYM8ixS7-qSyPgxcXSjcN4McpWWpCxRZvOPXh-ANzIPLTPzPwQ'
singer,song_name,track_id = spotify.current_song(key)
print(singer,song_name,track_id)
200 in step one
Avril Lavigne Head Above Water 7gY3cyGcB2wnk2xDXiA0pe