Difference between revisions of "WebAPI"

From Team Fortress Wiki
Jump to: navigation, search
(Methods)
(Bolded title of page, Cleanup)
Line 1: Line 1:
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.
+
The [[Steam]] '''WebAPI''' is documented [http://steamcommunity.com/dev here] and [http://developer.valvesoftware.com/wiki/Steam_Web_API here]. The mapping of the WebAPI data to each data format is described in the latter link.
  
This page documents the web API calls that allow you to retrieve information from the item system in Team Fortress 2.
+
This page documents the WebAPI 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 [http://www.steamcommunity.com/dev/apikey here]. Each example URL will only work after replacing "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" with your API key.
+
Calls to the TF2 WebAPI require a valid Steam WebAPI Key to function. You can get your own WebAPI Key [http://www.steamcommunity.com/dev/apikey here]. Each example URL will only work after replacing "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" with your WebAPI Key.
  
 
== Common elements ==
 
== Common elements ==
 
 
=== Arguments ===
 
=== Arguments ===
 
 
All TF2 methods take the following arguments in their URL:
 
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.
+
*'''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 ("'''<tt>json</tt>'''" for JSON, "'''<tt>xml</tt>'''" for XML, or "'''<tt>vdf</tt>'''" for VDF). The structure of the data for each format is described at
+
*'''format''' ''(optional)'': The format to return the data in ("'''<tt>json</tt>'''" for JSON, "'''<tt>xml</tt>'''" for XML, or "'''<tt>vdf</tt>'''" for VDF). The structure of the data for each format is described [http://developer.valvesoftware.com/wiki/Steam_Web_API#Formats here]. If a format is not specified, the data will be returned with the default of JSON.
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 ===
 
=== Result structure ===
 
+
All TF2 methods return a "'''<tt>result</tt>'''" object containing a status code (at "'''<tt>status</tt>'''"), and either the data requested or a status message explaining why the data was not returned (at "'''<tt>statusDetail</tt>'''").
All TF2 methods return a "'''<tt>result</tt>'''" object containing a status code (at "'''<tt>status</tt>'''") and either the data requested or a status message explaining why the data was not returned (at "'''<tt>statusDetail</tt>'''").
 
  
 
=== Terminology ===
 
=== 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, "<tt>TF_Weapon_Jar</tt>" is defined as "<tt>[[Jarate|Jar Based Karate]]</tt>" in "tf/resource/tf_english.txt" (as found in "team fortress 2 content.gcf").
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, "<tt>TF_Weapon_Jar</tt>" is defined as "<tt>[[Jarate|Jar Based Karate]]</tt>" in tf/resource/tf_english.txt (as found in "team fortress 2 content.gcf").
 
  
 
== Methods ==
 
== Methods ==
 
 
* [[/GetSchema|GetSchema]]
 
* [[/GetSchema|GetSchema]]
 
* [[/GetPlayerItems|GetPlayerItems]]
 
* [[/GetPlayerItems|GetPlayerItems]]
  
 
== Notes ==
 
== Notes ==
 
 
=== List of valid IDs ===
 
=== List of valid IDs ===
 
 
{{anchor|appids}}
 
{{anchor|appids}}
 
* 440: Team Fortress 2
 
* 440: Team Fortress 2
Line 37: Line 29:
 
* 620: Portal 2
 
* 620: Portal 2
  
=== Methods Requiring a 64-bit User ID ===
+
=== 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
+
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.
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 ==
 
== Implementations ==
 
+
* [http://developer.valvesoftware.com/wiki/Steam_Condenser Steam Condenser] Ruby, PHP, and Java library
* [http://developer.valvesoftware.com/wiki/Steam_Condenser Steam Condenser] Ruby, PHP, and Java library.
+
* [http://github.com/swixel/tf2webappy TF2 Web APpy] – Small Python class
* [http://github.com/swixel/tf2webappy TF2 Web APpy] A small Python class.
+
* [http://git.optf2.com/steamodd.git Steamodd] Python module
* [http://git.optf2.com/steamodd.git Steamodd] Python module
+
** [http://optf2.com OPTF2] – Online viewer
** [http://optf2.com OPTF2] online viewer
+
* [http://github.com/yaakov-h/libsc libsc] Objective-C library for iOS (4.0+) and framework for Mac OS X (10.6+)
* [http://github.com/yaakov-h/libsc libsc] An Objective-C library for iOS (4.0+) and framework for Mac OS X (10.6+)
 
  
 
== See also ==
 
== See also ==
 
+
* [[Talk:WebAPI/Feedback|Feedback]] – For requests, suggestions, and issues.
* [[Talk:WebAPI/Feedback|Feedback]] for requests, suggestions, and issues.
+
* [http://developer.valvesoftware.com/wiki/Steam_Web_API Steam Web API] – For more information and other methods.
* [http://developer.valvesoftware.com/wiki/Steam_Web_API Steam Web API] for more information and other methods.
 
  
 
[[Category:Valve]]
 
[[Category:Valve]]
 
[[Category:WebAPI| ]]
 
[[Category:WebAPI| ]]

Revision as of 03:40, 17 September 2011

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.

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

See also

  • Feedback – For requests, suggestions, and issues.
  • Steam Web API – For more information and other methods.