Skip to contents

Introduction

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
taylor_swift_songs <- search_apple("Taylor Swift")

taylor_swift <- search_apple("Taylor Swift", media = "music", entity = "musicArtist")
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_id <- taylor_swift$artistId

Applications are slightly different, where they instead of artistId, trackId is used to store the unique ID.

github_tracks <- search_apple("GitHub")

github_app <- search_apple("GitHub", media = "software", entity = "software")
# Over 50 apps are returned, however the top is the official GitHub app
github_app_id <- github_app$trackId[1]
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).

Apple Store Lookup

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.

taylor_swift_lookup <- lookup_apple(taylor_swift_id)
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:

taylor_swift_cols <- names(taylor_swift)
cat("Same results:", all.equal(taylor_swift, taylor_swift_lookup[, taylor_swift_cols]), "\n")
#> Same results: TRUE

Reviews

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.

github_reviews <- get_apple_reviews(github_app_id)
head(github_reviews)
#>            id         review_time       author app_version
#> 1 10017477616 2023-06-10 02:08:07    Adam Lash     1.116.0
#> 2 10006942939 2023-06-07 00:50:37 M1k3Thirteen     1.115.0
#> 3 10002825380 2023-06-05 19:29:32  Yodel eater     1.115.0
#> 4 10002283252 2023-06-05 16:05:36    tyler1205     1.115.0
#> 5  9988936382 2023-06-01 20:34:32       CK C l     1.115.0
#> 6  9986903668 2023-06-01 08:07:58      rewaoir     1.115.0
#>                             title rating
#> 1  It lack a lot of functionality      2
#> 2                       The Best!      5
#> 3             My Profile page-app      4
#> 4 Convenient but lacking features      4
#> 5                             Ann      3
#> 6       The first time you have a      5
#>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    review
#> 1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    There are many things that are missing like I can’t see the project to do tickets in my organization
#> 2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      This makes quick and on-the-fly issues and code reviews easy. Being on my iPhone looking at my code and being able to catch my thoughts instantly is my favorite part of this app. I also really like being able to star repos from my research and reading on my phone instantly to my GitHub to review later or share instantly.
#> 3 Okay let me start at the beginning of my online education started with a iPhone 3 And my google account for my Apple ID? Not knowing anything about how the Operating systems work! I use Siri assist a lot and gave google access to my sound last year,try to fix my windows and internet! I play Chess daily on chess.com and play some of Skillz.com games daily! To the point of this review! When I did get around to setting up my GitHub account, There was a account already in my username from Chess.com I believe my Siri and google assistant tagged me and made the account back when it happened in 2017 The Block Wars! I was a developer and didn’t even know it! All off my sound recognition! Now that I am properly educated enough also Certified in solitity, crypto currency’s,Blockchain and still taking course’s I am a big believer in Bitcoin and the Algorithms of proof of work! With the help of GitHub I hope to spread the Word and build some bridges through the Verse and develop some new code and help make Bitcoin The Standard world wide and beyond. Computer computing power and data are powerful resources!
#> 4                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Also syntax highlights are outdated and don’t match the web UI. Otherwise it’s a nice app.
#> 5                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           I\nMcRae\nL x
#> 6                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  I’m so happy you found

Ratings

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.

github_ratings <- get_apple_rating_split(github_app_id)
github_ratings
#>   rating percent
#> 1      5    0.89
#> 2      4    0.07
#> 3      3    0.02
#> 4      2    0.01
#> 5      1    0.02