Difference between revisions of "WebAPI"
(i-ghost missed one! Also might as well start this now) |
|||
Line 10: | Line 10: | ||
;key: Your Steam Web API key. Without this, the server will return an HTTP 403 (forbidden) error. | ;key: Your Steam Web API key. Without this, the server will return an HTTP 403 (forbidden) error. | ||
− | ;format | + | ;{{API optional|format}}: The format to return the data in ("'''<code>json</code>'''" for JSON, "'''<code>xml</code>'''" for XML, or "'''<code>vdf</code>'''" for VDF). The structure of the data for each format is described [[vdc:Steam_Web_API#Formats|here]]. If no format is specified, the data will be returned with the default of JSON. |
=== Terminology === | === Terminology === | ||
Line 18: | Line 18: | ||
== Methods == | == Methods == | ||
− | ;[[/GetSchema|GetSchema]]: | + | ;[[/GetSchema|GetSchema]]: Information about the items in a supporting game. |
;[[/GetPlayerItems|GetPlayerItems]]: Lists items in a player's backpack. | ;[[/GetPlayerItems|GetPlayerItems]]: Lists items in a player's backpack. | ||
;[[/GetAssetPrices|GetAssetPrices]]: Prices of items in the economy. | ;[[/GetAssetPrices|GetAssetPrices]]: Prices of items in the economy. | ||
Line 26: | Line 26: | ||
;[[/GetGlobalAchievementPercentagesForApp|GetGlobalAchievementPercentagesForApp]]: Statistics showing how much of the player base have unlocked various achievements. | ;[[/GetGlobalAchievementPercentagesForApp|GetGlobalAchievementPercentagesForApp]]: Statistics showing how much of the player base have unlocked various achievements. | ||
;[[/GetPlayerSummaries|GetPlayerSummaries]]: User profile data | ;[[/GetPlayerSummaries|GetPlayerSummaries]]: User profile data | ||
+ | ;[[/GetFriendList|GetFriendList]]: User friend list | ||
== Notes == | == Notes == |
Revision as of 15:45, 12 December 2011
The Steam API is documented on Steam Community and has a Valve Developer Wiki entry, Steam Web API. The mapping of the API data to each data format is described on the latter.
Calls to the API require a valid Steam Web API key to function. You can get your own API Key here. Each example URL will only work after replacing "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
" with your API key.
Contents
Common elements
Parameters
All TF2 methods take the following arguments in their URL:
- key
- Your Steam Web API key. Without this, the server will return an HTTP 403 (forbidden) error.
- format (Optional)
- The format to return the data in ("
json
" for JSON, "xml
" for XML, or "vdf
" for VDF). The structure of the data for each format is described here. If no format is specified, the data will be returned with the default of JSON.
Terminology
A "tokenized string" refers to a string containing "#
"-prefixed tokens that are replaced with the equivalent string in the game's VDF for the chosen language. For instance, "TF_Weapon_Jar
" is defined as "Jar Based Karate
" in tf/resource/tf_english.txt (as found in "team fortress 2 content.gcf").
Methods
- GetSchema
- Information about the items in a supporting game.
- GetPlayerItems
- Lists items in a player's backpack.
- GetAssetPrices
- Prices of items in the economy.
- GetAssetClassInfo
- Asset metadata
- ResolveVanityURL
- Resolve vanity URL parts to a 64 bit ID.
- GetNewsForApp
- News feed for various games
- GetGlobalAchievementPercentagesForApp
- Statistics showing how much of the player base have unlocked various achievements.
- GetPlayerSummaries
- User profile data
- GetFriendList
- User friend list
Notes
List of valid IDs
- 440
- Team Fortress 2
- 520
- Team Fortress 2 Public Beta
- 620
- Portal 2
Methods Requiring a 64-bit User ID
Most API requests that take an ID parameter require a 64 bit ID, if one is not readily available a vanity URL part can be resolved via ResolveVanityURL.
Implementations
- Steam Condenser Ruby, PHP, and Java library.
- TF2 Web APpy A small Python class.
- Steamodd Python module.
- OPTF2 online viewer (source code).
- libsc An Objective-C library for iOS (4.0+) and framework for Mac OS X (10.6+).
See also
- Feedback for requests, suggestions, and issues.
- Steam Web API for more information and other methods.