Listing your private Steam games
At the end of 2023 Valve introduced Steam Private Games, allowing you to hide games in your library from anyone but yourself. I’m not going to make a porn game joke, because as a German I can’t even buy those.
That feature has a useful side effect, which I might elaborate on in another post. Either way: I found myself wanting to determine all the games I had set to Private
. This turned out trickier than it should be – as far as I can tell, neither the Steam client nor website allow you to filter your games on that criterium.
However, if you’re logged in and browse to the All Games
tab of your own Steam Community profile (e.g. this link for my profile), that list does include private games and they sport a fancy little “private” icon:
That means we can extract the information via the JavaScript Console. I don’t know how stable the ._2UkkK2haCjZZi3oNZjrHTt
CSS class is to identify the little crossed-through eye icon, but it remained the same for a couple of weeks now at least. If you know of a less brittle way1 to get this information, I’d love to know!
var privatedGameIcons = document.querySelectorAll('._2UkkK2haCjZZi3oNZjrHTt');
var privatedGames = Array.from(privatedGameIcons).map(function(element) {
return element.parentNode.parentNode.parentNode.querySelector('div').querySelector('span')
});
var result = Array.from(privatedGames).map(function(element) {
return element.innerText + " | " + element.querySelector('a').href;
});
console.log(result.join("\n"));
Here’s what it looks like in action:
Update (2025-05-04): Thanks AazForever for letting me know how how to authenticate with the GetPrivateAppList
endpoint – you can extract a valid access_token
from the HTML source of any steamcommunity.com
page (if you’re logged in, of course). You should absolutely not share this token anywhere – it seems to be valid for 24 hours only, but it’s basically as powerful as your password.
Extract the key via the JavaScript Console:
document.querySelector("[data-loyalty_webapi_token]").getAttribute("data-loyalty_webapi_token");
Then fire a GET
request via curl
to get a clean JSON
list of your private games:
curl -s 'https://api.steampowered.com/IAccountPrivateAppsService/GetPrivateAppList/v1/?access_token=<YOUR-TOKEN>' | jq '.'
{
"response": {
"private_apps": {
"appids": [
10,
300,
550,
221380,
239550,
252490,
321040,
355950,
488060,
700580,
1222730,
2923300
]
}
}
}
-
There’s a private GetPrivateAppList API endpoint, see the update above for how to use it
but my normal API key can’t auth requests to it. When looking at the request via web inspector the return value seems to be encoded, but not sure how. ↩︎