iositunes

Apple API song "previewUrl" persistence


I'm developing an iOS app and I need to allow the user to play the preview of several songs from iTunes into the app. Now with the lookup API and the adamID I can easily find the previewUrl and get it to play.

I rad API rules and descriptions and it says that I have to keep an URL to the store to allow the user to buy the song, that I can't save the audio and so on, however the only thing I want to do is saving the previewUrl instead of having to look for it every time, since I'm not very used to use API, and apple use to be much strict sometimes I would love to avoid my app to not be accepted.

So can I "statically" use the previewUrl and the trackViewUrl without sending every time a lookup call and parse the result?

{
    "resultCount": 1,
    "results": [
        {
            "someStuff" : "...",
            
            "trackViewUrl": "http://itunes.apple.com/it/album/succede/id480182271?i=480182284&uo=4",
            "previewUrl": "http://a2.mzstatic.com/us/r1000/115/Music/f9/d0/c0/mzm.fvpggyal.aac.p.m4a",
            
            "someMoreStuff" : "...",
            "..." : "..."
        }
    ]
}

Solution

  • yes caching url's is fully supported, there api rules is regarding the actual asset, that is what you can't save and re-play.

    It is ideal cache meta-data which reduces redundant requests and improves performance using cached data.