Skip to contents

[Stable]

This function scrapes the Google Play Store by using name as the search term. From there it selects the first result in the list and its corresponding category and package name.

Usage

app_category(name, num = 1, rate_limit = 5, exact = TRUE, .progress = TRUE)

Arguments

name

The name of the app to search for.

num

Which result should be selected in the list of search results. Defaults to one.

rate_limit

The time interval to keep between queries, in seconds. If the rate limit is too low, the Google Play Store may reject further requests or even ban your entirely.

exact

In m-Path Sense, the app names of the AppUsage sensor are the last part of the app's package names. When exact is TRUE, the function guarantees that name is exactly equal to the last part of the selected package from the search results. Note that when exact is TRUE, it interacts with num in the sense that it no longer selects the top search result but instead the top search result that matches the last part of the package name.

.progress

Whether to display a progress bar.

Value

A list containing the following fields:

packagethe package name that was selected from the Google Play search
genrethe corresponding genre of this package

Warning

Do not abuse this function or you will be banned by the Google Play Store. The minimum delay between requests seems to be around 5 seconds, but this is untested. Also make sure not to do batch lookups, as many subsequent requests will get you blocked as well.

Examples

app_category("whatsapp")
#>        app      package         genre
#> 1 whatsapp com.whatsapp COMMUNICATION

# Example of a generic app name where we can't find a specific app
app_category("weather") # Weather forecast channel
#>       app             package   genre
#> 1 weather com.weather.Weather WEATHER

# Get OnePlus weather
app_category("net.oneplus.weather")
#>                   app             package   genre
#> 1 net.oneplus.weather net.oneplus.weather WEATHER