465 words
2 minutes
Steam Family Sharing Library Preview — Introduction

Steam recently rolled out a new family sharing scheme for game libraries. In short, it lets six users form a household whose members can play everyone’s combined library (a union of all games). Unlike the old family sharing, the new Steam Families let multiple members play shared games from the family library at the same time while others are online, and offline access is supported too. One caveat: the same game can’t be played by two members simultaneously — unless the family library happens to hold multiple copies of it. The announcement sparked lively discussion, and plenty of players started scouting communities for quality members to form a household with.

Because leaving a household after joining triggers a one-year cooldown (the vacated seat is also locked for a year), I wanted players to know exactly which new games they’d gain access to before committing — so I set out to build a web app on top of the Steam Web API that shows just that.

Feasibility#

The Steam Web API exposes each user’s game inventory, so this should work in theory.

The endpoint http://api.steampowered.com/ISteamWebAPIUtil/GetSupportedAPIList/v1/?key=xxx&steamids=xxx lists every API a given key can call. Querying it confirmed that my key can use an endpoint called GetOwnedGames to look up a user’s inventory.

{
"name": "GetOwnedGames",
"version": 1,
"httpmethod": "GET",
"description": "Return a list of games owned by the player",
"parameters": [
{
"name": "key",
"type": "string",
"optional": false,
"description": "Access key"
},
{
"name": "steamid",
"type": "uint64",
"optional": false,
"description": "The player we're asking about"
},
{
"name": "include_appinfo",
"type": "bool",
"optional": false,
"description": "true if we want additional details (name, icon) about each game"
},
{
"name": "include_played_free_games",
"type": "bool",
"optional": false,
"description": "Free games are excluded by default. If this is set, free games the user has played will be returned."
},
{
"name": "appids_filter",
"type": "uint32",
"optional": false,
"description": "if set, restricts result set to the passed in apps"
},
{
"name": "include_free_sub",
"type": "bool",
"optional": false,
"description": "Some games are in the free sub, which are excluded by default."
},
{
"name": "skip_unvetted_apps",
"type": "bool",
"optional": true,
"description": "if set, skip unvetted store apps"
},
{
"name": "language",
"type": "string",
"optional": false,
"description": "Will return appinfo in this language"
},
{
"name": "include_extended_appinfo",
"type": "bool",
"optional": false,
"description": "true if we want even more details (capsule, sortas, and capabilities) about each game. include_appinfo must also be true."
}
]
}

Tech choices#

Server side#

The raw responses from the Steam Web API aren’t particularly friendly to work with, so I put a Node.js layer in front that preprocesses and reshapes the data before handing it to the frontend.

Client side#

Built with React + Ant Design.

Prerequisites#

You’ll need a Steam Web API key.

Visit https://steamcommunity.com/dev/apikey and follow the instructions to create one if you don’t have it yet.

As shown below.

Creating a Steam Web API key

Steam Family Sharing Library Preview — Introduction
https://www.mihouo.com/en/posts/front/steamshared/introduction/
Author
Jia
Published at
2024-04-19
License
CC BY-NC-SA 4.0