Forums » General Discussion Search

How to get a song ID? New Reply

Author Post
Posts: 3
Registered: Dec 19, 2011

Hi,

I'd like to get audio summaries for different songs...just wondering where I find the song ID's that get passed to the constructor when creating song objects?

thnx

Mika

Posts: 713
Registered: Sep 08, 2008

There are a number of calls that return song IDs including song/search and the playlist APIs. If you want to get the audio summary for a particular song, search for it and add the audio_summary to the buckets. Here's a pythonic example:

> from pyechonest import song
>res=song.search(artist='weezer', title='el scorcho', buckets=['audio_summary'])
> res[0]
     <song - El Scorcho>
> res[0].audio_summary
      {u'key': 8,  u'energy': 0.705673046276463, u'tempo': 79.534, u'mode': 1, u'time_signature': 4, 
      u'duration': 255.97342, u'loudness': -8.496,
      u'audio_md5': u'd09648a7b96f8d8e51f5b67d27b3003b', 
      u'danceability': 0.46433030793175034}

Reply to this Thread

You must log in to post a reply.