T³ - XML-APInterface v0.8
This is an overview about the data T³ can deliver throughout its XML-interface. Please contact the webmaster before you start scraping the website. You will need an authorized API-key to get access to these scripts.
Hint: Parameters are case-sensitive and these printed in italic are optional. Valid values for the type boolean are "yes" or "no". Deprecated attributes are lined through.
Content
This is a quick overview of the content of this document:
Call Basics
Each script call delivers an XML document with a root element "data" and an item-child for each result entry. You can choose between a couple of required and optional parameters to specify your request. You need to append your API-key to each call or the request will be declined.
In addition there is a basic caching mechanismn. You can give an unix timestamp as a paramter with your last request time. If there aren't any changes since your last request, you'll get a "403 not modified" HTTP status code from the server.
Parameters:
- (String)key - your API-key
- (int)time - unix timestamp of your last request
Example
There's a quick example which uses an XML parser class to call the API. You can view the source code and its output.
getArmies.php
getArmies delivers the data of the armies/factions supported by T³.
Parameters:
- (String)lang - valid values: de, en, fr (default: en)
- (int)gameId - valid values: ID from getGames (default: unused)
Returns:
- data[]
- item - (int)id, (String)name, (int)groupId, (int)gameId (if not set as parameter)
getCountries.php
getCountries delivers the data of the countries supported by T³.
Parameters:
- (String)lang - valid values: de, en, fr (default: en)
Returns:
- data[]
- item - (int)id, (String)name, (String)iso, (boolean)t3
getGames.php
getGames delivers the data of the games supported by T³.
Parameters:
- (String)lang - valid values: de, en, fr (default: en)
Returns:
- data[]
- item - (int)id, (String)name, (String)abbr, (boolean)t3, (boolean)hasListedArmies
getPlayers.php
getPlayers delivers the players listed on T³.
Parameters (at least one is required):
Returns:
- data[]
- item - (String)nickname, (int)countryId (if not set as parameter), (string)postcode, (string)city
getRanking.php
getRanking delivers the data of the players listed in the NTR.
Parameters:
- (int)gameId - valid values: ID from getGames
- (int)countryId - valid values: ID from getCountries or "0" for ETR (default: 0)
Returns:
- data[]
- item - (int)id, (String)name, (String)lastname, (String)nickname, (int)countryId, (int)place, (float)points
getTournament.php
getTournament delivers extended data of a single tournament.
- (int)id - ID of the tournament
Returns:
- data[]
- item - (int)id, (boolean)t3, (boolean)team, (String)name, (String)uri, (String)location, (String)address, (String)postcode, (String)city, (int)starttime, (int)endtime, (int)entryFee, (int)seats, (int)currentLoad, (int)gameId, (int)countryId, (int)validationTime, (String)summary, (String)description, (boolean)cancelled
getTournaments.php
getTournaments delivers the data of the tournaments listed on T³.
Parameters (at least one of these has to be used):
- (int)gameId - valid values: ID from getGames (default: unused)
- (int)countryId - valid values: ID from getCountries (default: unused)
- (int)utime - Unixtimestamp used as starttime minimum (default: unused)
- (String)itime - ISO-timestamp (yyyy-mm-dd) used as starttime minimum (default: unused)
- (int)uendtime - Unixtimestamp used as endtime minimum (default: unused)
- (String)iendtime - ISO-timestamp (yyyy-mm-dd) used as endtime minimum (default: unused)
- (int)leagueId - Alkemyleague-ID, if set all other parameters will be ignored (default: unused)
- (boolean)includeNTR - Set to "yes" if you want to have tournaments, which were only added for the NTR, included in the result (default: no)
Returns:
- data[]
- item - (int)id, (boolean)t3, (boolean)team, (String)name, (String)uri, (String)plz, (String)postcode, (String)city, (int)starttime, (int)endtime, (int)seats, (int)currentLoad, (int)gameId, (int)countryId, (int)validationTime, (String)description, (boolean)cancelled, (boolean)onlyNTR, (boolean)official
Error Codes
Following errors can be thrown from the interfaces:
- ERROR_NO_RESULTS (1): The interface call was ok, but no entries were found. Either there are just no entries or your call was to restricted.
- ERROR_MISSING_PARAMETER (2): You missed a required parameter. Please check above for the required values. Keep in mind that only parameters printed in italic are optional.
Changes
A list of the changes to this API:
- 2009-08-18: Added parameters "uendtime" and "iendtime" to getTournaments.
- 2009-05-11: Added attribute "iso" to getCountries.
- 2009-01-30: Added parameter "includeNTR" and attribute "onlyNTR" to getTournaments.
- 2009-01-21: Added parameter "leagueId" to getTournaments.
- 2009-01-20: Added attribute "official" to getTournaments.
- 2008-06-11: Renamed getPlayers to getRanking.
- 2008-03-14: Changed getPlayers parameter "gameId" to required.
- 2008-03-14: Changed overall "plz" to "postcode".