-
Notifications
You must be signed in to change notification settings - Fork 7
ISteamUser
Returns more detailed information about user profiles; summaries, bans, friends. For Steam level, badges, games, and playtime, go to IPlayerService
Method | Description |
---|---|
GetFriendList | Gets the friends of the Steam user, if public. |
GetPlayerBans | Retrieves ban information on the provided Steam IDs. |
GetPlayerSummaries | Get basic community profile information from the Steam IDs. |
GetUserGroupList | All the groups the account is a member of, this includes all game-related groups as well as community made groups. |
ResolveVanityURL | Converts custom account and group names to an ID. |
Gets the friends of the Steam user, if public.
getFriendList(steamID[, sorted])
steamID
required
Type:
String
Steam ID of the user, as a string
sorted
Type:
Boolean
Default:false
Enable sorting by friending time, with the oldest friends at the top of the resulting list
Integer
count
Number of friendsArray
friends
Array of friend objects, sorted if thesorted
paramter istrue
String
steamID
Steam ID of the friendInteger
since
Time the friend was added, in seconds since the epoch
const api = require('steam-js-api')
api.setKey('{{YOUR KEY}}')
api.getFriendList('76561198099490962', true).then(result => {
console.log(result.data)
}).catch(console.error)
This would display an object that looks like this one:
{
"count": 4,
"friends": [
{
"steamID": "76561198064527259",
"since": 1374546543
},
{
"steamID": "76561198073477368",
"since": 1385304477
},
{
"steamID": "76561198055109162",
"since": 1415236183
},
{
"steamID": "76561198190833690",
"since": 1475462732
}
]
}
Retrieves ban information on the provided Steam IDs. Notice that is PLURAL. You can get information on multiple Steam IDs at once, however Steam may internally limit the max number of Steam IDs you can query at once.
getPlayerBans(steamIDs)
steamIDs
required
Type:
Array
Array of Steam ID strings, or just one, no array necessary
Integer
count
Number of returned profiles, useful for checking if any Steam IDs were ignored or cropped from the final resultObject
players
Ban objects listed by Steam IDBoolean
community
Whether or not the account has a community banString
economy
What type of economy ban the account has. These are often temporary. Sadly, I don't know the possible values of this. If you have account restrictions, or know someone who does, please reach out to me so I can finish development on this part.Boolean
vac
Whether or not the account has a VAC ban. It may be possible for a single account to have multiple VAC bans, but I personally doubt it as VAC normally bans across ALL VAC secure games.Integer
bans
Total number of bans on the account; VAC + Game bansInteger
vacBans
Number of VAC bans on the accountInteger
gameBans
Number of Game bans on the account. Game bans are not VAC bans, they are manually given to a player by the developer of the game they got banned on.Integer
lastBan
Number of days since the last ban was given to the account, a value of0
indicates the account received a ban today
const api = require('steam-js-api')
api.setKey('{{YOUR KEY}}')
api.getPlayerBans('76561198099490962').then(result => {
console.log(result.data)
}).catch(console.error)
This would display an object that looks like this one:
{
"count": 1,
"players": {
"76561198099490962": {
"community": false,
"economy": "none",
"vac": false,
"bans": 0,
"vacBans": 0,
"gameBans": 0,
"lastBan": 0
}
}
}
Get basic community profile information from the Steam IDs. Notice that is PLURAL. You can get information on multiple Steam IDs at once, however Steam may internally limit the max number of Steam IDs you can query at once.
getPlayerSummaries(steamIDs)
steamIDs
required
Type:
Array
Array of Steam ID strings, or just one, no array necessary
Integer
count
Number of returned profiles, useful for checking if any Steam IDs were ignored or cropped from the final resultObject
players
Player objects listed by Steam IDString
name
Persona name, this is shown in games and on the websiteString
realName
The "real name" set by the account, not guaranteed to actually be real. May be set to Booleanfalse
if unset, useful for checking if a string is set before printing itString
url
Community profile URL, may contain the Steam ID or be the custom vanity url set by the accountInteger
state
A value from 0-6; 0 - Offline, 1 - Online, 2 - Busy, 3 - Away, 4 - Snooze, 5 - Looking to Trade, 6 - Looking to PlayString
stateString
Mapped value ofstate
to a string, see thepersona.json
file injson
for valuesBoolean
public
Whether or not the profile is visible, if this is false then some interfaces may not work at all, and limited data is available through player summariesBoolean
comments
Whether or not the comments are set to public, if this is false then you won't be able to comment on the profile, and may also not be able to see commentsInteger
joined
Time the account was created, in seconds since the epoch. This is not available for private accounts, however you can easily use the Steam ID to guess the time the account was created anyway.Integer
offline
Time the account last went offline, in seconds since the epoch. This does not mean the player is currently offline, or when they actually went offline, just the last time their status changed to be offline.Boolean
community
Whether or not the profile has a community profile set up. You should not allow accounts without a community profile to use your services.Integer
group
The primary group set by the user, if no group is set then this value is a Booleanfalse
to avoid ambiguityBoolean
inGame
If the user is currently in a gameInteger
appID
IfinGame
is true, then this is the app ID of the game being played. IfinGame
is true and this value is 0, then the account is playing a non-Steam game.String
appName
IfinGame
is true, then this is most likely the name of the game being played. IfappID
is 0, this is the "extra game info" from the non-Steam game, and may not be an accurate representation of the true game name.Object
avatar
Holds the various urls for the avatar sizesString
small
URL for the 32x32 avatarString
medium
URL for the 64x64 avatarString
large
URL for the 184x184 avatarObject
location
The public location of the account, should never be used for any real location authentication, as users can change this whenever and however they wantString
country
Full English name of the country, is a Booleanfalse
if not set by the accountString
state
Full English name of the state/ province/ city-state, is a Booleanfalse
if not set by the accountString
city
Full English name of the city, is a Booleanfalse
if not set by the account. Keep in mind some country states have only one possible city, and some have no city options at all.String
countryCode
The country code for the country, should adhere to world standards (i.e. United States code isUS
)String
stateCode
The state code for the state, for some countries this is the official abbreviation (i.e. Alaska state code isAK
) but for most this is just a random internal codeInteger
cityCode
The city code for the city, seems to be a completely unique ID, otherwise this is not standardized and only for internal use
const api = require('steam-js-api')
api.setKey('{{YOUR KEY}}')
api.getPlayerSummaries('76561198099490962').then(result => {
console.log(result.data)
}).catch(console.error)
This would display an object that looks like this one:
{
"count": 1,
"players": {
"76561198099490962": {
"name": "Almic",
"realName": "Mick Ashton",
"url": "https://steamcommunity.com/id/almic/",
"state": 1,
"stateString": "online",
"public": true,
"comments": true,
"joined": 1374542223,
"offline": 1547510790,
"community": true,
"group": "103582791435315066",
"inGame": true,
"appID": 730,
"appName": "Counter-Strike: Global Offensive",
"avatar": {
"small": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/d9/d92bde555a21e7e5074b5cdb8ed733e088cad1c5.jpg",
"medium": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/d9/d92bde555a21e7e5074b5cdb8ed733e088cad1c5_medium.jpg",
"large": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/d9/d92bde555a21e7e5074b5cdb8ed733e088cad1c5_full.jpg"
},
"location": {
"country": "United States",
"state": "Alaska",
"city": "Nome",
"countryCode": "US",
"stateCode": "AK",
"cityCode": 69
}
}
}
}
All the groups the account is a member of, this includes all game-related groups as well as community made groups.
getUserGroups(steamID)
steamID
required
Type:
String
Steam ID of the user, as a string
Array
groups
Array of group ID strings
const api = require('steam-js-api')
api.setKey('{{YOUR KEY}}')
api.getUserGroups('76561198099490962').then(result => {
console.log(result.data)
}).catch(console.error)
This would display an object that looks like this one:
{
"groups": [
"3284297",
"5165781",
"5233424",
"5647945",
"5791388",
"5793658",
"8600182",
"9958636",
"25100141",
"33392184",
"33650713"
]
}
Converts custom account and group names to an ID. Please do not use the entire URL, instead extract the actual name from the custom url before calling this function. For Steam accounts, custom urls are https://steamcommunity.com/id/{{VANITY NAME}}
and for groups is https://steamcommunity.com/groups/{{VANITY NAME}}
Do not use the third type: game groups. From the surface it looks like official game groups are not accessible by normal methods, and only show up as outdated web pages with little to no content. Official game groups will probably be deprecated in due Valve time, or may be suddenly thrown at our faces. Either way, I wouldn't recommend using them at all right now, because like I said, you can't even access the group pages by normal methods.
resolveName(name[, type])
name
required
Type:
String
Custom name found in the url of the account or group
type
Type:
String
Default:user
Type of name to be resolved, supported values are
user
andgroup
. The integer values 1 and 2 can be passed instead.
String
id
The full Steam ID for users, or the group ID for groups
const api = require('steam-js-api')
api.setKey('{{YOUR KEY}}')
api.resolveName('almic').then(result => {
console.log(result.data)
}).catch(console.error)
This would display an object that looks like this one:
{
"id": "76561198099490962"
}
> GetTradeHistory
> GetTradeStatus
> GetBadges
> GetCommunityBadgeProgress
> GetOwnedGames
> GetRecentlyPlayedGames
> GetSteamLevel
> GetAssetClassInfo
> GetAssetPrices
> GetFriendList
> GetPlayerBans
> GetPlayerSummaries
> GetUserGroupList
> ResolveVanityURL
> GetGlobalAchievement...
> GetNumberOfCurrentPlayers
> GetPlayerAchievements
> GetSchemaForGame
> GetUserStatsForGame