在iTunes搜索API doc有一个名为栗色寻找一个艺术家的例子,该网址是像这样:如何实体类型的搜索结合起来,苹果的iTunes搜索API
https://itunes.apple.com/search?term=maroon&entity=allArtist&attribute=allArtistTerm
这将返回了50开始的结果如下:
{
"resultCount": 50,
"results": [
{
"wrapperType": "artist",
"artistType": "Artist",
"artistName": "Maroon 5",
"artistLinkUrl": "https://itunes.apple.com/us/artist/maroon-5/id1798556?uo=4",
"artistId": 1798556,
"amgArtistId": 529962,
"primaryGenreName": "Pop",
"primaryGenreId": 14,
"radioStationUrl": "https://itunes.apple.com/station/idra.1798556"
},
{
"wrapperType": "artist",
"artistType": "Software Artist",
"artistName": "MaroonEntertainment",
"artistLinkUrl": "https://itunes.apple.com/us/artist/maroonentertainment/id537029262?uo=4",
"artistId": 537029262,
"radioStationUrl": "https://itunes.apple.com/station/idra.537029262"
},
这很好。然而,这是我的问题:我想创建一个搜索查询,尽可能具体通过结合搜索艺术家和歌曲名称和专辑名称..
因此,例如,我得到了这首歌曲:
- 歌曲:横跨大分水岭
- 专辑:大分水岭
- 艺术家: Semisonic
我可以只搜索艺术家名称:
https://itunes.apple.com/search?term=Semisonic&entity=allArtist&attribute=allArtistTerm
我可以只搜索歌曲词:
https://itunes.apple.com/search?term=Across the Great Divide&entity=song&attribute=songTerm
我可以只搜索专辑名称:
https://itunes.apple.com/search?term=Great Divide&entity=album&attribute=albumTerm
然而,这些家伙都没有给我我想要的结果(我可以找到我正在寻找的结果,也许有50人..但我只是万t搜索查询具体到足以避免任何客户端过滤某种东西)。
我该如何结合这些搜索?如果我只需添加两个搜索在一起(在这个例子中我在寻找既歌曲和艺术家):
https://itunes.apple.com/search?term=Across the Great Divide&entity=song&attribute=songTerm&term=Semisonic&entity=allArtist&attribute=allArtistTerm
那么苹果将简单地忽略第一个搜索类型(即歌曲)并返回艺术家的结果只要)。
想法?
看着我[回复](http://stackoverflow.com/a/29530049/766570)David – abbood 2015-04-09 04:54:19
@DavidReich嗨大卫,你有没有去过使用Apple DataFeed的艰辛之路?如果是这样,你有什么要做的联盟合作伙伴? – 2017-09-17 07:34:17
@ThreadPitt我从来没有完成应用程序。我发现Apple使用的关键字在URL搜索API返回的记录中不存在,并且DataFeed中不存在。例如...我做了一个返回音频书籍记录的搜索。这些记录没有我使用的搜索字词!我认为这也不在DataFeed中。 (这是几年前,现在。)我抬头看亚马逊的有声读物。搜索词是“叙述者”的名字。在这之后我放弃了! 会员也是几年前。除常规开发者帐户之外的更多步骤。 – 2017-09-17 15:21:36