#' apptweak_api_content
#'
#' Download the app content from AppTweak - due to API restrictions it is best to pull the API content with this function and then use others to extract the relevant parts of the data
#' @param api_token Your AppTweak API token
#' @param os Either 'ios' or 'android'
#' @param to_return Either 'content' or 'metadata'. Defaults to 'content'
#' @export
apptweak_api <- function(api_token,os,to_return='content',language='DE') {
library(httr)
library(jsonlite)
language <- str_to_upper(language)
os <- str_to_lower(os)
app_id <- ifelse(os == 'android','de.commerzbanking.mobil','366609901')
request <- paste('https://api.apptweak.com/',os,'/applications/',app_id,'.json?country=DE&language=',language,sep='')
x <- GET(request,add_headers('X-Apptweak-Key'=api_token))
y <- content(x,'parsed')
if (to_return == 'metadata') {
z <- y$metadata
} else {
z <- y$content
}
return(z)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.