Sai Darshan
Sai Darshan

Reputation: 387

Steam Web API Is there a method for getting a user friend's list with their avatar and steam name?

I want to retrieve a user's friend list with their avatar and steam name.

There is a method GetFriendList() from the web API .But it only returns the steamid's of the friends and a unix timestamp from when the user is a friend.

I was wondering is there a method or a npm package which gets the user's friend's list with their avatar and steam name.I have been all over steam web API documentation,I was unable to find this type of method.Any help is appriciated.Thank YOU

Upvotes: 0

Views: 6468

Answers (3)

Ninjaxor
Ninjaxor

Reputation: 1008

I hope you found the web API to work out in your situation, however the Web API is tricky to use as a general solution; steam's docs state that it won't return the friend-list if the user's profile is set to private.

The more standard approach to interacting with Steam's friend list appears to be using their Steam Workshop API which is done in C++, but fortunately it looks like there's a javascript wrapper called GreenWorks that makes working with it fast.

Upvotes: 0

Erik Russell
Erik Russell

Reputation: 881

You should start by getting their friends list here

Just add your API key.

Then you can loop through all the Steam ids there and run them through

GetPlayerSummaries

There you are provided with all the users detailed info

I hope that helps. The return data is JSON

Upvotes: 0

Gergely Szabo
Gergely Szabo

Reputation: 899

I think your options are:

a, Get the friend list through the API and use the GetPlayerSummaries endpoint to get more info about the users (including the avatar).

b, Load https://steamcommunity.com/id/${steamID}/friends/ page and parse the HTML for the images (you will need an active session for this).

Upvotes: 0

Related Questions