Jump to content

Nation API Consistency Request + Beige Timer


Shakyr
 Share

Recommended Posts

Could the Beige timer please be added to /api/nations/ and /api/nation/id=<nationid> ? I'll keep parsing the DOM if I have to in order to get it, but I'd rather fetch it along with everything else, via the API.

Also, could the two data structures for both API endpoints be merged, so that they both contain the same information? It would seriously reduce the amount of requests I'd have to make, if I didn't have to specifically call /api/nation/id=<nationid> in order to get some information.

/api/nations/

  • citycount: Adding the city count is useless, just include the array of city IDs and if people really want, they can count the array elements
  • Missing every item from the individual nation API, except for nationid, nation name, leader name, allianceid, allianceposition, alliance, color, war_policy, score
  • 'alliance' is redundant, they can pull from the alliance API

/api/nation/id=<nationid>

  • Format is inconsistent, should be { "success": true, "nation": {...} }
  • 'cities' is redudant, they can count 'cityids'
  • 'nationrankstrings' is redundant
  • 'alliance' is redundant, they can pull from the alliance API
  • Missing 'vacmode' from /api/nations/
  • nation name is referred to as 'name', should be 'nation' (consistent with /api/nations/)
  • leader name is referred to as 'leadername', should be 'leader' (consistent with /api/nations/)
  • Upvote 2

sig_cybernations.PNG.8d49a01423f488a0f1b846927f5acc7e.PNG

Link to comment
Share on other sites

So much of this.

 

Shakyr I love you.

Careful or I might blush ;)

 

I'm just doing my bit to push for more work on the API. There's a few of us that have posted various stuff in the past.

sig_cybernations.PNG.8d49a01423f488a0f1b846927f5acc7e.PNG

Link to comment
Share on other sites

I like cities in /api/nations/, and I'm pretty sure that many people use it. With one call to /api/nations/ you can get alliances + city count, compare/make an average, and that's amazing.

 

It's not because it's redundant that must be removed, but it should be analized why it's there.

 

Changing keys in API may break others tools that other people already made, and should be discouraged unless we get APIs with versioning.

 

"success" key is annoying, because there is no success -> false when there is errors.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and the Guidelines of the game and community.