steamsteam-web-api

Steam: how to get the package name from a package-id?


The problem is rather simple: "Steam" (that is, the gaming DRM platform), has "apps" and "packages"; the latter are pretty much licenses that are stored in your account and grant the apps (aka games) that you own.

If you look at the license overview (this only works if you have a Steam account logged in, of course -- but if you don't, why are you even reading this question) -- the names shown there are NOT technically the name of the games you have, it's the names of the packages. This is why you might see names like "Space Crew: Legendary Edition Limited Free Promotional Package - Mar 2024" in this list.

I have no problems getting game names from app-ids and connecting games (apps) and packages (licenses).

SteamDB can also show package names, for everything. And they are not related to Valve, so they don't have access to internal databases or anything like that either.

Now, I've been trying to obtain these package names programmatically, given a package-id (or right now, anything -- if I can get package-names in any way, shape or form I can probably find a way to connect them to their package-id). SteamDB also calls them sub-id but that's the same thing.

I have a working client application aka bot aka whatever you want to call it, so I don't even care whether it's a protobuf message sent through the client connection, an authenticated web query (i.e. http(s) query or webpage requiring a login), or a public web query that just anyone can use. I have support for everything in the code.

As protobufs go, there is the CMsgClientPICSProductInfoRequest which lets me query information about a package_id -- the response has various information about the package, but no name. Yes, I also added a meta_data_only=false just in case that's not the default.

I also found the StorefrontAPI -- which has a query for packagedetails with a packageids parameter, which looks great. It even does what I expect -- but only for a select few packages. Every hint I see on this API also states that it's unofficial, and since it doesn't provide information for the vast majority of packages, it's obviously not the API that SteamDB uses (they have information on EVERY package, apparently).

I also found a CMsgClientPackageInfoRequest protobuf message, which has a response with an unspecified buffer (this happens occasionally; that buffer tends to be key-value with various items, but I don't currently know what it actually contained). Unfortunately, when I look for the message id so I can actually send it, I find 833 -- which SteamKit doesn't have, except in a file where it's marked as "removed". Still, I tried sending it anyway, and got no response... I can't know whether I was using correctly, but finding the ID as "removed" kind of makes me think that's not the problem.

I was also grepping through SteamKit and the proto files for various keywords and looking at things that popped up, but nothing.

And, of course, Google is generally unhelpful for this.


Solution

  • For packageids you have a license for, it seems lik get/pair package IDs and package names by parsing the HTML of some support pages which are intended for removing and restoring licenses:
    https://help.steampowered.com/en/wizard/HelpWithGameIssue/?appid=RELEVANT_APP_ID&issueid=123 https://help.steampowered.com/en/wizard/HelpWithGameIssue/?appid=RELEVANT_APP_ID&issueid=101 https://help.steampowered.com/en/wizard/HelpPackageRestored?appid=RELEVANT_APP_ID&packageid=PACKAGE_ID

    Visiting the HelpPackageRestored page does restore the license without any further interaction, so you'll want to keep that in mind. Some packageids only work with one page or the other. But even between them, I'm not sure if all packageids work. I'm still looking into this.

    It seems that in the past, a Steam support page could be used to look up any packageid's name. But this was used to find names of unannounced packagesids, which is probably why this functionality is no longer available.