Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Migrate EchoNest API analyzer to Spotify

I use to use echonest analyzer to upload tracks and get some audio characteristics out of them.

I did this by sending a curl request.

I realise the API has now mitigated to Spotify and I wonder if I can still upload tracks to analyze, instead of only analyzing tracks given their Spotify ID.

I used to use this method:

$post = array(
     "url"=>$title,
     "api_key"=>"myAPI",
     "format"=>"json"
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, "http://developer.echonest.com/api/v4/track/upload");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post); 
$response = curl_exec($ch);

$result=json_decode($response,true);

$status=$result['response']['track']['status'];

Is there a similar way to do this with Spotify? Thanks.

I can use an offline feature analyzer, but I have used EchoNest Analyzer for training my original model here.

like image 392
dorien Avatar asked Jul 25 '16 15:07

dorien


1 Answers

Spotify no longer have the upload-analysis functionality, but we do have two API endpoints that may be of interest.

You can get high level audio features using our Audio Features endpoint. It provides information like 'danceablility' and 'instrumentalness', and a few others.

If you need more detailed information, you can use the Audio Analysis endpoint, which provides the low level output of the tool that Echonest used for the information retrieval you mentioned.

Hopefully one of these two endpoints could work for you. I should point out though that we don't have any upload functionality, both of these endpoints require a Spotify Track ID, and for the track to exist on Spotify.

If you need to be able to run similar feature extraction on tracks you've already got that aren't on Spotify, some of the former Echonest people have recommended Amen to me as a similar program to the Echonest analyser, so perhaps that would be useful to you?

I hope this helps!

like image 98
Hugh Rawlinson Avatar answered Nov 03 '22 18:11

Hugh Rawlinson