This topic has been locked
ralch Jun 26, 2019 @ 1:52pm
How to get detailed steam profile status via API?
How do I return the detailed profile status via the API? I understand that I can call the 'GetPlayerSummaries', but that only return the game being played. For instance, via my friend list, I can see that personA is playing Dota 2 "As Windranger level 2". How do retrieve THAT information?

Thanks in advance.

Best,
Gustavo

Something went wrong while displaying this content. Refresh

Error Reference: Community_9745725_
Loading CSS chunk 7561 failed.
(error: https://community.cloudflare.steamstatic.com/public/css/applications/community/communityawardsapp.css?contenthash=789dd1fbdb6c6b5c773d)
Showing 1-9 of 9 comments
MalikQayum Jun 26, 2019 @ 1:57pm 
it is a specific game, there you need to look at the public api for that game, in this case dota.
my guess would be without looking into it too much would be that you need to look into the method IDOTA2Match
MalikQayum Jun 26, 2019 @ 2:04pm 
also ignore that guy above, just a useless post count spammer.

so i guess you would need to get the match id from the person you want the hero selection from, so you would need to acquire that, i would think.

https://steamapi.xpaw.me/#IDOTA2Match_570

but do test around yourself, you might figure it out then.
the jİN Jun 26, 2019 @ 2:17pm 
+
ralch Jun 26, 2019 @ 10:21pm 
Thanks Malik. What you'r saying seems reasonable - I'll look into it
ralch Jun 27, 2019 @ 9:43am 
I've tried some different things, but unfortunately I'm simply not able to get 'match_id' of a live game. Getting 'match_id' of completed games is no problem, but getting from a live game (...)
MalikQayum Jun 27, 2019 @ 3:00pm 
Originally posted by GUSTAVOBRUNO:
I've tried some different things, but unfortunately I'm simply not able to get 'match_id' of a live game. Getting 'match_id' of completed games is no problem, but getting from a live game (...)
I apologize, reason for my vague answer was that i am not familiar myself with the dota api at all, however i took the time to find out something for you.

so i found this api https://docs.opendota.com/ this has everything you need.

so first you need to get the account id for the person you want to retrieve hero selection status from, I used my friends as he was the only one currently playing dota 2 as omniknight.

get the account id, which ever way you find easiest, i used steamdb:
- https://steamdb.info/calculator/76561197966244188/
- Steam3 ID [U:1:5978460] > we only need the end bit after the second colon "5978460"

api request call 1:
https://api.opendota.com/api/players/5978460/matches
the first match is the current match

{ "match_id":4869142827, "player_slot":128, "radiant_win":false, "duration":2116, "game_mode":22, "lobby_type":7, "hero_id":57, "start_time":1561671180, "version":null, "kills":4, "deaths":2, "assists":27, "skill":null, "leaver_status":0, "party_size":null }

this is what we need from here : "hero_id":57

now we need to know which hero that is so we need to get a list of hero_ids and look for id 57:
https://api.opendota.com/api/heroes

{ "id":57, "name":"npc_dota_hero_omniknight", "localized_name":"Omniknight", "primary_attr":"str", "attack_type":"Melee", "roles":["Support","Durable","Nuker"], "legs":2 }

and then we know which hero the person is playing currently ingame, this guy was ingame playing while i checked so i know this works, this also means you are able to create some live stat for that person, such as kills etc.
Last edited by MalikQayum; Jun 27, 2019 @ 3:16pm
ralch Jun 28, 2019 @ 12:05am 
A million thanks for your detailed reply! I've actually made a variety of Dicord dota 2 bots, so I'm pretty familier with the mentioned API.

Still got one question though: how do I know that the game is actually live? I understand that I get the 'latest' games with the above, but that does not say anything whether the game is live or not?
ralch Jun 28, 2019 @ 12:07am 
I guess I could use the 'start_time' and 'duration' in order to do some checking.
MalikQayum Jun 28, 2019 @ 1:11am 
Originally posted by GUSTAVOBRUNO:
I guess I could use the 'start_time' and 'duration' in order to do some checking.
yep you could indeed use that, but as you mentioned, you don't really know if a game ended because a match could literally end at any time.

so my approach would be doing a second request to check whether or not either of the values of the keys have changed.

such as the one you mentioned > start_time

maybe even look at the duration to see if it is static, it might be an indicator whether or not a match would be over or not.

(er du dansker?)
Last edited by MalikQayum; Jun 28, 2019 @ 1:21am
Showing 1-9 of 9 comments
Per page: 1530 50

Date Posted: Jun 26, 2019 @ 1:52pm
Posts: 9