Steam Web API Introduction

One of my pet projects, Finished Games, is reaching a state in which already serves decently as a catalog and tracker. Sure I have a ton of ideas to add, more sources to get games from and many improvements, but the base system is working so I can start to tackle other areas, like automations.

I can manually add games to the database. I can import them from "catalog sources", and if already exists match them with the existing title, update certain fields, etc. But I still need to manually mark those games I own, so if, as in this example, a platform like Steam can provide me with a list of which titles I've got, and maybe which ones I've completed (by checking certain achievements), it's way easier and nicer.

So, without further ado, here's a brief introduction of the Steam Web API endpoints I'm going to use soon to be able to sync user catalogs.

Setup and Documentation

You can register for an API at https://steamcommunity.com/dev, and it is instantaneous, no need to wait for a manual approval.

Once you have an API key, the official docs are at https://developer.valvesoftware.com/wiki/Steam_Web_API.

Basic endpoints

I just need three endpoints to grab user data relevant to my use case.

Obtaining the steamid from a vanityurl (an account friendly name), like "kartones". Not everybody has them setup but I for example do, so better be prepared:

http://api.steampowered.com/ISteamUser/ResolveVanityURL/v0001/?key=YOUR-API-KEY&vanityurl=VANITY-URL

Fetching the list of owned games of a given user. Including game name, which saves you an additional call to fetch game details (which also returns no name for some titles! 😵):

http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key=YOUR-API-KEY&steamid=76561197987342492&format=json&include_appinfo=true

Retrieving achievements by game and user. Not only the unlock status but also the epoch timestamp of when it was unlocked (useful for deltas):

http://api.steampowered.com/ISteamUserStats/GetPlayerAchievements/v0001/?appid=271590&key=YOUR-API-KEY&steamid=76561197987342492

Additional Endpoint

If you want way more info about a game, from the description, release date or the developer name, to screenshots, platforms (Windows, Linux, Mac), genres and more, there is an store endpoint that works without authentication:

http://store.steampowered.com/api/appdetails/?appids=271590

Rate Limits

api.steampowered.com calls are rate-limited to 100k per day according to the API terms of use.

store.steampowered.com is rate-limited against abuse. I read somewhere that seems to be around 200 requests in a 5 minutes window, so you should cache those call results.

Posted by Kartones on 2019-12-01

Comments? Share via Twitter Share via Linkedin