Search code examples
apiauthenticationinterfacesteamsteam-web-api

Get SteamID by Steam Apikey


As described, I want to get the SteamID from the Steam apikey. I need this to verify the apikey users gave me after doing a Steam login to my website.

What I have tried so far is using the Steam Web Api documentation

I have tried almost every interface from the documentation. The most promising ones were from the IEconService e.g. GetTradeOffers or GetTradeHistory, they deliver a response only dependent on the apikey but they don't return the corresponding SteamID.


Solution

  • If anyone else comes across this problem here is the solution I'm using.

    First of all I send a tradeoffer to the account logged in via Steam. Next, I use the interface DeclineTradeOffer to decline the trade with the apikey I'm trying to verify. If this interface responds with code 200, the trade is cancelled and the apikey belongs to the account logged in via Steam.