API 2.1

More information here: forum.ironhelmet

note: The IHG api only allows you to read public game data by default. If you want to access your stars and fleets, read on...

In short: You can provide your own login credentials to read your fleets and stars e.g. https://nptriton.qry.me/game/5182163620986880/full?alias=qwerty&password=abc123.
Don't worry, the password travels securely over https. No 3rd party can steal it.

Long: To acquire the game data, I have created a dummy account that I use to authenticate with and then query the triton API.
The game and the API allows any visitor to read any game's public data.
// a dummy account for public access to games $auth_alias = "public_redacted_api"; $auth_pwd = "redacted"; // possibility to use user's account instead - needed to get fleets and stars data if (isset($_GET['alias']) && isset($_GET['password'])) { $auth_alias = $_GET['alias']; $auth_pwd = $_GET['password']; }
This basically means, that you can use your own credentials for the api request, which will allow you to read any of your games as if you logged in yourself.
Just keep in mind that even though I am not doing anything malicious, I COULD STILL ACCESS YOUR PASSWORD! So just to be safe use unique password.

Description:
Get current available public game data.
Usage: /game/<game_number>[/(stars|players|fleets|full|basic)] Example: /game/1234567890123456/stars # get all publicly visible stars /game/1234567890123456/players # get all available players' data (alias, id, game stats, technology levels, ...) /game/1234567890123456/basic # get game settings /game/1234567890123456/full # get everything in one query If you plan to use CRON to collect the data to your own database, click here.
Use /init at first to get full report of the game to set your things, then use /cron, always.
Note that /full, /init and /cron are all the same. For normal use use /full.

Description:
Get stored historical game data from my database.
Note, this is NOT working for games that are not stored.

To store a single tick, call https://nptriton.qry.me/storegame.php?game=game_number? or set up a CRON task.
Usage: /ticks/<range>/<game_number>/<type> range: /x/ number of specific tick to show /x-/ from x /-x/ to x /x-y/ from x to y // empty for all type: stars players Example: /ticks/1/1234567890123456/players # displays players data at tick 1 /ticks/72-/1234567890123456/stars # displays star data from tick 72 to the last Todo: (planned features, not yet implemented) [ ] accept list of ranges as range: /x,y,z-a/ [x] accept `/full` to provide full report as type: full