(我做了一个重大的编辑,因为C#代码片段没有帮助但是掩盖了这个问题 - 希望它现在更清晰了)
我正试图通过iTunes中的流派列出播客,并尽可能使用https://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html中描述的API。
我在搜索名称和解析/使用JSON中的响应时没有困难,例如搜索
https://itunes.apple.com/search?term=Design&media=podcast&entity=podcast&limit=1
给出
{
"resultCount":1,
"results": [{"wrapperType":"track", "kind":"podcast", "artistId":127446766,"collectionId":73330703, "trackId":73330703, "artistName":"Frances Anderton", "collectionName":"KCRW's DnA: Design & Architecture", "trackName":"KCRW's DnA: Design & Architecture", "collectionCensoredName":"KCRW's DnA: Design & Architecture", "trackCensoredName":"KCRW's DnA: Design & Architecture", "artistViewUrl":"https://itunes.apple.com/us/artist/kcrw/id127446766?mt=2&uo=4", "collectionViewUrl":"https://itunes.apple.com/us/podcast/kcrws-dna-design-architecture/id73330703?mt=2&uo=4", "feedUrl":"http://feeds.kcrw.com/kcrw/de", "trackViewUrl":"https://itunes.apple.com/us/podcast/kcrws-dna-design-architecture/id73330703?mt=2&uo=4", "artworkUrl30":"http://a2.mzstatic.com/us/r30/Podcasts/v4/42/ef/6a/42ef6a04-7873-e82d-716d-ae3f1c6ebca8/mza_1492532737245560899.30x30-50.jpg", "artworkUrl60":"http://a4.mzstatic.com/us/r30/Podcasts/v4/42/ef/6a/42ef6a04-7873-e82d-716d-ae3f1c6ebca8/mza_1492532737245560899.60x60-50.jpg", "artworkUrl100":"http://a2.mzstatic.com/us/r30/Podcasts/v4/42/ef/6a/42ef6a04-7873-e82d-716d-ae3f1c6ebca8/mza_1492532737245560899.100x100-75.jpg", "collectionPrice":0.00, "trackPrice":0.00, "trackRentalPrice":0, "collectionHdPrice":0, "trackHdPrice":0, "trackHdRentalPrice":0, "releaseDate":"2014-12-30T08:00:00Z", "collectionExplicitness":"notExplicit", "trackExplicitness":"notExplicit", "trackCount":25, "country":"USA", "currency":"USD", "primaryGenreName":"Design", "radioStationUrl":"https://itunes.apple.com/station/idra.73330703", "artworkUrl600":"http://a3.mzstatic.com/us/r30/Podcasts/v4/42/ef/6a/42ef6a04-7873-e82d-716d-ae3f1c6ebca8/mza_1492532737245560899.600x600-75.jpg", "genreIds":["1402", "26", "1301"], "genres":["Design", "Podcasts", "Arts"]}]
}
但是当试图获得基于流派的播客列表时,例如当使用流派id" 1402"试图从类型中获取列表" Design" (实际上使用我使用的任何ID号),使用以下
https://itunes.apple.com/search?term=1402&media=podcast&entity=podcast&attribute=genreIndex&limit=1
我得到的就是这个
{
"resultCount":0,
"results": []
}
(我正在从http://www.apple.com/itunes/affiliates/resources/documentation/genre-mapping.html获取ID)
显然我在做一些微不足道的错误.. :( .. API描述中是否缺少某些东西?
答案 0 :(得分:7)
为什么不这样使用genreId?这是我偶然发现的无证检索参数。
https://itunes.apple.com/search?term=podcast&genreId=1402&limit=200
答案 1 :(得分:0)
好的 - 看起来策略是错误的,并且使用该API无法获取所需类型的播客列表。
前进的方向是使用不同的API,例如
https://itunes.apple.com/us/rss/topaudiopodcasts/genre=1406/json
获取播客列表。您没有直接从此处获取Feed地址,但是您获得了Feed ID,并且可以使用它来通过搜索API查找剩余的任何内容。