From 5e3cc1f546712a93f5ce2ed4742fb06584c69627 Mon Sep 17 00:00:00 2001 From: Hugh Rawlinson Date: Sat, 15 Oct 2016 14:41:48 +0200 Subject: [PATCH] Add Audio-Analysis Endpoint Method --- spotipy/client.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spotipy/client.py b/spotipy/client.py index c3b4b69..ff55b12 100644 --- a/spotipy/client.py +++ b/spotipy/client.py @@ -712,6 +712,14 @@ class Spotify(object): else: return results + def audio_analysis(self, id): + ''' Get audio analysis for a track based upon its Spotify ID + Parameters: + - id - a track URIs, URLs or IDs + ''' + id = self._get_id('track', id) + return self._get('audio-analysis/'+id) + def _get_id(self, type, id): fields = id.split(':') if len(fields) >= 3: