Skip to content
API

Steam libraries and hours

Steam games API: owned games and playtime

List the games Steam exposes for an account, sorted by lifetime playtime, with Steam's minute values and decimal hours, and optional playtime over the last two weeks.

Updated

GET /v1/games
curl --fail-with-body \
  -H "Authorization: Bearer $WOK_API_KEY" \
  "https://woksteamapi.com/v1/games?steam_id=76561198000000001&include_recent=1"

Endpoints

A WOK key with all-purpose or Players access. Free Developer keeps its own quota, day and minute limits and the WOK Discord membership rule. Each single read uses one quota unit.

GET /v1/gamesVisible Steam games and playtime
GET /v1/games/recentSteam playtime over the last two weeks
POST /v1/games/batchVisible Steam game hours for up to 20 accounts
POST /v1/games/recent/batchRecent Steam game hours for up to 20 accounts

Request

Parameters of GET /v1/games, as published in the OpenAPI description.

ParameterRequiredAccepted valuesNotes
steam_idRequiredstringA 17-digit SteamID64. Profile URLs and vanity names are not accepted here.
include_recentOptionalinteger (default 0)Set to 1 to add recent_playtime from GetRecentlyPlayedGames and fill known two-week minutes for matching games. Default 0 keeps the owned-games-only path.
achievement_appidOptionalintegerAdds achievement progress for this one visible game.

Response fields

Fields of a 200 response. A type that includes null means Steam may not publish that value.

FieldTypeMeaning
steam_idstringThe SteamID64 the response describes.
game_countinteger or nullNumber of games Steam reports for the account; null when unknown.
gamesarray of objectGames Steam exposes for the account, sorted by lifetime playtime.
games.appidintegerSteam AppID.
games.namestringGame name.
games.playtime_foreverinteger or nullLifetime playtime in minutes, as Steam reports it.
games.playtime_2weeksinteger or nullPlaytime over the last two weeks in minutes; null when unknown.
games.playtime_hoursnumber or nullLifetime playtime in decimal hours.
games.playtime_2weeks_hoursnumber or nullTwo-week playtime in decimal hours.
games.achievement_progressobjectProgress for the game named by achievement_appid.
total_playtime_minutesinteger or nullSum over visible games only.
total_playtime_hoursnumber or nullThe same total in decimal hours.
visibilitystring: visible, unknownunknown when the games array is empty: a private library and an empty library cannot be told apart.
achievement_appidintegerThe AppID you asked achievement progress for.
achievement_statusstringPresent with achievement_appid: whether progress for that one game was available.
recent_playtimeobjectPresent with include_recent=1: the result of Steam's recently played list.
completebooleanTrue only for a nonempty unique valid-AppID list with all lifetime minutes and a matching source game_count; empty, hidden or incomplete data retains null totals.

What your code should handle

The cases that most often turn into wrong numbers in a product.

Empty does not mean private. An empty games array comes with visibility=unknown. Steam gives no way to tell a private library from an empty one.

Totals cover visible games. total_playtime_minutes and total_playtime_hours are summed over the games Steam exposes, not over everything the account owns.

Recent hours are optional. include_recent=1 adds two-week minutes for matching games. Missing recent data stays unknown; it is not zero.

Steam achievements APIRust hours and statsSteam profile API

Status codes

Errors carry a typed code and, where it applies, Retry-After. Respect it on 429 and 503.

StatusMeaning
200OK
400Invalid request
401Missing or invalid API key
402Quota exhausted or required add-on is not active
403Resource is private or restricted; discord_required means free access requires current WOK Discord membership
422Query or JSON body validation failed
429Rate limit exceeded
502Upstream service failed
503Required upstream capability is unavailable; discord_unavailable means free membership verification should be retried

Related requests

The same key reads these. Batches use one quota unit per unique account or pair, including cached results.

GET /v1/games/recent

Steam playtime over the last two weeks.

FieldRequiredAccepted valuesNotes
steam_idRequiredstringA 17-digit SteamID64. Profile URLs and vanity names are not accepted here.

POST /v1/games/batch

Visible Steam game hours for up to 20 accounts.

FieldRequiredAccepted valuesNotes
steamidsRequiredarray of string (1 to 20 entries)User SteamID64 strings, deduplicated in first occurrence order.
appidsOptionalarray of integer (1 to 50 entries)Optional local filter for returned games, applied after the shared owned-games cache read. Omit to return every exposed game.
include_recentOptionalboolean (default False)Add recent_playtime from GetRecentlyPlayedGames and fill known per-game recent minutes for matching AppIDs; up to two cold Steam lookups per account, with unchanged quota.

POST /v1/games/recent/batch

Recent Steam game hours for up to 20 accounts.

FieldRequiredAccepted valuesNotes
steamidsRequiredarray of string (1 to 20 entries)SteamID64 strings. Duplicates are removed before quota is counted.
appidsOptionalarray of integer (1 to 50 entries)Optional local recent-list filter; source game_count and recent totals remain unfiltered.

Questions

Do I need a Valve Steam Web API key?

No. WOK holds the Steam Web API key on its servers and makes the Steam call for you. Your server sends a WOK key in the Authorization header.

Can I tell a private library from an account with no games?

No. Both return an empty games array, so WOK reports visibility=unknown instead of guessing.

How do I read hours for many players?

POST /v1/games/batch accepts 1 to 20 SteamID64 strings and uses one quota unit per unique ID. An optional list of up to 50 AppIDs filters the result without another Steam request.

Where does two-week playtime come from?

From Steam's recently played list. Use GET /v1/games/recent on its own, or include_recent=1 on GET /v1/games to fill it in for matching games.

Steam account bansSteam friend listsSteam achievementsSteam level and badges