The Echo Nest is a database of music information and seems to have been acquired by Spotify in 2014. The API of music information is open to the public. http://the.echonest.com/
http://developer.echonest.com/client_libraries.html
Centos 7.2 Python 2.7 This time I tried using Pyechonest
easy_install -U pyechonest
http://developer.echonest.com/ Create a free account here. You will receive an email confirming your account activation.
You should see Your API Key:
on your Profile page
https://developer.echonest.com/account/profile
Show artists similar to Duke Ellington instead of Bikini Kill.
vi echotest.py
echotest1.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
from pyechonest import config
config.ECHO_NEST_API_KEY="YOURAPIKEY"
from pyechonest import artist
de = artist.Artist('duke ellington')
print "Artists similar to: %s:" % (de.name,)
for similar_artist in de.similar: print "\t%s" % (similar_artist.name,)
Artists similar to: Duke Ellington:
Count Basie
The Duke Ellington Band
Earl Hines
Woody Herman
Count Basie Orchestra
Stan Kenton
Benny Carter
Lionel Hampton
Benny Goodman
Teddy Wilson
Johnny Hodges
Fletcher Henderson
Buddy Rich
Duke Ellington Orchestra
Harry James
The result seems to emphasize chronological correlation.
echotest2.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
from pyechonest import config
config.ECHO_NEST_API_KEY="YOURAPIKEY"
from pyechonest import artist
a = artist.Artist('duke ellington')
print a.id
ARMI36C1187B99A462
echotest3.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
from pyechonest import config
config.ECHO_NEST_API_KEY="YOURAPIKEY"
from pyechonest import song
de_results = song.search(artist='duke ellington', title='perdido')
perdido = de_results[0]
print perdido.artist_location
print 'tempo:',perdido.audio_summary['tempo'],'duration:',perdido.audio_summary['duration']
{u'latitude': 47.3917, u'location': u'Washington D.C. ', u'longitude': -121.5708}
tempo: 129.606 duration: 188.4
I wrote it because I wanted more articles on music APIs. http://qiita.com/hideyuki/items/8b5c6b02d0784aa25fd2
Recommended Posts