Querying by Spotify ID in Echo Nest API

453 views Asked by At

I've got songs from spotify play lists and need to get their information in EN. Take “All I Want” by Tania Bowra for example.

EN ID(not given):    SOUJWUH13E89D89DED

Spotify ID:          2TpxZ7JUBn3uw46aR7qd6V

Spotify URI:         spotify:track:2TpxZ7JUBn3uw46aR7qd6V

Spotify external ID: AUCR10410001 (isrc)

If I query by the Spotify external ID or the Spotify ID in EN, like

$curl -X GET "http://developer.echonest.com/api/v4/song/profile?api_key={my_api_key}&id=AUCR10410001&bucket=audio_summary" | python -m json.tool

or

$curl -X GET "http://developer.echonest.com/api/v4/song/profile?api_key={my_api_key}&id=2TpxZ7JUBn3uw46aR7qd6V&bucket=audio_summary" | python -m json.tool

the EN API returns this message: "id - Invalid parameter: id must be an Echo Nest id or foreign id".

Or if I query by the Spotify URI, like

$curl -X GET "http://developer.echonest.com/api/v4/song/profile?api_key={my_api_key}&id=spotify:track:2TpxZ7JUBn3uw46aR7qd6V&bucket=audio_summary" | python -m json.tool

I get this response:

{
    "response": {
        "songs": [],
        "status": {
            "code": 0,
            "message": "Success",
            "version": "4.2"
        }
    }
}

which contains no information.

But as Spotify's website says, it should work.

2

There are 2 answers

0
Kyl On BEST ANSWER

It works with "song" modified to "track":

$curl -X GET "http://developer.echonest.com/api/v4/track/profile?api_key={my_api_key}&format=json&id=spotify:track:2TpxZ7JUBn3uw46aR7qd6V&bucket=audio_summary"
0
holmberd On

Replace 'id' with 'track_id' and it will work.

Example:

$curl -X GET "http://developer.echonest.com/api/v4/song/profile?api_key={my_api_key}&track_id=spotify:track:2TpxZ7JUBn3uw46aR7qd6V&bucket=audio_summary" | python -m json.tool