Load Turn Data
The Load Turn Data API returns all the data for a single complete turn given a game id and player id.
For publicly viewable turns from completed games you can do a GET request to:
(Click the above link to see a complete turn package in JSON format)
You can also request historic data from the time machine by specifying the turn:
For running games you must be authorized to get the data and include an apikey instead of a playerid:
http://api.planets.nu/game/loadturn?gameid=20000&apikey=API KEY FROM LOGIN
This will ensure you have been permitted access to the turn before requesting it. The turn package contains all data required to display the current map as the player sees it and all their ships/planets/starbases/relationships/notes and messages.
Use the forsave=true option if you want to modify the data and save it back using the Save API:
http://api.planets.nu/game/loadturn?gameid=20000&apikey=API KEY FROM LOGIN&forsave=true
The forsave option will prevent saving in any other client window which is open to prevent saving overlaps.
Important note: The response is GZIP compressed and must be decompressed after downloading. (Browsers do this automatically but most code libraries do not)
The outline of the format of the turn data is as follows: