API

Steam Web API.
Contents.
License and further documentation.
A license for the Steam Web API and additional documentation can be found at http://steamcommunity.com/dev.
The full reference is available at https://partner.steamgames.com/doc/webapi_overview. Many features are only allowed to publisher API key owners.
Formats.
Every method can return its results in 3 different formats: JSON, XML, and VDF. Each format represents the data described herein differently:
The API returns an object containing the named object with the result data. Arrays are represented as an array with the name of the type of the objects in the array (ie. an object named “items” containing an array of objects of type “item” would be represented as an object named “items” containing an array named “item” containing several objects following the “item” structure). Null is represented as JSON’s null.
XML Attributes are not used. Arrays are represented as a series of sub-elements in the containing element of the type of the array. Null is represented by the word “null” between the element’s tags.
VDF (Valve Data Format)
This is Valve’s internal data format, as seen in uses like TF2’s “scripts” folder (available in “team fortress 2 client content.gcf”). TF2’s GetSchema returns data similar to “items/items_game.txt” (although qualities are not expanded into objects with a “value” field). Documentation of the format is in progress here. Arrays in the data are represented as a VDF array with the name of the type of the objects in the array, with a VDF array being an object with each item being prefixed with its numeric key as a quoted string. Null is represented as an empty string.
CSV (Comma Separated Values)
There are some online converters which you can use to automatically convert JSON to CSV such as https://json-csv.com. CSV files can be opened in a spreadsheet like Excel. Other online JSON converters like https://konklone.io/json/ or https://jsontoexcel.com can be helpful too.
If no format is specified, the API will default to JSON.
Interfaces and method.
All interfaces and method are self-documented through the ISteamWebAPIUtil/GetSupportedAPIList call. This can be found here.
When passed a key= parameter, GetSupportedAPIList will show all APIs that your key can access. Without it (as above), it only displays APIs that do not require an API key.
Game interfaces and methods.
Team Fortress 2 functions are described at http://wiki.teamfortress.com/wiki/WebAPI.
GetNewsForApp (v0002)
GetNewsForApp returns the latest of a game specified by its appID.
Arguments.
app >Result layout.
An appnews object containing:
app >GetGlobalAchievementPercentagesForApp (v0002)
Returns on global achievements overview of a specific game in percentages.
Arguments.
game >GetGlobalStatsForGame (v0001)
Arguments.
game >GetPlayerSummaries (v0002)
Returns basic profile information for a list of 64-bit Steam IDs.
Arguments.
steam >Return Value.
Some data associated with a Steam account may be hidden if the user has their profile visibility set to “Friends Only” or “Private”. In that case, only public data will be returned.
Public Data.
steam >Private Data.
realname The player’s “Real Name”, if they have set it. primaryclan >GetFriendList (v0001)
Returns the friend list of any Steam user, provided their Steam Community profile visibility is set to “Public”.
Arguments.
steam >Result data.
The user’s friends list, as an array of friends. Nothing will be returned if the profile is private.
steam >GetPlayerAchievements (v0001)
Returns a list of achievements for this user by app id.
Arguments.
steam >Result data.
A list of achievements.
apiname The API name of the achievement achieved Whether or not the achievement has been completed. unlocktime Unlock timestamp (unix). Defaults to “0” if achievement was not unlocked or time is unknown. name (optional) Localized achievement name description (optional) Localized description of the achievement.
GetUserStatsForGame (v0002)
Returns a list of achievements for this user by app id.
Arguments.
steam >GetOwnedGames (v0001)
GetOwnedGames returns a list of games a player owns along with some playtime information, if the profile is publicly visible. Private, friends-only, and other privacy settings are not supported unless you are asking for your own personal details (ie the WebAPI key you are using is linked to the steamid you are requesting).
Arguments.
steam >Result layout.
game_count the total number of games the user owns (including free games they’ve played, if include_played_free_games was passed) A games array, with the following contents (note that if “include_appinfo” was not passed in the request, only app >GetRecentlyPlayedGames (v0001)
GetRecentlyPlayedGames returns a list of games a player has played in the last two weeks, if the profile is publicly visible. Private, friends-only, and other privacy settings are not supported unless you are asking for your own personal details (ie the WebAPI key you are using is linked to the steamid you are requesting).
Arguments.
steam >Result layout.
total_count the total number of unique games the user has played in the last two weeks. This is mostly significant if you opted to return a limited number of games with the count input parameter A games array, with the following contents: appid Unique identifier for the game name The name of the game playtime_2weeks The total number of minutes played in the last 2 weeks playtime_forever The total number of minutes played “on record”, since Steam began tracking total playtime in early 2009. img_icon_url , img_logo_url – these are the filenames of various images for the game. To construct the URL to the image, use this format: http://media.steampowered.com/steamcommunity/public/images/apps/ / .jpg. For example, the TF2 logo is returned as “07385eb55b5ba974aebbe74d3c99626bda7920b8”, which maps to the URL: [2]
IsPlayingSharedGame (v0001)
IsPlayingSharedGame returns the original owner’s SteamID if a borrowing account is currently playing this game. If the game is not borrowed or the borrower currently doesn’t play this game, the result is always 0.
Arguments.
steam >Result layout.
lender_steam >GetSchemaForGame (v2)
GetSchemaForGame returns gamename, gameversion and availablegamestats(achievements and stats).
Arguments.
app >Result layout.
game gameName(string) gameVersion (int) availableGameStats achievements(array) name defaultvalue displayName hidden description icon icongray stats(array) name defaultvalue displayName.
GetPlayerBans (v1)
GetPlayerBans returns Community, VAC, and Economy ban statuses for given players.
Arguments.
steam >Result layout.
players List of player ban objects for each 64 bit >IEconService.
The EconService provides interfaces for Trade Offers. You can read about the APIs on the IEconService page.
Community data.
The Steam community data interface (XML only) is described here: https://partner.steamgames.com/documentation/community_data.
Calling Service interfaces.
There is a new style of WebAPI which we refer to as “Services”. They function in many ways like the WebAPIs you are used to, the main difference being that all service APIs will accept their arguments as a single JSON blob in addition to taking them as GET or POST parameters. To pass in data as JSON, invoke the webapi with a parameter set like:
Note that the JSON will need to be URL-encoded. The “key” and “format” fields should still be passed as separate parameters, as before. POST requests are supported as well.
You can identify if a WebAPI is a “Service” by the name of the interface; if it ends in “Service” like “IPlayerService”, then it supports this additional method of passing parameter data. Some Service methods have parameters that are more complex structures and require this different input format.