Search code examples
phpiositunesdynamic-linkingaffiliate

Linking to specific tracks through the iTunes affiliate program


My iPhone app links to songs on the iTunes store, through the linkshare affiliate program, up until this point I had been creating the links manually - which albeit is time consuming but I had no problem previously. The application has new songs every day and manually creating the links is getting out of hand. However, having read through all the affiliate program documentation I cannot find a way of linking to a specific track on the store - without using the link builder. The only data on the song I have is the track name, artist name and album name.

Obviously I can use the search api, but that does not seem to enable the affiliate linking - so I cannot benefit from the sales.

http://itunes.apple.com/search?term='.$tracksearch.'&country=gb&media=music&entity=musicTrack&attribute=musicTrackTerm&limit=1

So my question is how would I go about linking to a specific track, through the linkshare affiliate program according to the three pieces of data I have?

(I am using PHP for any basic data interactions - just in case anyone offers any coded methods - bearing in mind i'd like to produce the link on the server so my app can simply fetch the data from there.)


Solution

  • Obviously I can use the search api, but that does not seem to enable the affiliate linking - so I cannot benefit from the sales.

    The Search API is exactly the tool you want to use. The API will return you the link you need, it is up to you to affiliate encode the link after you have that information.

    The encoding process can be found in the documentation here: http://www.apple.com/itunes/affiliates/resources/documentation/linking-to-the-itunes-music-store.html