3
\$\begingroup\$

How can I get the current number of Steam friends online in order to insert it into a script or program? I'm looking to use this value to do something like changing an LED colour or for providing data for a desktop widget etc.

Is this possible? How do I get access to that number?

P.S. I got my idea from here: Xbox Live Traffic Light Notifies You When Friends are Gaming

\$\endgroup\$
7
\$\begingroup\$

Steam does not support it, but there is a workaround to get it done programmatically. However, private profiles will not work, so you will not be able to see a friend's status, even if they allowed you to see it. The API is public and it will only be able to see and parse public profiles.

In short you need to query Steam's web API in a loop:

  1. GetFriendList - get all friends of that account
  2. For each friend use GetPlayerSummaries and the personastate in the returned result will include their online status.
  3. Save results, repeat, compare.
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy