Search code examples
phpsteam-web-api

Get steamID by user nickname


Is it possible to get user's steamID by his nickname? I didn't find solution in steam API documentation. The only one thing that I found is an old post on http://dev.dota2.com :

You can use this to search the Dota2 API directly using the player_name option of GetMatchHistory You can then find their 32-bit ID in the list and then convert it to a 64-bit ID.

But now GetMatchHistory function does not have player_name parameter. Now it requires account_id.

So how the websites like http://dotabuff.com/search?q=Dendi get this info?


Solution

  • You can use

    GET http://api.steampowered.com/ISteamUser/ResolveVanityURL/v0001/

    to get the SteamID from the custom URL of a Steam Profile. See http://wiki.teamfortress.com/wiki/WebAPI/ResolveVanityURL

    You can't get the steamID from someone's current nickname because nicknames can change and are not unique.