iTunes Music Store API?

I can’t explain why, at least not yet, but I’m looking for a way to search the iTunes Music Store{#XfFSogqWv7s&offerid=78941.10000007&type=3&subid=0} catalog outside of iTunes. Rumors of an iTunes-Google partnership{#1230} have been flying lately, but what I really want is a webservice/API I can use. Yes, Apple offers an affiliate program that supports direct links, but again, they don’t offer an Amazon-style API to search their catalog.

All of this has me thinking about reverse-engineering the iTMS to build the webservice I’m looking for. DVD Jon made news not so long ago with PyMusique, now rewritten as SharpMusique{#63}, but even before that, Jason Rohrer released iTMS-4-all.

Rohrer’s work is more in line with what I’m trying to do, so I’m exploring that concept a little. iTMS-4-all is a simple web browsing interface to the store. Jean-Yves Stervinou explains:

iTunes 4 is a beautiful example of a “specialized browser”. It uses html to render pages with texts and pictures, but it also uses macosX standard GUI elements when appropriate. When you browse the albums/artists, iTunes in fact gets the contents of these lists from a Web server out there at Apple (phobos is its nickname). The format for these lists is XML […]. iTunes reads this XML list then uses a standard list browser to show you the content.

Stervinou describes the entire iTunes store as a REST webservice, but one which Apple has chosen to keep private. Rohrer describes the problems of interacting with the ITMS encrypted content. He (and contributors) were successful, but Apple changed the encryption after iTunes 4.7 was released. It didn’t take long for DVD Jon to get around the change, but it (or something else, I haven’t looked yet) has disabled iTMS-4-all. Too bad, too, because there’s a lot we might be able to do with such a webservice. DownhillBattle.org contemplates some of these uses in their iTMS-4-all announcement (Jason Rohrer is somehow involved with Downhill Battle).

More reading: Free Software Magazine did some poking at iTunes, The g4tv Screensavers crew looks into iTunes Hackery, Apple does offer a very limited iTunes RSS feed generator, XMLHead looks at the structure of iTunes affiliate links, and (update) here’s some talk about the iTMS XML interface before they started encrypting it.