Search code examples
apispotifyechonest

Echo Nest API: limit tracks by one bucket only


I'd like to search the Echo Nest API for tracks which match various criteria, and get Spotify and WhoSampled IDs for these tracks. Importantly, though, I only want tracks which actually have a Spotify ID. I can use limit for this, but limit will also limit the returned tracks to those which have both a Spotify ID and a WhoSampled ID, which will dramatically reduce the number of results I get. Can I limit a query to tracks with Spotify IDs, and also optionally include WhoSampled IDs if they are present?


Solution

  • http://developer.echonest.com/api/v4/song/search?api_key=**your_api_key**&format=json&&artist=radiohead&title=karma%20police&bucket=id:spotify&bucket=tracks
    

    Should give you echonest songs that have spotify tracks associated. If you want to get whosample ids for the songs add

    &bucket=id:whosampled to end of the query above

    You can further limit the number of results with the limit parameter