I am wondering if there is any API documentation - Iād like to export my star details to excel or a database but canāt find any information on how to use the API key, or javascript console to do soā¦ Would rather not manually type them out,
Specifically I am wanting the natural resources information but just generally hoping to get some direction on where to point API requests and what is available,
Thanks for any help!
I managed to copy the galaxy screen to excel and can reverse engineer the natural resources from the upgrade costs, but would still appreciate any direction on using the API,
Thanks
Hi Fleck, sorry to take a while to get back to you and make you work it out yourself.
@Dysp and I are working on an improved method for retrieving a players scanned data at the moment. The API key is a method for a third party app to retrieve a games data without required an auth cookie.
I havenāt documented it at all yet because Iām not entirely sure everything is right yet.
Iād definitely be interested in seeing some of the functionality offered by an API. Especially seeing how it could play into some applications that could help guide Empire development and all the extras that come with it.
Sorry for the late commenting. The current api seems to work very well. Iāve been able to put up some basic statistic collection, team stats and map replayer for the NP2. Itās pretty basic, but Iām working to add more things and improve the existing.
I would love to hear whenever an official API comes out, and Iād love to help with testing.
I wrote a PHP client based on reverse engineering the gameās interactions with the server and would love to update it to support the official API and usage of keys instead of credentials.
Open Data Protocol or OData is a REST API specification developed by Microsoft. There was also GData that is a now deprecated competitor. There is also JSON API which is work-in-progress driven by the Rails/Ember community. I think they all represent best practices, but none of them are widely accepted standards unless youāre working with specific technologies.
While self describing protocols are cool, good documentation will serve everybodyās needs.
Right now there is only one request which is for scanning data. There will never been an API for giving orders for ships and fleets because I donāt bots playing in games where other players expect humans they can negotiate with.
I will try and make the fixes I want to make next week then document the request.
Would you ever consider allowing this (and therefore having an API for it) as an option in user created games (and then making it clear before the game starts so thereās no surprises)?
My main motivation for this is that AI in NP was a fact of life when I last played last year (been too busy to play lately unfortunately, but hope to be back soon!) and the built in AI was never particularly good. This is especially painful in the late game for large games, or the poor unfortunate person whose neighbours all quit early. Having an API in games that allow this wonāt solve this, of course, but it does mean people could at least try (Iād certainly be interested in it) and maybe someone will come up with something worthwhile.
A secondary motivation is that it could be a great metagame. It certainly would keep me coming back more regularly than I have done. Obviously this isnāt the point of the game, so of course I understand if this isnāt something youāre interested in. More an aside to the previous point.
Now, I havenāt tried out the new AI mentioned here Smarter AI yet, nor have I seen any other changes you may have made since I last played, so maybe all of the above is moot now, in which case maybe ignore me Iāll hopefully find out soon for myself.
Hey @Fleck, I think I have exactly what you need. A querying API for accessing public game data. You donāt have to deploy/configure/do anything, just look here. Itās harmless as it shows exactly what one would see when watching someone elseās game.
Hey @rubberband I didnt mean to ignore you when you posed a few weeks ago.
Its not completely crazy that we have some kind of āmetagameā of building and AI for the game, and it would be fun to perhaps even incorporate it into the main game.
Imagine a small group of programmers all build and AI for the game, and when a player drop Triton chooses an AI to take over. Triton could call a third part service to request and AI āthinkā. At the end of the game players could vote on if the AI was fun to play against!
Iāll look forward to it if you decide to incorporate it in some way. In the meantime, is there any word on the data API? I would love access but canāt find much on the forums (except Qwertyās API; although Iād like to be able to access my own star information too).
Itās possible to enter username and password, itās using a dummy account after all, but I didnāt expose this feature publicly so people donāt think I want to steal from them. If you want I will write you in a PM how to do that, but you must sign two copies, one black on white and second inverted, that you understand that you are giving your credentials to a script hosted on my server.
Thinking of that, it would be great if there were two passwords for one account, the other one would be for teammates or friends with limited functionality, so you could only make turns, but not: join/leave games, change user details, buy badgesā¦
PS: using real credentials, itās, of course, possible to read oneās ships and tech information as well , heck itās also possible to read messages and notifications.
Itās read only though.
Iād also be interested in seeing some API documentation, but couldnāt find a more recent thread with anything inā¦ not even full documentation, maybe just some example endpoints and parameters, am sure I can work out most of the rest for myselfā¦
Also the option to allow orders to be given via the API, and an option to allow āAIsā in user created games would be great. With enough people interested, you may end up with āall AIā games competing to see who has the strongest AIā¦