API Getting Star Information

Hi, :smile:

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, :smile:
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, :smile:
Thanks for any help!

1 Like

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, :smile:
Thanks

window.NeptunesPride.universe.rawExportStars

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.

Jay.

No problem - thanks for the response! :smile:

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.

http://bit.ly/1xw8hZC
http://bit.ly/1GeDOtG

The current API gives all the player, star, fleet, science etc stats for the current tick in an easy to read json.

There are few things I wan to change to the API stuff before more people have access to it.

I want to make sure each app using the API has a its own key so I can keep track of what app is doing what.

I also want to mail the players when a code is generated for them in their game.

An API is very exciting to me. Any chance itā€™s OData?
(Neptuneā€™s Pride is awesome, btw. Thank you for building it so I can enjoy.)

What is o data

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.

Oh thanks @wrenoud

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 :smile: 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!

3 Likes

No worries!

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 :blush:, heck itā€™s also possible to read messages and notifications.
Itā€™s read only though.

I see you can now generate API keys - is there documentation for this anywhere? Iā€™d love to play around with this!

Hope a bump is OK on this thread.

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ā€¦

R