linking to a song in the iTunes music store

mgm_03

Registered
For those who do web design and know how to link an address to a mapquest map ( or other mapping service).....is there an ITunes API or method by which I can add a link to a song and when clicked, iTunes is launched and then goes to that song in the iTunes music store ?
 
You can right-click (or command-click) any song in the iTunes Music Store and select "Copy iTunes Music Store URL", then simply use that as the link in your web page.
 
There's also a way to do it using certain tags within the URL (for artist, song name, album name, etc. {or a combo of those}). I haven't messed with it in a few months, but it has worked well for a while (meaning through updates). I used it on my website for a music list, which had its content parsed from the itunes XML file.

How I use it:
PHP:
# SONG NAME (by song name and artist name)
<a href=\"itms://phobos.apple.com/WebObjects/MZSearch.woa/wa//advancedSearchResults?songTerm=".(isset($song["Name"])?$song["Name"]:NULL)."&amp;artistTerm=".(isset($song["Artist"])?$song["Artist"]:NULL)."\" title=\"Find the song ".(isset($song["Name"])?$song["Name"]:NULL)." by ".(isset($song["Artist"])?$song["Artist"]:NULL)." at the iTunes Music Store\"><img src=\"store.gif\" alt=\"iTMS\" /></a>

# ARTIST (by name)
<a href=\"itms://phobos.apple.com/WebObjects/MZSearch.woa/wa//advancedSearchResults?artistTerm=".(isset($song["Artist"])?$song["Artist"]:NULL)."\" title=\"Find songs by ".(isset($song["Artist"])?$song["Artist"]:NULL)." at the iTunes Music Store\"><img src=\"store.gif\" alt=\"iTMS\" /></a>

# ALBUM (by album name and artist name)
<a href=\"itms://phobos.apple.com/WebObjects/MZSearch.woa/wa//advancedSearchResults?albumTerm=".(isset($song["Album"])?$song["Album"]:NULL)."&amp;artistTerm=".(isset($song["Artist"])?$song["Artist"]:NULL)."\" title=\"Find ".(isset($song["Album"])?$song["Album"]:NULL)." by ".(isset($song["Artist"])?$song["Artist"]:NULL)." from the iTunes Music Store\"><img src=\"store.gif\" alt=\"iTMS\" /></a>


An HTML version using the song name and artist name would look something like this:
Code:
<a href="itms://phobos.apple.com/WebObjects/MZSearch.woa/wa//advancedSearchResults?songTerm="**SONGNAMEHERE**"&amp;artistTerm="**ARTISTNAMEHERE**" title="Find the song "**SONGNAMEHERE**" by "**ARTISTNAMEHERE**" at the iTunes Music Store\">**SONGNAMEHERE**</a>


Example (link to song name "Dani California" using song name only):

 
Back
Top