Difference between revisions of "WebAPI"

From Team Fortress Wiki
Jump to: navigation, search
(Methods: bump bump bumpbump)
(Methods: awn)
Line 30: Line 30:
 
* [[/GetAssetClassInfo|GetAssetClassInfo]]
 
* [[/GetAssetClassInfo|GetAssetClassInfo]]
 
* [[/ResolveVanityURL|ResolveVanityURL]]
 
* [[/ResolveVanityURL|ResolveVanityURL]]
 +
* [[/GetNewsForApp|GetNewsForApp]]
  
 
== Notes ==
 
== Notes ==

Revision as of 02:16, 8 December 2011

The Steam Web API is documented at http://steamcommunity.com/dev and http://developer.valvesoftware.com/wiki/Steam_Web_API. The mapping of the API data to each data format is described on the latter.

This page documents the web API calls that allow you to retrieve information from the item system in Team Fortress 2.

Calls to the TF2 Web 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.

Common elements

Arguments

All TF2 methods take the following arguments in their URL:

  • key: Your Steam Web API 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 at

http://developer.valvesoftware.com/wiki/Steam_Web_API#Formats. If no format is 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/robinwalker?xml=1) and reading the value given in the steamID64 tag.

Implementations

See also