iTunes has a nice public music search API which offers 30-second previews and detailed information about music albums and tracks. However I could not play these previews on Android or Chrome browser —but it was playing perfectly in iOS apps and OS X Safari browser. (See sample audio here.)
With the help of a little bit of packet capturing I found out the reason why iTunes previews cannot be played outside of iOS and OS X. Apple protects music previews with User-Agent header. iOS and QuickTime Safari plugin uses AV Foundation framework which uses CoreMedia framework and it does requests with the following User-Agent header:
AppleCoreMedia/1.0.0.9B206 (iPad; U; CPU OS 5_1_1 like Mac OS X; en_us)
If you would be able to spoof this header, you will get the preview audio anywhere such as Android or download them. (I once tried to make a Song Pop clone with it.) Although downloading iTunes previews are illegal and restricted by Apple, getting noticed seems unlikely, it is up to you.
Leave your thoughts