Title: Steam Web API Introduction
Slug: steam-web-api-introduction
Date: 2019-12-01 15:55:00
Author: Kartones
Lang: en
Tags: Development, Game Dev, Tools
og_image:
Description: An introduction to the Steam Web API, detailing how to register for an API key, use basic endpoints to obtain user data, and adhere to rate limits.


*2026-01 Update*: [In this PR](https://github.com/Kartones/finished-games/pull/139) I have implemented fetching and synchronizing a user's Steam library/catalog, making use of most of the endpoints mentioned in this post.


One of my pet projects, [Finished Games](https://github.com/Kartones/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](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](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:

```
https://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:

```
https://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):

```
https://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:

```
https://store.steampowered.com/api/appdetails/?appids=582160
```


### Rate Limits

`api.steampowered.com` calls are rate-limited to 100k per day [according to the API terms of use](https://steamcommunity.com/dev/apiterms).

`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.
