Search API 官方文档 可以用了查看自己的app
Search API
|
October 24, 2012 - HTTPS is now supported for Search and Lookup requests. Please update your processes to use https or follow a redirect from http. |
Table of Contents
- Overview
- Searching the iTunes Store
- Notes
- Search Examples
- Lookup Examples
- Understanding Search Results
- Caching Architecture
- Legal
Overview
The Search API allows you to place search fields in your website to search for content within the iTunes Store, App Store, iBookstore and Mac App Store. You can search for a variety of content; including apps, ebooks, 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 digital catalog. Terms and conditions apply.
The Affiliate Program allows you to earn a commission on qualifying revenue generated by clicks initiated from your website or app into the iTunes Store, App Store, iBookstore, and Mac App Store. For more information on the Affiliate Program, see http://www.apple.com/itunes/affiliates.
Searching
To search for content from a field in your website and display the results in your website, you must create a search field that passes a fully-qualified URL content request to the iTunes Store, parse the JavaScript Object Notation (JSON) format returned from the search, and display the results in your website.
The fully-qualified URL must have the following format:
https://itunes.apple.com/search?parameterkeyvalue
Where parameterkeyvalue can be one or more parameter key and value pairs indicating the details of your query.
To construct a parameter key and value pair, you must concatenate each parameter key with an equal sign (=) and a value string. For example:key1=value1. To create a string of parameter key and value pairs, you must concatenate each pair using an ampersand (&). For example:
key1=value1&key2=value2&key3=value3
Note: When creating search fields and scripts for your website, you should use dynamic script tags for your xmlhttp script call requests. For example:
<script src="https://.../search?parameterkeyvalue&callback="{name of JavaScript function in webpage}"/>
The following table defines the parameter keys and values you can specify to search for content within the iTunes Store, App Store, iBookstore and Mac App Store:
| Parameter Key | Description | Required | Values | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| term | The URL-encoded text string you want to search for. For example: jack+johnson. | Y |
Any URL-encoded text string. Note: URL encoding replaces spaces with the plus (+) character and all characters except the following are encoded: letters, numbers, periods (.), dashes (-), underscores (_), and asterisks (*). |
||||||||||||||||||||
| country |
The two-letter country code for the store you want to search. The search uses the default store front for the specified country. For example: US. The default is US. |
Y | See http://en.wikipedia.org/wiki/ ISO_3166-1_alpha-2 for a list of ISO Country Codes. | ||||||||||||||||||||
| media |
The media type you want to search for. For example: movie. The default is all. |
N | movie, podcast, music, musicVideo, audiobook, shortFilm, tvShow, software, ebook, all | ||||||||||||||||||||
| entity |
The type of results you want returned, relative to the specified media type. For example: movieArtist for a movie media type search. The default is the track entity associated with the specified media type. |
N |
The following entities are available for each media type:
|
||||||||||||||||||||
| attribute |
The attribute you want to search for in the stores, relative to the specified media type. For example, if you want to search for an artist by name specify entity=allArtist&attribute=allArtistTerm. In this example, if you search for term=maroon, iTunes returns "Maroon 5" in the search results, instead of all artists who have ever recorded a song with the word "maroon" in the title. The default is all attributes associated with the specified media type. |
N |
The following attributes are available for each media type:
|
||||||||||||||||||||
| callback | The name of the Javascript callback function you want to use when returning search results to your website. For example: wsSearchCB. | Y, for cross-site searches | wsSearchCB | ||||||||||||||||||||
| limit |
The number of search results you want the iTunes Store to return. For example: 25. The default is 50. |
N | 1 to 200 | ||||||||||||||||||||
| lang |
The language, English or Japanese, you want to use when returning search results. Specify the language using the five-letter codename. For example: en_us. The default is en_us (English). |
N | en_us, ja_jp | ||||||||||||||||||||
| version |
The search result key version you want to receive back from your search. The default is 2. |
N | 1, 2 | ||||||||||||||||||||
| explicit |
A flag indicating whether or not you want to include explicit content in your search results. The default is Yes. |
N | Yes, No |
Notes
- It is critical to encode your URLs correctly in order to be commissioned for affiliate links. Notes on affiliate encoding raw links can be found in theAdvanced Affiliate Linking document.
- To improve response times, minimize the number of search results the Search API returns by specifying an appropriate value for the limit parameter key.
- Large websites should set up caching logic for the search and lookup requests sent to the Search API. For an illustration, see Caching Architecture later in this document.
Search Examples
The following are examples of fully-qualified URLs for specific search requests:
To search for all Jack Johnson audio and video content (movies, podcasts, music, music videos, audiobooks, short films, and tv shows), your URL would look like the following:
To search for all Jack Johnson audio and video content and return only the first 25 items, your URL would look like the following:
To search for only Jack Johnson music videos, your URL would look like the following:
https://itunes.apple.com/search?term=jack+johnson&entity=musicVideo
To search for all Jim Jones audio and video content and return only the results from the Canada iTunes Store, your URL would look like the following:
To search for applications titled "Yelp" and return only the results from the United States iTunes Store, your URL would look like the following:
https://itunes.apple.com/search?term=yelp&country=us&entity=software
Lookup Examples
You can also create a lookup request to search for content in the stores based on iTunes IDs, UPCs/ EANs, and All Music Guide (AMG) IDs. ID-based lookups are faster and contain fewer false-positive results.
The following are examples of fully-qualified URLs for specific lookup requests:
Look up Jack Johnson by iTunes artist ID:
Look up Yelp Software application by iTunes ID:
Look up Jack Johnson by AMG artist ID:
Look up multiple artists by their AMG artist IDs:
Look up all albums for Jack Johnson:
Look up multiple artists by their AMG artist IDs and get each artist's top 5 albums:
https://itunes.apple.com/lookup?amgArtistId=468749,5723&entity=album&limit=5
Look up multiple artists by their AMG artist IDs and get each artist's 5 most recent songs:
https://itunes.apple.com/lookup?amgArtistId=468749,5723&entity=song&limit=5&sort=recent
Look up an album or video by its UPC:
Look up an album by its UPC, including the tracks on that album:
https://itunes.apple.com/lookup?upc=720642462928&entity=song
Look up an album by its AMG Album ID:
Look up a Movie by AMG Video ID:
Look up a book by its 13 digit ISBN:
Understanding Search Results
The Search API returns your search results in JavaScript Object Notation (JSON) format. JSON is built on two structures:
- A collection of name/value pairs, also known as an object; this concept is similar to a Java Map object, a Javascript Dictionary, or a Pearl/Ruby hash. An object is an unordered set of name/value pairs, beginning with a left brace ( { ) and ending with a right brace ( } ). Each name is surrounded by double-quotes and followed by a colon ( : ); the name/value pairs are separated by commas ( , ).
- An ordered list of values, also known as an array. An array is an ordered collection of values, beginning with a left bracket ( [ ) and ending with a right bracket ( ] ). Values are separated by commas ( , ).
All JSON results are encoded as UTF-8. For more information on JSON, please see http://www.json.org.
The following example displays the JSON results for a song in the iTunes Store:
{"wrapperType":"track",
"kind":"song",
"artistId":909253,
"collectionId":120954021,
"trackId":120954025,
"artistName":"Jack Johnson",
"collectionName":"Sing-a-Longs and Lullabies for the Film Curious George",
"trackName":"Upside Down",
"collectionCensoredName":"Sing-a-Longs and Lullabies for the Film Curious George",
"trackCensoredName":"Upside Down",
"artistViewUrl":"https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewArtist?id=909253",
"collectionViewUrl":"https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?i=120954025&id=120954021&s=143441",
"trackViewUrl":"https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?i=120954025&id=120954021&s=143441",
"previewUrl":"http://a1099.itunes.apple.com/r10/Music/f9/54/43/mzi.gqvqlvcq.aac.p.m4p",
"artworkUrl60":"http://a1.itunes.apple.com/r10/Music/3b/6a/33/mzi.qzdqwsel.60x60-50.jpg",
"artworkUrl100":"http://a1.itunes.apple.com/r10/Music/3b/6a/33/mzi.qzdqwsel.100x100-75.jpg",
"collectionPrice":10.99,
"trackPrice":0.99,
"collectionExplicitness":"notExplicit",
"trackExplicitness":"notExplicit",
"discCount":1,
"discNumber":1,
"trackCount":14,
"trackNumber":1,
"trackTimeMillis":210743,
"country":"USA",
"currency":"USD",
"primaryGenreName":"Rock"}
The following table defines the JSON result keys and values:
| Result Key | Description | Returned | Return Values and Examples |
|---|---|---|---|
| wrapperType | The name of the object returned by the search request. | Y |
track, collection, artist For example: track. |
| *explicitness |
The Recording Industry Association of America (RIAA) parental advisory for the content returned by the search request. For more information, seehttp://itunes.apple.com/WebObjects/MZStore.woa/wa/parentalAdvisory. |
Y |
explicit (explicit lyrics, possibly explicit album cover), cleaned (explicit lyrics "bleeped out"), notExplicit (no explicit lyrics) For example: "trackExplicitness":"notExplicit". |
| kind | The kind of content returned by the search request. | Y |
book, album, coached-audio, feature-movie, interactive- booklet, music-video, pdf podcast, podcast-episode, software-package, song, tv- episode, artist For example: song. |
| trackName | The name of the track, song, video, TV episode, and so on returned by the search request. | Y | For example: "Banana Pancakes". |
| artistName | The name of the artist returned by the search request. | Y | For example: Jack Johnson. |
| collectionName | The name of the album, TV season, audiobook, and so on returned by the search request. | Y | For example: "In Between Dreams". |
| *censoredName |
The name of the album, TV season, audiobook, and so on returned by the search request, with objectionable words *'d out. Note: Artist names are never censored. |
Y | For example: "S**t Happens". |
| artworkUrl100, artworkUrl60 | A URL for the artwork associated with the returned media type, sized to 100x100 pixels or 60x60 pixels. | Only returned when artwork is available | For example: "http:// a1.itunes.apple.com/jp/r10/Music/ y2005/m06/d03/h05/ s05.oazjtxkw.100x100-75.jpg". |
| *viewURL | A URL for the content associated with the returned media type. You can click the URL to view the content in the iTunes Store. | Y | For example: "http:// itunes.apple.com/WebObjects/ MZStore.woa/wa/viewAlbum? i=68615807&id=68615813&s=1434 62". |
| previewUrl | A URL referencing the 30-second preview file for the content associated with the returned media type. . | Only returned when media type is track | For example: "http:// a392.itunes.apple.com/jp/r10/ Music/y2005/m06/d03/h05/s05.zdzqlufu.p.m4p". |
| trackTimeMillis | The returned track's time in milliseconds. | Only returned when media type is track |
Caching Architecture

Legal
Affiliate may use certain promotional content as may be provided by Apple, including previews of songs and music videos, album art, and App icons ("Promo Content"), for the purposes of promoting the subject of the Promo Content; provided such Promo Content: (i) is placed only on pages that promote the content on which the Promo Content is based; (ii) is proximate to a "Download on iTunes" or "Available on the App Store" badge (as approved by Apple) that acts as a link directly to pages within iTunes or the App Store where consumers can purchase the promoted content; (iii) includes attribution indicating the Promo Content was "provided courtesy of iTunes" if such Promo Content includes song or music video previews; (iv) is streamed only, and not downloaded, saved, cached, or synchronized with video, if such Promo Content includes song or music video previews; (v) is not used for independent entertainment value apart from its promotional purpose; and (vi) is not used to promote any other goods or services. Affiliate acknowledges that Apple provides the Promo Content "as is," and disclaims any and all representations or warranties, including, but not limited to, non-infringement. Affiliate shall forward any claims received in connection with the Promo Content to Apple immediately upon receipt, and will remove any Promo Content immediately upon request from Apple.
This agreement and your use of Promo Content are governed by California law.
Search API 官方文档 可以用了查看自己的app的更多相关文章
- SolrJ API 官方文档最佳实践
以下内容译自Solr Wiki官方文档,版权没有,随意转载. Solrj 是一个访问solr的Java客户端.它提供了一个java接口用于添加更新和查询solr索引.本页面介绍SolrJ最新版本1.4 ...
- 【Android API】Android 4.1 API官方文档详解
原文:http://android.eoe.cn/topic/summary 翻译:[eoeAndroid原创团队]kris.流风而逝.贼寇在何方.snowxwyo.lsy4833406 更新日期:2 ...
- 《Spark Python API 官方文档中文版》 之 pyspark.sql (一)
摘要:在Spark开发中,由于需要用Python实现,发现API与Scala的略有不同,而Python API的中文资料相对很少.每次去查英文版API的说明相对比较慢,还是中文版比较容易get到所需, ...
- 《Spark Python API 官方文档中文版》 之 pyspark.sql (二)
摘要:在Spark开发中,由于需要用Python实现,发现API与Scala的略有不同,而Python API的中文资料相对很少.每次去查英文版API的说明相对比较慢,还是中文版比较容易get到所需, ...
- 《Spark Python API 官方文档中文版》 之 pyspark.sql (四)
摘要:在Spark开发中,由于需要用Python实现,发现API与Scala的略有不同,而Python API的中文资料相对很少.每次去查英文版API的说明相对比较慢,还是中文版比较容易get到所需, ...
- 《Spark Python API 官方文档中文版》 之 pyspark.sql (三)
摘要:在Spark开发中,由于需要用Python实现,发现API与Scala的略有不同,而Python API的中文资料相对很少.每次去查英文版API的说明相对比较慢,还是中文版比较容易get到所需, ...
- Restful API官方文档
理解Restful架构:http://www.ruanyifeng.com/blog/2011/09/restful RESTful设计指南:http://www.ruanyifeng.com/blo ...
- ElasticSearch(6.2.2)的java API官方文档的总结 (三)
一 : SearchRequest用于任何与搜索文档,聚合和建议有关的操作,并且还提供了对生成的文档进行高亮显示的方法. 在最基本的形式中,我们可以向请求添加一个查询: 1:添加一个Search ...
- lua api 官方文档 函数后面的方括号 说明 [-0, +0, –]
本博客注有“转”字样的为转载文章,其余为本人原创文章,转载请务必注明出处或保存此段.c++/lua/windows逆向交流群:69148232 每一个lua api 函数结尾都给出了这样的说明例如: ...
随机推荐
- Jquery数组操作技巧
Jquery对数组的操作技巧. 1. $.each(array, [callback]) 遍历[常用] 解释: 不同于例遍 jQuery 对象的 $.each() 方法,此方法可用于例遍任何对象(不 ...
- ASP.net UrlRewrite的防盗链功能
ASP.net中如何实现基于UrlRewrite的防盗链. ASP.net中最快实现UrlRewrite的方法这篇文章中说了如何做UrlRewrite,那只是一个最简单的应用 其实利用UrlRewri ...
- C语言-L Buffer is too small && 0 解决方法
问题如下: 问题出在程序语句(见下): 其中,字符串p1和p2分别指向某个字符串,p是定义的一个字符数组.问题出现在对strlen()的使用,这个函数计算的字符串长度是不包括'\0'的,所以在设置第二 ...
- 使用DataGridView数据窗口控件,构建用户快速输入体验
在"随风飘散" 博客里面,介绍了一个不错的DataGridView数据窗口控件<DataGridView数据窗口控件开发方法及其源码提供下载>,这种控件在有些场合下,还 ...
- JLINK V8 Keil MDK4.10 STM32
新买的JLINK v8仿真器,第一次使用,编译环境是Keil MDK4.10,目前芯片是STM32F103x. 按照光盘的说明先安装了驱动,USB接上JLINK v8,显示驱动成功.但是在debug或 ...
- 【WPF学习日记】——Window的DataContext绑定ViewModel
1.全局的ViewModel绑定: a)设定全局的ViewModel(App.xaml中): 1 <Application x:Class="MyTest.App" 2 xm ...
- jquery easyui datebox单击文本框显示日期选择
jquery easyui的datebox日历控件,实现单击文本框出现日历选择,如下图: 代码: 修改jquery.easyui.min.js第9797行函数(jQuery EasyUI 1.3.2) ...
- makefile复习时发现的编写makefile规则注意事项
博客中关于makefile的博文数不胜数,比较经典的都很相似,下面这一片,很全面,只是很长,可以作为参考资料:http://blog.csdn.net/liang13664759/article/de ...
- hdu 1026 Ignatius and the Princess I
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=1026 Ignatius and the Princess I Description The Prin ...
- Android UI 组件 » GifView
GifView 是一个为了解决android中现在没有直接显示gif的view,只能通过mediaplay来显示这个问题的项目,其用法和 ImageView一样,支持gif图片 使用方法: 1-把Gi ...