WebAPI
The Steam WebAPI is documented here and here. The mapping of the WebAPI data to each data format is described in the latter link.
This page documents the WebAPI calls that allow you to retrieve information from the item system in Team Fortress 2.
Calls to the TF2 WebAPI require a valid Steam WebAPI Key to function. You can get your own WebAPI Key here. Each example URL will only work after replacing "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" with your WebAPI Key.
Contents
Common elements
Arguments
All TF2 methods take the following arguments in their URL:
- key: Your Steam WebAPI Key. Without this, the server will return a 403 Forbidden HTTP status.
- 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 a format is not specified, the data will be returned with the default of JSON.
Result structure
All TF2 methods return a "result" object containing a status code (at "status"), and either the data requested or a status message explaining why the data was not returned (at "statusDetail").
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
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
If a user's 64-bit ID is not readily available, it can be obtained either by an OpenID transaction or by fetching the XML version of the user's community profile page. This is accomplished by adding "?xml=1" to a normal community URL (for example: http://steamcommunity.com/id/stragglerastic?xml=1) and reading the value given in the steamID64 tag.
Implementations
- Steam Condenser – Ruby, PHP, and Java library
- TF2 Web APpy – Small Python class
- Steamodd – Python module
- OPTF2 – Online viewer
- libsc – 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.