views:

2939

answers:

4

Hi, I am trying to set up an application in which users will be able to stream music. When the user is streaming a MP3, I'd like to set up a link to the iTunes store to buy the MP3.

How can I do that? I feel like there should be some simple way of doing so using the song title and artist name, am I mistaking?

Thanks

+3  A: 

You can experiment with the iTMS Link Maker that Apple provides and see how the links are formed. In addition, here is the iTMS Link Maker FAQ.

See this blog post about how to query the iTMS Link Maker automatically. Basically, you can query the iTMS Link Maker and get an XML document back that your application can process.

Naaff
Thanks ! But can I access this to generate link dynamically?
marcgg
Yup. Just added a link.
Naaff
Do you know if a itms: link will work on iphone?
marcgg
Yes, itms: links work on the iPhone and the iPod touch. You can try it yourself by navigating to the iTMS Link Maker on your iPhone and following the process through. Click the link at the end and it opens up properly.
Naaff
thanks a lot ! accepted
marcgg
+1  A: 

Exact duplicate of this question which has a very good answer.

Roger Nolan
Interesting approach. A few problems that I see, however: (1) the link isn't direct -- it's a redirect that would open up Safari as an intermediate step and (2) it provides no way to verify results before you create the link whereas the XML approach can tell you if the album, artist, app, etc. has a link *before* you present it to the user. Still, valid point about this being a duplicate.
Naaff
A: 

Google for Itunes Music Store API!

results returned in Json!

Just parse and go!

+1  A: 

The iTunes Store Web Service Search API (pdf), although old and incomplete, documents how to search for content in the iTunes store and returns a JSON string with results.

The iTunes Store Web Service Search API allows you to place search fields in your website to search for content within the iTunes Store. You can search for a variety of iTunes Store content; including movies, podcasts, music, music videos, audiobooks, and TV shows. You can also call an ID-based lookup request to create mappings between your content library and the iTunes Store content library.

Queries are sent to base url:

http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStoreServices.woa/wa/wsSearch?parameterkeyvalue

Where parameterkeyvalue can be one or more parameter key and value pairs indicating the details of your query.

prendio2