4.8 - Recommendations
Last updated
Was this helpful?
Last updated
Was this helpful?
When a user search for something the application does a request for both tracks
and artists
. The recommendations are based on some of the audio features the track has. First we have to do another request to get the audio features. Currently the code only supports recommendations based on one track. This is because if we were be doing the recommendations on all the tracks the application would make too many request in a short time period for the Spotify API to handle and it will be prompted with an too many request error.
When we have the audio features we run the songs through the mood assignment code. This will return a mood. Every mood has a min
and max
value for the danceability
, energy
and valence
endpoints. Based on these values we can request recommendations by putting them inside the URL: &min_feature=
, &max_feature=
These recommendations will be rendered on the page.