API to access public galaxy data

@Qwerty did you take it down on purpose? :frowning:

Nope, didn’t do anything. What is happening? Let me investigate.

/edit
Yeah OK, the whole page seems to be down. Weird AF.

/edit 2
I will fix that tomorrow. Hosting got updated to new version and everything stopped working. I was postponing the update and eventually I forgot about it until it was mandatory and automatically updated. dang

Thanks :slight_smile: I’ve been using it to collect end-of-game data for statistics, so was sad when it stopped working!

yeah i need this to start working again for uhhh… reasons

Forgive me the delay, but I have zero recollection of ever writing PHP so it was a challenge. I am now using new hosting and a domain due to issues with the old one.
If you find anything that doesn’t work, let me know. I will try my best.

new api url: NP API

old website https://cqproject.net/
new website https://qwerty.xyz/

BTW, I have improved the code and documentation a bit and I also added SSL (https) certificates for security. Now you can safely use your own login credentials to query your own fleet and star data!

Just keep in mind that I could read your password, so use a unique one!

thanks @Qwerty! I just tested my old code to connect changing the URL and all worked fine. Much appreciated.

1 Like

Just a heads up folks,

The NP servers started getting hammered around February this year and my hosting costs have skyrocketed.

I’m going to shutdown the API endpoint for scanning data, and will probably be breaking any existing automated game requests features in the coming weeks.

Jay.

@JayKyburz does this just kill THIS public API or the regular API in it’s entirety? So NP2Stats etc all break?

This is really really sad if so :frowning: I wonder if you could instead give us some statistics on when the spikes happened and what they look like so we can see if the community can find a way to dial back the requests that are going on? There have been several things people have made to use the API of vary degrees of requests, and I’m sure that those that made them could try and find alternative ways to call them to reduce your costs instead.

I agree with Kaine and think it would be useful to investigate the root cause of the increase in API requests and see if it can be reduced or eliminated. Losing all API access would be a very sad day indeed.

Hey,

I would be totally willing to audit any plugins or programs I have created to make sure im not abusing the api. Anything to make sure the servers are not overloaded.

I first reached out to @Osric and he has been working very hard to make sure his awesome extension is not creating any problems.

When NPstats was first set up it was only a few players requesting a little extra data but unfortunately the use of the API URL has gotten a little out of control and it is getting called almost as often as all players actually playing the game.

Also, folks are automatically requesting diplomatic messages which there is really no reason to.

When I have more time, I will add a feature that allows me to count how often somebody is accessing a games data and set some reasonable limits.

Until then I would like to try and shutdown all the automated systems.

These tools people have built have made a huge QoL difference and really kept me playing the game. If there’s any way to keep the system afloat without shutting parts down, please give it a shot! I know others have offered their services, but to the extent it’s a cost problem, name the price. Upgraded servers? Network invoices? Outsourced labor? Whatever’s needed, I’d be happy to throw money at the problem while others dig into a real longer-term solution.

2 Likes

Seconded! I’d be more than happy to help contribute to server costs, especially since it sounds like this is a temporary issue that may be resolved when the new server is functional.

What sort of costs are we talking about?

1 Like

I just want to add that I fully agree with, and support the messages of the two players above.

Losing the API feature would significantly impact QoL and thus game enjoyment. I would love to hear what can be done to keep it working.

1 Like

For those who aren’t following the #modding channel on discord, I wanted to update here as well, that the problem that caused the billing spike was definitely introduced by me in v2.2.8 of αλφα Edition of Neptune’s Pride Agent.

I’m obviously very sorry for the negative impact this is having and will cover all of Jay’s costs until the issue is resolved.

The issue isn’t fully figured out yet on my end, but turns out not to be the API calls or API keys. That doesn’t change the fact that the API is costing a significant proportion of Jay’s bill. That means that even after we fix the bug that made billing skyrocket, API costs might be a concern. So only Jay can tell us whether it’s OK with him to keep the API running after the bug that is causing the present billing is fixed.

My next attempt to fix the problem is stuck in Chrome Web Store approvals. I have been watching anxiously for this to go live, and I expect it to go live in the next 24-48h. After that, it may take a further 48h to see if the requests to the server die down or not. There is still a chance that even this version where I more or less blindly reverted every change in v2.2.8 that I thought might cause the error will not fix it, but I am hopeful it will. The version that I think contains the fix is v2.2.43.

While I am covering the costs of this, I ask that people do not make any changes to how they are using NPA. I believe the bug is only affecting 1 or 2 users so if the users who are exposing my flawed code stop using NPA the bug may appear fixed when it is in fact not fixed. So it’s easier for me to pay the price of the bug being live in the wild so that I can be sure I have corrected the root cause.

TIA
Osric

2 Likes

As @JayKyburz doesn’t seem interested in offers of donations and/or financial support, I’d like to encourage others to join me in purchasing Galactic Credits and awarding badges liberally over your coming games! Thanks to @Osric for the suggestion!

Let’s show some appreciation for those neighbors that respond to comms and the allies that log in and fight to the end! Tag those enemies who betrayed you, confused you, or are just infuriating to fight! Or just spread the love with badges for all… If you can afford to buy some credits, let’s help make sure it’s worth Jay’s continued time, effort, and resources to keep this game running!

3 Likes

Count me in @Gingey

1 Like

Hey, how did you manage to access the game without using an api key?

Back then, I didn’t know there was an API, and I didn’t notice you can generate API key from the game menu :sweat_smile:

So I reverse-engineered the actual in-game communication, basically I access the api game data-endpoint in the same way the browser does. I opened Dev Tools in the browser to see the communication between the game and the API, I saved the cookie in a text file.

Then I wrote a php script that:

  1. authenticates with triton using dummy credentials (only public data) or my own credentials (private fleets, etc.)
  2. and then queries the game data endpoint (not the actual api)