Get steamID by user nickname

前端 未结 4 1716
被撕碎了的回忆
被撕碎了的回忆 2021-02-04 14:02

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

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-04 14:24

    Using PHP and the Steam Condenser project, you can accomplish this.

    require_once('steam/steam-condenser.php');
    
    $playername = 'NAMEOFPLAYER';
    try
    {
        $id = SteamId::create($playername);
    } 
    catch (SteamCondenserException $s)
    {
        // Error occurred
    }
    
    echo $id->getSteamId;
    

    There are usage examples in the wiki for the project if you need more information.

提交回复
热议问题