Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Music Genre API? [closed]

Tags:

php

api

Does anyone know of any Music APIs that let you query with a song name, and return a genre?

i.e. http://foo.bar/api/?song=Baby&artist=Justin+Bieber and have the return be 'Pop'?

I'm making an app that relies on the sole interesting feature being Prediction, yet I need the Genre to determine some extra data!

like image 700
Karan Avatar asked Nov 17 '11 12:11

Karan


2 Answers

You could use the last.fm API: http://www.last.fm/api/show?service=356

Here is an example of the XML returned: http://ws.audioscrobbler.com/2.0/?method=track.getinfo&api_key=b25b959554ed76058ac220b7b2e0a026&artist=cher&track=believe

You have to give it at least the artist and track name & you get tags back, these are very similar to genre but not the same, they are also created by users.

artist=cher&track=believe gives:

<toptags>
<tag>
<name>pop</name>
<url>http://www.last.fm/tag/pop</url>
</tag>
<tag>
<name>dance</name>
<url>http://www.last.fm/tag/dance</url>
</tag>
<tag>
<name>90s</name>
<url>http://www.last.fm/tag/90s</url>
</tag>
<tag>
<name>cher</name>
<url>http://www.last.fm/tag/cher</url>
</tag>
<tag>
<name>female vocalists</name>
<url>http://www.last.fm/tag/female%20vocalists</url>
</tag>
</toptags>

It has some great features like realising when you spelled an artist's name wrong.

like image 151
472084 Avatar answered Oct 21 '22 22:10

472084


You could look at EchoNest, but I don't know whether it will be useful to you: http://developer.echonest.com/docs/v4/song.html

like image 4
Palantir Avatar answered Oct 21 '22 20:10

Palantir