"Interesting stuff of the Technology, Products and Web 2.0..."

Tuesday, August 05, 2008

Yahoo! Launches Music APIs

image Jim from Yahoo! Music Team has created a bare-bones PHP application, for browsing and playing music videos, so you can see some of the cool things you can do with the Music API. You can download the PHP source code here, and preview it here. You'll probably want to look at the Music API documentation while perusing the source code.

There are a large number of API calls available in the Music API. There are few APIs which one will probably use frequently like search for artists, getting artist info,, getting video thumbnail images, play video, browse similar artists etc…

Here are some final tips by Jim to help you get the most out of the Y! Music APIs.

1) Authentication is only needed for a small part of the API, involving user ratings. If you simply wish to navigate through the artist discographies and play videos, you don't need full authentication, which makes using the API much simpler -- you only need a valid application ID.

2) The API has a rate limit of 5K queries per day. This only applies to the calls that return data, not the image URLs. A good way to work around this is to locally cache results for 24 hours - you'll find for most apps, the number of unique queries you need to make is well under 5K. This also greatly improves the performance of the app, since cached API results are delivered much faster.

3)It’s good to use these APIs with server-side scripts, such as PHP, rather than client-side scripts, such as Javascript & AJAX. This is to have better performance by implementing server-side caching (as described in tip 2). If you want to set up an AJAX app,  then it’s better to set up a proxy for these services--to implement caching.

1 comment:

jbum said...

This is an extract from Jim's YDN Blog article, which you'll find (in full) here:

http://developer.yahoo.net/blog/archives/2008/08/jamming_with_th.html