使用 Apple Search API 按流派搜索? [英] Use the Apple Search API to search by genre?

查看:23
本文介绍了使用 Apple Search API 按流派搜索?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用 Apple Search API 按流派进行搜索?我特别考虑应用商店中的游戏.使用 Obj-c.

Is it possible to use the Apple Search API to search by genre ? I'm thinking specifically games in the app store. Using Obj-c.

正如在这个问题的评论中指出的那样......

As has been pointed out in the comments of this question...

在苹果应用商店中搜索流派与 iOS/Obj-c

尝试按类型进行搜索似乎存在问题,因此我正在寻找哪些示例实际有效的答案,而不仅仅是指向文档的链接.

There seems to be a problem with trying to search by genre, so I'm looking for answers which of examples of that actually working, not just links to the docs.

推荐答案

搜索 API 文档,但您可以将 genreId 参数添加到搜索 URL 并将搜索限制为特定类型.

It's not actually documented on the Search API documentation, but you can add a genreId parameter to the search URL and it restricts the search to a particular genre.

如果您查看从 搜索"Yelp",有 4 个有趣的事情:

If you look at the JSON returned from a search for "Yelp", there are 4 interesting things:

"genreIds":["6005", "6001"]
"genres":["Social Networking", "Weather"]
"primaryGenreName":"Social Networking"
"primaryGenreId":6005

&genreId=6001 添加到 URL 将在天气"类别中查找美国的应用.我在 URL 中使用搜索词检查".

Adding &genreId=6001 to a URL will find apps in the US in the "Weather" category. I'm using the search term "Check" in the URL.

https://itunes.apple.com/search?term=Check&country=us&entity=software&genreId=6001

因为它没有记录在案,所以你不能依赖它永远工作.您也可以使用 primaryGenreName 作为参数,我没有尝试过.您还必须弄清楚哪些数字对应哪些类别.

Because it's not documented, you can't rely on it working forever. You may also be able to use the primaryGenreName as a parameter, I didn't try that. You'll have to figure out what numbers correspond to what categories too.

这篇关于使用 Apple Search API 按流派搜索?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆