6

I am wondering is there a way that if a user enters their 'Steam Username' that you can then find their 'SteamID'. I have been looking all through the 'Steam API' and have found no information about this.

My idea was for a user to enter their 'Steam Username' into a box and when they submit the form, I am able to fire a request of to a steam web service which returns me back that user's 'SteamID'.

My question is abit different than other users as I just want to just search by entering the Steam Username. It should not matter if a user has got a CustomURL or not, as when I send the Steam Username to a 'Web Service' it should return back a users ID.

If anyone has any information that could help me with this it would be greatly appreciated.

user3091919
  • 215
  • 4
  • 14
  • possible duplicate of [Get steamID by user nickname](http://stackoverflow.com/questions/19247887/get-steamid-by-user-nickname) – showdev Jun 16 '15 at 22:00
  • Obviously not a solution to your specific problem, but exactly what you're describing already exists here: http://steamidfinder.com/ – DBS Jun 17 '15 at 00:34
  • @DBS This website does not allow you to use Steam Username to search for the ID? – user3091919 Jun 17 '15 at 08:11
  • @showdev The link you provided the answer that is given talks about CustomURL. What i am looking for is that a user can search their Steam Username, from there it will return back there SteamID – user3091919 Jun 17 '15 at 08:13
  • Maybe I misunderstood. I assumed that this addressed your question: `You can't get the steamID from someone's current nickname because nicknames can change and are not unique.` - [barsanuphe](http://stackoverflow.com/questions/19247887/get-steamid-by-user-nickname#answer-23522144) – showdev Jun 17 '15 at 15:57
  • @showdev Steam Profile Usernames are unique? – user3091919 Jun 17 '15 at 18:45

2 Answers2

5

The Steam API is indeed not the best documented API.

I have done a similar task before and I found this page helpful:

The page also includes an example request URL, it looks like this:

http://api.steampowered.com/ISteamUser/ResolveVanityURL/v0001/?key=YOU-API_KEY&vanityurl=USER_NAME
Johann Bauer
  • 2,488
  • 2
  • 26
  • 41
  • Thanks for getting back to me on this. When i get the URL you posted, add my API Key and enter my Steam Username, i get this message. { "response": { "success": 42, "message": "No match" } } – user3091919 Jun 17 '15 at 08:10
  • Yep, that address will only work for a custom profile URL (vanityurl) rather than an actual login name. – DBS Jun 17 '15 at 09:14
2

At the time of writing this is not possible. There is no user search function in the API.

As a workaround in my own app (C#) I simulated the AJAX request made by the Steam Community search page and parsed the response HTML. Bear in mind that the AJAX request needs a session ID from a cookie that's set by the page.

Edgar
  • 4,348
  • 4
  • 40
  • 59