View source: R/st_game_summary.R
| st_game_summary | R Documentation |
Retrieves aggregated download and revenue estimates by game categories, countries, and date ranges. This provides a market overview of game performance across different segments.
st_game_summary(
categories = 7001,
countries,
os,
date_granularity,
start_date,
end_date,
auth_token = NULL,
base_url = "https://api.sensortower.com",
enrich_response = TRUE
)
categories |
Character string or numeric vector. Game category IDs to analyze. Defaults to 7001 (a popular game category). Use 'st_categories()' to find valid category IDs. |
countries |
Character vector or comma-separated string. Country codes (e.g., '"US"', 'c("US", "GB")', '"WW"' for worldwide) to analyze. Required. |
os |
Character string. Operating System. Must be one of "ios", "android", or "unified". Required. Note: The underlying API only supports "ios" and "android"; when 'os = "unified"' this function automatically fetches both platforms and combines them into a single table with total columns. |
date_granularity |
Character string. Time granularity for aggregation. Must be one of "daily", "weekly", "monthly", or "quarterly". Required. |
start_date |
Character string or Date object. Start date for the query in "YYYY-MM-DD" format. Required. |
end_date |
Character string or Date object. End date for the query in "YYYY-MM-DD" format, inclusive. Required. |
auth_token |
Optional. Character string. Your Sensor Tower API token. |
base_url |
Optional. Character string. The base URL for the API. |
enrich_response |
Optional. Logical. If 'TRUE' (default), enriches the response with readable column names and processes the data. |
A [tibble][tibble::tibble] with game market summary data including: - **Category information**: Game category details - **Geographic data**: Country-level breakdowns - **Downloads**: iOS (iPhone + iPad combined) and Android download estimates - **Revenue**: iOS (iPhone + iPad combined) and Android revenue estimates - **Totals (unified only)**: 'Total Downloads', 'Total Revenue' - **Time series**: Data broken down by specified granularity
**Automatic Data Combination**: For iOS and unified platforms, iPhone and iPad data are automatically combined into single "iOS Downloads" and "iOS Revenue" columns for simplified analysis.
- **Game Summary**: 'GET /v1/{os}/games_breakdown' (API only supports 'os = "ios"' or 'os = "android"'; unified is synthesized)
The API returns abbreviated field names which are automatically mapped to descriptive names and processed: - **iOS**: 'iu' + 'au' = iOS Downloads (combined), 'ir' + 'ar' = iOS Revenue (combined) - **Android**: 'u' = Android Downloads, 'r' = Android Revenue - **Common**: 'cc' = Country Code, 'd' = Date, 'aid' = App ID
iPhone and iPad data are automatically combined for simplified analysis.
[st_categories()], [st_top_charts()], [st_metrics()]
## Not run:
# Basic game market summary (last 30 days, worldwide)
game_summary <- st_game_summary()
# Specific categories and countries
rpg_summary <- st_game_summary(
categories = c(7001, 7002),
countries = c("US", "GB", "DE"),
date_granularity = "weekly"
)
# Monthly summary for iOS games in the US
ios_monthly <- st_game_summary(
os = "ios",
countries = "US",
date_granularity = "monthly",
start_date = "2024-01-01",
end_date = "2024-06-30"
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.