All APIs response in JSON format. All strings are encoded in UTF-8.
中文API说明点击下载。
URI: http://sokoban.ws/api/competition/
Method: GET
Parameter: id = number
Parameter is not necessary. If no parameter provided, then the response will be the latest competition. If 'id' is specified, then it must be >= 20 and <= the 'id' of the latest competition.
Each level contains a 'title' and an 'alt_title'. The 'title' (and 'author') may contain UTF-8 encoded Chinese characters. In such cases, 'alt_title' provides an English translation for the title. Otherwise, the 'alt_title' can be an empty string or NULL.
The 'level' itself is in one-line XSB format, and the rows are seperated by '|'. FLOORs are reprensented by either '_' or '-'.
The 'extra' level is NULL for 'id' < 43.
Following are a few examples.
Example 1
request: GET http://sokoban.ws/api/competition/
response:
{ "id":49, "begin":"2013-07-26 07:00:00", "end":"2013-08-16 07:00:00", "main":null, "extra":null }
Example 2
request: GET http://sokoban.ws/api/competition/?id=48
response:
{ "id":"48", "begin":"2013-06-27 08:30:00", "end":"2013-07-19 08:30:00", "main":{ "author":"Marcus Palstra+GRIGoRusa+York Shen+gyjgw+anian+20603", "title":"\u58f0\u4e1c\u51fb\u897f (MF8 48th Sokoban Competition, Main)", "alt_title":"; Make a feint to the east but attack in the west", "level":"_####______________|_#-.###############|_#.-$---$---.$----#|_#--##@-$---#.###-#|_#$-####$####---#-#|_#--###.*-.--.#*--#|_#$-##-.#-*-#---###|_#--##-$$*-##-#$#__|_#$-##--#-*-*-$-###|_#----#.#.-*--*-$-#|_#$-#.--#.#####-#-#|_#-$##-##.----#.--#|##$--....*#-#-.-*-#|#---$-$-----###*-##|#-$#######--#_#--#_|#--#_____####_####_|####_______________" }, "extra":{ "author":"\u98ce\u8fc7\u4e86\u65e0\u75d5(SokoWind) + anian + stopheart + gyjgw", "title":"\u524d\u65b9\u65bd\u5de5 [\u968f\u5fc3\u5173\u5361\u7b2c41\u5173 \u6c6a\u661f\u4ebae] (MF8 48th Competition, Extra)", "alt_title":"; Road work ahead [SuiXin #41 - Dog version e]", "level":"__________________########___|_________________#--------#__|###___________####-######-#__|#____________#------#---#-#__|#######_____#--####--*--#--#_|#------######-#-.-**##-###-#_|#-####------#-*---*-#--*.-$-#|#-#--##-###-#--###*---#-----#|#--$-#-*###-#-*--#--**######_|###--#----#-$*--**-#--.-#____|__#.-#--#-##*--*-*.#--$-##___|__#*-####-##--#*--$-*#-#_____|__#-#-----*@*-#-*-*--##______|__#-----#####---*#--#________|__#######___#--**--##________|_____________#----#__________|______________####___________" } }
Example 3
request: GET http://sokoban.ws/api/competition/?id=18
response:
{ "error":"invalid id" }
URI: http://sokoban.ws/api/competition/submission/
Method: GET
Parameter: t=main or t=extra
If no parameter is provided, then it is the same as t=main.
This API always response with the submission list to the latest competition levels.
The country field of submission is using the country code Top Level Domain (ccTLD), such as "DE" = Germany, "FR" = France, "BG" = Bulgary, "CN" = China, etc. "00" means the country/region is not specified.
{ "id":49, "label":"extra", "submission":[ { "time":"2013-07-26 09:04:17", "name":"\u4e00\u76ee\u4e86\u7136", "country":"CN", "move":224, "push":51 }, { "time":"2013-07-26 09:43:49", "name":"shengli03", "country":"CN", "move":306, "push":59 }, { "time":"2013-07-26 09:46:37", "name":"shengli03", "country":"CN", "move":224, "push":51 } ] }