Retrieve game stats and achievements for a game. These functions generally operate more on stats than on achievements. For functions tailored to achievements, see get_game_achievements.

get_game_schema returns all defined stats and achievements for an appID.

get_game_stats returns aggregated global stats for an appID. Stats need to be explicitly marked as aggregated and not all stats can be aggregated to a global stat (see here for details). Finding out which stats are global involves quite a lot of trial-and-error.

get_game_schema(appid, language = "english")

get_game_stats(appid, name, startdate = NULL, enddate = NULL)

get_user_stats_for_game(steamid, appid, language = "english")

Arguments

appid

appID of an application in the Steam store.

language

Language for descriptions and display names.

name

A vector of stat names to return data for. The stat needs to be aggregated in order to allow for making global stats.

startdate

Start date for daily totals.

enddate

End date for daily totals.

steamid

SteamID of a user. The SteamID must be in a format that can be converted by convert_steamid. This includes vanity, Steam64, Steam2, and Steam3 IDs.

Value

get_game_schema

A dataframe containing data about game stats and achievements. Stats and achievements contain data about API names (name) and display names displayName. defaultvalue is always 0 as the default value of a stat is unachieved. Additionally, achievements also have data on achievement visibility (hidden), and icon URLs (icon and icongray). The type column specifies whether the row is about a stat or achievement.

get_game_stats

A dataframe containing two columns stat and value representing the stat name and the corresponding global value of the stat.

get_user_stats_for_game

A dataframe containing the name of the stat/achievement (name), its value (value) and whether it is a stat or an achievement (type).

Examples

if (FALSE) { # \dontrun{
# get schema for all achievements and stats in the game Payday 2
get_game_schema(218620)

# retrieve the number of players with more than 1000h and a level of high
# than 100 in Payday 2
get_game_stats(218620, c("player_time_1000h", "player_level_100"))

# get the stats for a specific user in CS:GO
get_user_stats_for_game("76561197984981409", 730)
} # }