Use the Apple Search API to search by genre?

前端 未结 2 1110
面向向阳花
面向向阳花 2021-02-09 10:06

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 o

2条回答
  •  遥遥无期
    2021-02-09 10:33

    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.

    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
    

    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
    

    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.

提交回复
热议问题