-
Notifications
You must be signed in to change notification settings - Fork 7
IPlayerService
Specifically playtime, owned games, badges, and Steam level. For player summaries, bans and friend list, go to ISteamUser
Method | Description |
---|---|
GetRecentlyPlayedGames | Get information about games the user has played within the last 2 weeks. |
GetOwnedGames | Retrieve a list of all games the user has ever bought or installed (free-to-play). |
GetSteamLevel | Get the current Steam Level of the user, and absolutely nothing more. |
GetBadges | Get all badges the user currently has, and some detailed level information. |
GetCommunityBadgeProgress | Returns the badge progress for specific task-based badges. |
Get information about games the user has played within the last 2 weeks.
getRecentlyPlayedGames(steamID[, count])
steamID
required
Type:
String
Steam ID of the user, as a string
count
Type:
Integer
Default:0
Number of recently played games to return. Unset or 0 will return all recently played games
Integer
count
Number of returned gamesArray
games
Array of objects containing information about recently played gamesString
name
Full name of the gameInteger
appID
Steam internal app ID, always uniqueInteger
playtime
Total game playtime in minutesInteger
playtime_recent
Game playtime in minutes over the last 2 weeksString
url_store
Basic url to store page, url is not canonical (name is not in url)String
url_store_header
Basic url to header image for Steam store page, url stays the same but the resulting image can change frequentlyString
url_app_logo
Url to app logo, seems to always be 184x69 pixels and never changesString
url_app_icon
Url to app icon, seems to always be 32x32 pixels and never changes
const api = require('steam-js-api')
api.setKey('{{YOUR KEY}}')
api.getRecentlyPlayedGames('76561198099490962', 2).then(result => {
console.log(result.data)
}).catch(console.error)
This would display an object that looks like this one:
{
"count": 2,
"games": [
{
"name": "Counter-Strike: Global Offensive",
"appID": 730,
"playtime": 61040,
"playtime_recent": 264,
"url_store": "https://store.steampowered.com/app/730",
"url_store_header": "https://steamcdn-a.akamaihd.net/steam/apps/730/header.jpg",
"url_app_logo": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/apps/730/d0595ff02f5c79fd19b06f4d6165c3fda2372820.jpg",
"url_app_icon": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/apps/730/69f7ebe2735c366c65c0b33dae00e12dc40edbe4.jpg"
},
{
"name": "Call of Duty: World at War",
"appID": 10090,
"playtime": 817,
"playtime_recent": 24,
"url_store": "https://store.steampowered.com/app/10090",
"url_store_header": "https://steamcdn-a.akamaihd.net/steam/apps/10090/header.jpg",
"url_app_logo": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/apps/10090/281c6232bf39e96f2592e241dafe02ef54499df5.jpg",
"url_app_icon": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/apps/10090/2bfb85222af4a01842baa5c3a16a080eb27ac6c3.jpg"
}
]
}
Retrieve a list of all games the user has ever bought or installed (free-to-play). This list is seemingly not sorted in any way at all. This will likely not match the user's current library, as some may have installed a free-to-play game, never played it, and then uninstalled it. Even then, that free-to-play game will forever be included as an "owned game."
Despite the Web API claiming that free-to-play games are excluded by default, and may be included if specified, this isn't true and free-to-play games will ALWAYS be returned no matter what you try to tell the Web API. Trust me, I tried and include_played_free_games
does literally nothing. Sadly there is no way to tell if any of the returned games are free-to-play with this API on it's own, so you'll either have to use another API to check, or keep track of all appIDs of free-to-play games. Thanks Volvo...
getOwnedGames(steamID[, appIDs[, moreInfo]])
steamID
required
Type:
String
Steam ID of the user, as a string
appIDs
Type:
Array
Default:null
Array of integer appIDs (or just one integer, no array necessary) to specifically retrieve, set to null to get all owned games
moreInfo
Type:
Boolean
Default:false
Set to true to get more info: name, image urls
Integer
count
Number of returned gamesArray
games
Array of objects containing information about owned gamesString
name
Full name of the game, only returned ifmoreInfo
istrue
Integer
appID
Steam internal app ID, always uniqueInteger
playtime
Total game playtime in minutesInteger
playtime_recent
Game playtime in minutes over the last 2 weeksString
url_store
Basic url to store page, url is not canonical (name is not in url)String
url_store_header
Basic url to header image for Steam store page, url stays the same but the resulting image can change frequently, only returned ifmoreInfo
istrue
String
url_app_logo
Url to app logo, seems to always be 184x69 pixels and never changes, only returned ifmoreInfo
istrue
String
url_app_icon
Url to app icon, seems to always be 32x32 pixels and never changes, only returned ifmoreInfo
istrue
const api = require('steam-js-api')
api.setKey('{{YOUR KEY}}')
api.getOwnedGames('76561198099490962', [730, 264710], true).then(result => {
console.log(result.data)
}).catch(console.error)
This would display an object that looks like this one:
{
"count": 2,
"games": [
{
"name": "Subnautica",
"appID": 264710,
"playtime": 224,
"playtime_recent": 0,
"url_store": "https://store.steampowered.com/app/264710",
"url_store_header": "https://steamcdn-a.akamaihd.net/steam/apps/264710/header.jpg",
"url_app_logo": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/apps/264710/d6bfaafed7b41466cc99b70972a944ac7e4d6edf.jpg",
"url_app_icon": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/apps/264710/8a14ceef6e230330a916d7a6324b8c52d464d569.jpg"
},
{
"name": "Counter-Strike: Global Offensive",
"appID": 730,
"playtime": 61040,
"playtime_recent": 264,
"url_store": "https://store.steampowered.com/app/730",
"url_store_header": "https://steamcdn-a.akamaihd.net/steam/apps/730/header.jpg",
"url_app_logo": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/apps/730/d0595ff02f5c79fd19b06f4d6165c3fda2372820.jpg",
"url_app_icon": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/apps/730/69f7ebe2735c366c65c0b33dae00e12dc40edbe4.jpg"
}
]
}
Get the current Steam Level of the user, and absolutely nothing more.
getSteamLevel(steamID)
steamID
required
Type:
String
Steam ID of the user, as a string
Integer
level
Steam level of the user
const api = require('steam-js-api')
api.setKey('{{YOUR KEY}}')
api.getSteamLevel('76561198099490962').then(result => {
console.log(result.data)
}).catch(console.error)
This would display an object that looks like this one:
{
"level": 71
}
Get all badges the user currently has, and some detailed level information.
getBadges(steamID)
steamID
required
Type:
String
Steam ID of the user, as a string
Integer
level
Steam level of the userInteger
xp
Total XP the Steam user hasInteger
level_xp
The XP requirement for the user's current Steam levelInteger
next_level_xp
The XP requirement for the next Steam levelObject
badges
Badges by typesObject
game
Game badges listed by app IDsInteger
appID
Steam internal app ID, always uniqueInteger
level
Level of the badge, could be any positive integer, or 0 if only the foil badge was unlockedInteger
earned
Time the badge was initially level 1, in seconds since the epoch, could be 0 if only the foil badge was unlockedInteger
xp
Amount of XP the badge is worth, could be 0 if only the foil badge was unlockedInteger
scarcity
The total number of Steam users with a badge level equal to or higher than this badge level, could be 0 if only the foil badge was unlockedObject
foil
The foil badge information, could be 0 if the user has not unlocked the foil version. Contains thelevel
,earned
,xp
andscarcity
propertiesObject
event
Limited time event badges, listed by event tag names. Other than the newname
property, the badges are identical in structure to game badgesString
name
Full name of the badgeObject
special
Steam specific badges, each with a very unique way of earning/ leveling, listed by tag names. Identical to event badges, but they have noappID
orfoil
property
const api = require('steam-js-api')
api.setKey('{{YOUR KEY}}')
api.getBadges('76561198099490962').then(result => {
console.log(result.data)
}).catch(console.error)
This would display an object that looks like this one:
{
"level": 71,
"xp": 29042,
"level_xp": 28800,
"next_level_xp": 29600,
"badges": {
"game": {
"730": {
"appID": 730,
"level": 5,
"earned": 1466352436,
"xp": 500,
"scarcity": 2794555,
"foil": 0
},
"506670": {
"appID": 506670,
"level": 5,
"earned": 1495724426,
"xp": 500,
"scarcity": 23664,
"foil": 0
}
},
"event": {
"summer-2016": {
"name": "2016: Summer Sale",
"appID": 480730,
"level": 1,
"earned": 1467080364,
"xp": 100,
"scarcity": 990954,
"foil": 0
},
"awards-2017": {
"name": "2017: Steam Awards",
"appID": 762800,
"level": 22,
"earned": 1517712529,
"xp": 2200,
"scarcity": 13291,
"foil": 0
}
},
"special": {
"games": {
"name": "Owned Games",
"level": 127,
"earned": 1547050916,
"xp": 356,
"scarcity": 4750842
},
"years": {
"name": "Years of Service",
"level": 5,
"earned": 1374542223,
"xp": 250,
"scarcity": 68071999
}
}
}
}
Returns the badge progress for specific task-based badges.
getBadgeProgress(steamID[, badgeID])
steamID
required
Type:
String
Steam ID of the user, as a string
badgeID
Type:
String
Default:community
Badge ID, could also be the true integer value of the badge ID. Valid values for this are currently
community
,summer-2012
,holiday-2012
,hardware-beta
,awards-2016
,awards-2017
,awards-2018
andspring-cleaning
.
Object
quests
Object of quests, listed by quest IDsString
name
Always 'unknown'. This will eventually contain the description of the task once a map is created to connect quest IDs to their actual tasks. You can support development of this feature by finding thequests.json
file inside thejson
directory in the repository code!Boolean
completed
Whether or not the task has been completedInteger
count
Number of quests for this badgeInteger
completed
Number of completed quests for this badge
const api = require('steam-js-api')
api.setKey('{{YOUR KEY}}')
api.getBadgeProgress('76561198099490962', 'community').then(result => {
console.log(result.data)
}).catch(console.error)
This would display an object that looks like this one:
{
"quests": {
"260": {
"name": "unknown",
"completed": false
},
"261": {
"name": "unknown",
"completed": false
},
"262": {
"name": "unknown",
"completed": false
},
"263": {
"name": "unknown",
"completed": false
}
},
"count": 4,
"completed": 0
}
> GetTradeHistory
> GetTradeStatus
> GetBadges
> GetCommunityBadgeProgress
> GetOwnedGames
> GetRecentlyPlayedGames
> GetSteamLevel
> GetAssetClassInfo
> GetAssetPrices
> GetFriendList
> GetPlayerBans
> GetPlayerSummaries
> GetUserGroupList
> ResolveVanityURL
> GetGlobalAchievement...
> GetNumberOfCurrentPlayers
> GetPlayerAchievements
> GetSchemaForGame
> GetUserStatsForGame