The {appler} package is a wrapper around Apple’s App Store Search API. This allows the user to pull information about artists, applications, and anything else available on iTunes or the Apple App Store.
Other functions are included to allow the pulling of information not included in the search API such as application reviews and split of ratings.
The first thing to do is find the ID of the entity you are analysing.
The search_apple
function will use Apple’s API to return
any items that are related to the search terms entered. By default it
pulls tracks and audiobooks, however with the entity
parameter we can specify we want to search for artists or
applications.
# Artist ID can be obtained from the artistId column
<- search_apple("Taylor Swift")
taylor_swift_songs
<- search_apple("Taylor Swift", media = "music", entity = "musicArtist")
taylor_swift str(taylor_swift)
#> 'data.frame': 1 obs. of 8 variables:
#> $ wrapperType : chr "artist"
#> $ artistType : chr "Artist"
#> $ artistName : chr "Taylor Swift"
#> $ artistLinkUrl : chr "https://music.apple.com/us/artist/taylor-swift/159260351?uo=4"
#> $ artistId : int 159260351
#> $ amgArtistId : int 816977
#> $ primaryGenreName: chr "Pop"
#> $ primaryGenreId : int 14
<- taylor_swift$artistId taylor_swift_id
Applications are slightly different, where they instead of
artistId
, trackId
is used to store the unique
ID.
<- search_apple("GitHub")
github_tracks
<- search_apple("GitHub", media = "software", entity = "software")
github_app # Over 50 apps are returned, however the top is the official GitHub app
<- github_app$trackId[1]
github_app_id cat(github_app_id)
#> 1477376905
When searching software, a lot more information is returned, such as
application metadata (size, version, release notes) and average rating.
Use str(github_app)
to take a look at everything
included.
Alternatively the ID can be found in the URL.
For artists and tracks it can be found as the last part of the URL.
For example, to find out about Taylor Swift the ID is
159260351
(from https://music.apple.com/us/artist/taylor-swift/159260351),
or her latest album Midnights is 1650841512
(from https://music.apple.com/us/album/midnights-3am-edition/1650841512).
For applications it is almost the same, however it is prefixed with
“id” which will need to be removed when using functions from {appler}.
For example the ID for GitHub is 1477376905
(from https://apps.apple.com/us/app/github/id1477376905).
If you already have the ID, you can use lookup_apple
and
it will return the same information as search_apple
but for
the specific entity chosen.
<- lookup_apple(taylor_swift_id)
taylor_swift_lookup str(taylor_swift_lookup)
#> 'data.frame': 1 obs. of 8 variables:
#> $ wrapperType : chr "artist"
#> $ artistType : chr "Artist"
#> $ artistName : chr "Taylor Swift"
#> $ artistLinkUrl : chr "https://music.apple.com/us/artist/taylor-swift/159260351?uo=4"
#> $ artistId : int 159260351
#> $ amgArtistId : int 816977
#> $ primaryGenreName: chr "Pop"
#> $ primaryGenreId : int 14
Comparing the results of search and lookup:
<- names(taylor_swift)
taylor_swift_cols cat("Same results:", all.equal(taylor_swift, taylor_swift_lookup[, taylor_swift_cols]), "\n")
#> Same results: TRUE
Once you have the ID, you can get to the interesting part: the reviews. Apple has an RSS feed that enables you to pull the latest 500 reviews for an application, along with information such as the version that was being reviewed, and what rating was given by the user.
There is a limitation that you can only pull the reviews for a single country, and by default the reviews from the US will be returned, however any ISO-2 country code can be used. If the app isn’t available in that country, then there will be a 400 error.
<- get_apple_reviews(github_app_id)
github_reviews head(github_reviews)
#> id review_time author app_version
#> 1 9543515447 2023-01-24 21:15:17 🍓kianakooshesh🍓 1.97.0
#> 2 9539504245 2023-01-23 17:27:45 MikeMcqocjc 1.96.0
#> 3 9521163486 2023-01-18 15:05:35 fitzoh 1.96.0
#> 4 9515721565 2023-01-17 01:29:12 TheWorstSoftware 1.95.0
#> 5 9500797135 2023-01-12 23:18:20 nokiapureview 1.95.0
#> 6 9493878837 2023-01-11 00:34:31 superToasted 1.95.0
#> title
#> 1 Explore page doesn’t load
#> 2 I’m new to coding and it’s like starting into the sun it hurts my brain
#> 3 Please let us manage multiple GitHub.com accounts
#> 4 They actually use version history!
#> 5 Star button is too big
#> 6 no clone link
#> rating
#> 1 4
#> 2 3
#> 3 3
#> 4 5
#> 5 4
#> 6 1
#> review
#> 1 I’ve been using GitHub for a while now and I loved it!\nBut recently when I click on the explore page it doesn’t load and gives an error, unfortunately this issue wasn’t solved with the latest update which was released today.
#> 2 I want to learn how to code because my ex off 13 years started seeing a guy who is very good at coding and was able to come how tunnel into my phone and clone everything he has since walked away with all my info and $500 out of my bank accounts i need to learn how to code to understand this new world
#> 3 I like the app, but have major usability issues due to having separate work and personal GitHub.com accounts.\n\nPlease find a way to allow us to use multiple accounts.
#> 4 They actually use the version history instead of just putting nonsense or marketing info!! \nPlus the updates they do do, have a purpose! \nIt’s not as robust as a browser, or even cmd, but it works great and honest has only gotten better over the years.
#> 5 Always touch star button when scrolling repo list.Please decrease the size of star button.
#> 6 The mobile all and mobile website decided to omit the clone link of all repos. I am trying to use the app to install some drivers on a linux machine with no browser to request a desktop version. Because of this i am unable to use github to get the most basic of information i need to use a repo
One extra piece of functionality available in {appler} is the ability
to scrape the rating split from the App Store. Whilst the average rating
for the app is available in search_apple
, it is useful to
know how many 5* ratings are given and how many 1* ratings are
given.
<- get_apple_rating_split(github_app_id)
github_ratings
github_ratings#> rating percent
#> 1 5 0.89
#> 2 4 0.07
#> 3 3 0.02
#> 4 2 0.01
#> 5 1 0.02