Quantcast
Channel: The Echo Nest Developer Forum
Viewing all articles
Browse latest Browse all 1582

Getting an empty list for tracks

$
0
0

The proper way to use requests might be something like this,

r = requests.get('http://developer.echonest.com/api/v4/song/search', 
                params={'api_key':api_key, 'results':1, 'artist':artist, 'title':title, 'bucket':['audio_summary', 'id:spotify', 'tracks']})

You can then get the data from your response through the json() function on the response itself,

songs = r.json()['response']['songs']

I suspect you're having problems with URL encoding, and passing in a params dictionary instead of trying to build the URL yourself is a good way to make sure you don't need to worry about it. It might also be worthwhile to install Pyen, our Python JavaScript wrapper, and use that instead.


Viewing all articles
Browse latest Browse all 1582

Trending Articles