Limone
Limone

Reputation: 11

How can I see a player status (online, offline, playing ...) with Steam Web API?

I have to check an user's status: - Online - Offline - Playing [gamename / gameid]

How can I get the information I need through Steam Web API?

Upvotes: 0

Views: 6269

Answers (1)

Vasiliy
Vasiliy

Reputation: 81

https://api.steampowered.com/ISteamUser/GetPlayerSummaries/v2/?key=APIKEY&format=json&steamids=STEAMID

Response:

"players": [
    {
        "steamid": "...",
        "communityvisibilitystate": 3,
        "profilestate": 1,
        "personaname": "...",
        "lastlogoff": 1468736909,
        "commentpermission": 1,
        "profileurl": "http://steamcommunity.com/id/.../",
        "avatar": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/...jpg",
        "avatarmedium": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/..._medium.jpg",
        "avatarfull": "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/..._full.jpg",
        "personastate": 1,
        "primaryclanid": "...",
        "timecreated": 1312034848,
        "personastateflags": 0,
        "gameextrainfo": "Counter-Strike: Global Offensive",
        "gameid": "730",
        "loccountrycode": "AU",
        "locstatecode": "VIC",
        "loccityid": 4990
    }
]

personastate: 1 - Online;
gameextrainfo: Game;
gameid: GameID.

Upvotes: 3

Related Questions