[GH-ISSUE #354] audio analysis features #205

Closed
opened 2026-02-27 23:21:22 +03:00 by kerem · 5 comments
Owner

Originally created by @TheVitagor on GitHub (Feb 18, 2019).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/354

Hello, is there any way to get a deep audio analysis with these tools? I mean, can you get a time evolution of, for example, the timbre or loudness like you can do with the Spotify API?

Thank you.

Originally created by @TheVitagor on GitHub (Feb 18, 2019). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/354 Hello, is there any way to get a deep audio analysis with these tools? I mean, can you get a time evolution of, for example, the timbre or loudness like you can do with the Spotify API? Thank you.
kerem closed this issue 2026-02-27 23:21:23 +03:00
Author
Owner

@philknock commented on GitHub (May 9, 2019):

Hello,

I'm new to Spotipy and am interested in this too. This is what I've found out about it so far, I hope this is helpful.

Spotipy provides you everything that the Spotify API does through function calls.

You can use the audio_analysis and audio_features functions to get detailed audio information about a particular track.

These functions contain longs data strings used to describe various attributes track as it evolves over time. I'm not sure if there are functions available to parse this data, but that might be up to you the developer.

I've found two documentation resources that provide a little more info on these data strings
https://developer.spotify.com/documentation/web-api/reference/tracks/get-audio-analysis/
http://docs.echonest.com.s3-website-us-east-1.amazonaws.com/_static/AnalyzeDocumentation.pdf

Hope this helps!

<!-- gh-comment-id:490998074 --> @philknock commented on GitHub (May 9, 2019): Hello, I'm new to Spotipy and am interested in this too. This is what I've found out about it so far, I hope this is helpful. Spotipy provides you everything that the Spotify API does through function calls. You can use the [audio_analysis](https://spotipy.readthedocs.io/en/latest/#spotipy.client.Spotify.audio_analysis) and [audio_features](https://spotipy.readthedocs.io/en/latest/#spotipy.client.Spotify.audio_features) functions to get detailed audio information about a particular track. These functions contain longs data strings used to describe various attributes track as it evolves over time. I'm not sure if there are functions available to parse this data, but that might be up to you the developer. I've found two documentation resources that provide a little more info on these data strings https://developer.spotify.com/documentation/web-api/reference/tracks/get-audio-analysis/ http://docs.echonest.com.s3-website-us-east-1.amazonaws.com/_static/AnalyzeDocumentation.pdf Hope this helps!
Author
Owner

@markkohdev commented on GitHub (May 16, 2019):

Hey @TheVitagor and @philknock the audio analysis data is available through the spotipy client - https://spotipy.readthedocs.io/en/latest/#spotipy.client.Spotify.audio_analysis

You can see some usage examples of this functionality here - https://github.com/markkohdev/spotify-api-starter

<!-- gh-comment-id:493198098 --> @markkohdev commented on GitHub (May 16, 2019): Hey @TheVitagor and @philknock the audio analysis data is available through the spotipy client - https://spotipy.readthedocs.io/en/latest/#spotipy.client.Spotify.audio_analysis You can see some usage examples of this functionality here - https://github.com/markkohdev/spotify-api-starter
Author
Owner

@kinmeng commented on GitHub (Aug 1, 2019):

Hello,

I'm new to Spotipy and am interested in this too. This is what I've found out about it so far, I hope this is helpful.

Spotipy provides you everything that the Spotify API does through function calls.

You can use the audio_analysis and audio_features functions to get detailed audio information about a particular track.

These functions contain longs data strings used to describe various attributes track as it evolves over time. I'm not sure if there are functions available to parse this data, but that might be up to you the developer.

I've found two documentation resources that provide a little more info on these data strings
https://developer.spotify.com/documentation/web-api/reference/tracks/get-audio-analysis/
http://docs.echonest.com.s3-website-us-east-1.amazonaws.com/_static/AnalyzeDocumentation.pdf

Hope this helps!

Hey @philknock @markkohdev @TheVitagor , I am new to the spotify API and Spotipy. I have read the documentation that you all have suggested and haven't found any solutions to my problem yet so I thought I'd ask here. I've tried the audio_analysis method call like as stated here: https://spotipy.readthedocs.io/en/latest/#spotipy.client.Spotify.audio_analysis .

However, it returns a long string of output as you've said. For a single song, the term 'timbre', for example appeared about 620 times. What could be the issue with my code? If that's the intended output, how can I extract the key results from the long string of output?

My minimum reproducible code for the said long output can be found here: https://stackoverflow.com/questions/57290869/am-i-calling-spotify-apis-method-for-audio-analysis-correctly/57291434?noredirect=1#comment101105442_57291434

Any help is appreciated. Thanks!

<!-- gh-comment-id:517388873 --> @kinmeng commented on GitHub (Aug 1, 2019): > Hello, > > I'm new to Spotipy and am interested in this too. This is what I've found out about it so far, I hope this is helpful. > > Spotipy provides you everything that the Spotify API does through function calls. > > You can use the [audio_analysis](https://spotipy.readthedocs.io/en/latest/#spotipy.client.Spotify.audio_analysis) and [audio_features](https://spotipy.readthedocs.io/en/latest/#spotipy.client.Spotify.audio_features) functions to get detailed audio information about a particular track. > > These functions contain longs data strings used to describe various attributes track as it evolves over time. I'm not sure if there are functions available to parse this data, but that might be up to you the developer. > > I've found two documentation resources that provide a little more info on these data strings > https://developer.spotify.com/documentation/web-api/reference/tracks/get-audio-analysis/ > http://docs.echonest.com.s3-website-us-east-1.amazonaws.com/_static/AnalyzeDocumentation.pdf > > Hope this helps! Hey @philknock @markkohdev @TheVitagor , I am new to the spotify API and Spotipy. I have read the documentation that you all have suggested and haven't found any solutions to my problem yet so I thought I'd ask here. I've tried the audio_analysis method call like as stated here: https://spotipy.readthedocs.io/en/latest/#spotipy.client.Spotify.audio_analysis . However, it returns a long string of output as you've said. For a single song, the term 'timbre', for example appeared about 620 times. What could be the issue with my code? If that's the intended output, how can I extract the key results from the long string of output? My minimum reproducible code for the said long output can be found here: https://stackoverflow.com/questions/57290869/am-i-calling-spotify-apis-method-for-audio-analysis-correctly/57291434?noredirect=1#comment101105442_57291434 Any help is appreciated. Thanks!
Author
Owner

@markkohdev commented on GitHub (Aug 13, 2019):

Hey @kinmeng, I don't think it's a problem with your code -- The audio analysis data returned by spotipy is documented in the spotify API reference.
It's essentially a big JSON string containing low-level information which breaks down the track into "beats", "bars", "audio segments" etc along with some extra information about those time windows. What you do with that information is up to you :) (Side note: Ignore the codestring, it's not really useful for end-users and we should probably strip it from the audio analysis response tbh).
Hopefully this answers your question!

<!-- gh-comment-id:520671161 --> @markkohdev commented on GitHub (Aug 13, 2019): Hey @kinmeng, I don't think it's a problem with your code -- The audio analysis data returned by spotipy is documented in the [spotify API reference](https://developer.spotify.com/documentation/web-api/reference/tracks/get-audio-analysis/). It's essentially a big JSON string containing low-level information which breaks down the track into "beats", "bars", "audio segments" etc along with some extra information about those time windows. What you do with that information is up to you :) (Side note: Ignore the codestring, it's not really useful for end-users and we should probably strip it from the audio analysis response tbh). Hopefully this answers your question!
Author
Owner

@stephanebruckert commented on GitHub (Jan 12, 2020):

Answered by @markkohdev, thanks. This codestring is also returned in the web API https://developer.spotify.com/console/get-audio-analysis-track/?id=06AKEBrKUckW0KREUWRnvT

<!-- gh-comment-id:573405164 --> @stephanebruckert commented on GitHub (Jan 12, 2020): Answered by @markkohdev, thanks. This `codestring` is also returned in the web API https://developer.spotify.com/console/get-audio-analysis-track/?id=06AKEBrKUckW0KREUWRnvT
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#205
No description provided.