Skip to content

sungbohsun/Spotify-Audio-analysis-API

Repository files navigation

Spotify-Audio-analysis-API

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

GITHUB

you can get everything in spotify_api.ipynb

set id & secret

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

use singer, song_name to get song_id

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

#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

get spotify playlist song_name, singer, song_id

you can copy play list id on spotify app

spotify.playlist_songid('37i9dQZF1DX4sWSpwq3LiO')
200 
save playlist as Peaceful Piano.csv

get current playing song singer, song_name, song_id

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published