如何使用 iTunes 搜索流派
How to use iTunes search for genres
(我进行了重大编辑,因为 C# 代码片段没有帮助但掩盖了问题 - 希望现在更清楚了)
我正在尝试从 iTunes 中按流派获取播客列表,并尽我所能使用 https://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html 中描述的 API。
我在 JSON e.g.the 搜索
中搜索名称和解析/使用响应没有困难
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": []
}
(我从这里获取 ID http://www.apple.com/itunes/affiliates/resources/documentation/genre-mapping.html)
显然我在这里犯了一些小错误.. :(.. API 描述中是否遗漏了什么?
好的 - 看起来该策略是错误的,使用该策略 API 无法获取所需类型的播客列表。
前进的方向是使用不同的 API,例如
https://itunes.apple.com/us/rss/topaudiopodcasts/genre=1406/json
获取播客列表。您不能直接从此处获取提要地址,但可以获取提要 ID,并可以使用它通过搜索 API 查找您需要的其他内容。
为什么不这样使用 genreId?这是我无意中发现的未记录的搜索参数。
https://itunes.apple.com/search?term=podcast&genreId=1402&limit=200
(我进行了重大编辑,因为 C# 代码片段没有帮助但掩盖了问题 - 希望现在更清楚了)
我正在尝试从 iTunes 中按流派获取播客列表,并尽我所能使用 https://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html 中描述的 API。
我在 JSON e.g.the 搜索
中搜索名称和解析/使用响应没有困难 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": []
}
(我从这里获取 ID http://www.apple.com/itunes/affiliates/resources/documentation/genre-mapping.html)
显然我在这里犯了一些小错误.. :(.. API 描述中是否遗漏了什么?
好的 - 看起来该策略是错误的,使用该策略 API 无法获取所需类型的播客列表。
前进的方向是使用不同的 API,例如
https://itunes.apple.com/us/rss/topaudiopodcasts/genre=1406/json
获取播客列表。您不能直接从此处获取提要地址,但可以获取提要 ID,并可以使用它通过搜索 API 查找您需要的其他内容。
为什么不这样使用 genreId?这是我无意中发现的未记录的搜索参数。
https://itunes.apple.com/search?term=podcast&genreId=1402&limit=200