7

I'm working on a Steam Roulette program, and I'm trying to create filters. One of the filters I'd like to implement is (if the user data was loaded with SteamWorks), is to return a list of games (preferably in App ID form) that he/she has installed on his computer that I can then compare to my original full list to remove unneeded values; like a filter to get rid of games the user doesn't have installed on his machine from the list of possible games that can be picked.

In case:

Steam Roulette was an online trend, in the form of a web application in which the user picks a random game out of his/her Steam library and plays it.

Right now, I'm retrieving user details using the Web API using the Steam ID retrieved with SteamUser.GetSteamID().ToString() and feeding it into:

string apiURL = "http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key=" + APIKey + "&steamid=" + id + "&format=json&include_appinfo=1";

And reading the returned .json information from there to generate a list of games that the program can pick from.


Is there any SteamWorks function I can use to retrieve a list of games that is installed on the computer, as opposed to all the games that the player owns/has, without reading the steam libraries for their respective folders?

If no possible function exist, is there any way to manually (outside the API) get a list of installed games?

Andrew M
  • 4,208
  • 11
  • 42
  • 67
Timothy
  • 364
  • 1
  • 12
  • 24

2 Answers2

12

This file C:\Program Files (x86)\Steam\steamapps\libraryfolders.vdf

Contains the paths to all local steam libraries. (excluding the one in the default library)

Then get just get the value in the steam_appid.txt that's located in each game's folder ({library}\steamapps\common\{game}\steam_appid.txt) and you will have a list of all installed games' steam app id.

Vdf files are valve proprietary files (like JSON). You can use Vdf.NET to parse the vdf files similar to JSON.

  • 1
    Just a note: it seems not all games have the `steam_appid.txt` file, currently trying to find a way around this as I am trying to do the same thing. – Mitchell Van Manen Sep 11 '16 at 12:41
  • 6
    Instead of trying to fetch `steam_appid.txt` (which seems to be absent for most games), you can try to process the files `appmanifest_*.acf`which are located in the `steamapps` folder of each library. Each file represents an installed game, the file name contains the app id, and the file itself contains even more useful information. – Benlitz May 07 '17 at 06:09
  • any idea how to tell if the game is marked as a VR game? – stackers Feb 13 '20 at 16:23
  • While not relative for all, i'm using linux with three steam folders/libs. Each of them have a `libraryfolders.vdf` but it does not contain any reference to the others / useless currently (2022). But there is `~/.steam/registry.vdf` which looks like a extract of a windows registry / contains a parsable listing – Angry 84 Oct 17 '22 at 18:39
2

I was looking into doing this myself. Unfortunately the steam api does not return a value that could reliably tell you if it's installed on your pc. However looking through the folder where your games are installed (mine is "C:\Program Files (x86)\Steam\steamapps\common") I found that each game folder contains a text file with it's steam app id. So you could recursively look in each folder and build a list of IDs first. Then, use the app ID list with the JSON getOwnedGames for the full name and other info.

thornzero
  • 21
  • 3
  • That's what I thought, but one of the problems that came up was that your Steam Library Folders can be... Anywhere. And, that we can have more than one. – Timothy Dec 14 '15 at 04:45
  • The text file with the steam ID is also not a requirement. – MrSlippers Dec 15 '15 at 15:26