Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
my guess would be without looking into it too much would be that you need to look into the method IDOTA2Match
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.
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
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
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.
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?
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?)