Jump to content

Nation API Layout Suggestion


Shakyr
 Share

Recommended Posts

Suggestion for the Nation API endpoints, that introduces a bit of consistency and groups a few related values.

 

api/nations/

- summary of basic stats, good for the stat junkies to quickly update

{
	nationid: <integer/unique nation id>,
	nationname: <string/name of nation>,
	leadername: <string/name of leader>,
	color: <string/nation color>,
	vacation: <integer/number of turns remaining of vacation mode>,
	allianceid: <integer/unique alliance id, if nation in alliance>,
	score: <decimal/nation's current strength>
}
api/nations/<nationid>/

- specific lookup for a nation

{
	nationid: <integer/unique nation id>,
	nationname: <string/name of nation>,
	leadername: <string/name of leader>,
	color: <string/nation color>,
	nationrank: <integer/rank of nation compared to all nations>,
	vacation: <integer/number of turns remaining of vacation mode>,
	allianceid: <integer/unique alliance id, if nation in alliance>,
	score: <decimal/nation's current strength>
	nationtitle: <string/prefix for nation name>,
	leadertitle: <string/prefix for leader name>,
	socialpolicy: <string/nation social policy>,
	economicpolicy: <string/nation economic policy>,
	approvalrating: <decimal/approval rating>,
	minutessinceactive: <integer/number of minutes since player last active>,
	cityprojecttimerturns: <integer/number of turns remaining until allowed to purchase city or project>,
	uniqueid: <string/unique id used for linking accounts on the same IP address>,
	government: <string/current nation government>,
	dateFounded: <datetime/when the nation was founded in server timezone>,
	flagurl: <string/url pointing to the current nation flag>,
	cities: <array/list of unique city ids for this nation>,
	location: {
		latitude: <decimalsigned/latitude of nation location>,
		longitude: <decimalsigned/longitude of nation location>,
		continent: <string/what continent the nation is on>
	},
	stats {
		gdp: <decimal/gdp of nation>,
		infrastructure: <integer/total infrastructure across all cities>,
		landarea: <integer/total land area across all cities>,
		population: <integer/total population across all cities>,
		treasures: <integer/number of treasures possessed>
	},
	military {
		soldiers: <integer/number of units purchased>,
		tanks: <integer/number of units purchased>,
		aircraft: <integer/number of units purchased>,
		ships: <integer/number of units purchased>,
		missiles: <integer/number purchased>,
		nukes: <integer/number purchased>
	},
	militarystats {
		soldiercasualties: <integer/number of units lost in wars>,
		soldierskilled: <integer/number of units killed in wars>,
		tankcasualties: <integer/number of units lost in wars>,
		tankskilled: <integer/number of units killed in wars>,
		aircraftcasualties: <integer/number of units lost in wars>,
		aircraftkilled: <integer/number of units killed in wars>,
		shipcasualties: <integer/number of units lost in wars>,
		shipskilled: <integer/number of units killed in wars>,
		missilelaunched: <integer/number fired in wars>,
		missileseaten: <integer/number hit nation in wars>,
		nukeslaunched: <integer/number fired in wars>,
		nukeseaten: <integer/number hit nation in wars>,
		infdesttot: <integer/amount lost in wars>
	},
	projects {
		ironworks: <boolean/ironworks project owned>,
		bauxiteworks: <boolean/bauxiteworks project owned>,
		armsstockpile: <boolean/arms stockpile project owned>,
		emgasreserve: <boolean/emergency gas reserve project owned>,
		massirrigation: <boolean/mass irrigation project owned>,
		inttradecenter: <boolean/international trade center project owned>,
		missilelpad: <boolean/missile launch pad project owned>,
		nuclearresfac: <boolean/nuclear research factory project owned>,
		irondome: <boolean/iron dome project owned>,
		vitaldefsys: <boolean/vital defense system project owned>,
		cenintagncy: <boolean/cia project owned>,
		uraniumenrich: <boolean/uranium enrichment project owned>,
		propbureau: <boolean/propaganda bureau project owned>,
		cenciveng: <boolean/cenciveng project owned>
	}
}
api/nations/<nationid>/wars/

- list all wars for a particular nation

{
	{
		warid: <integer/unique war id>,
		attacker: <integer/unique nation id of attacking nation>,
		defender: <integer/unique nation id of defending nation>,
		dateStarted: <datetime/date and time that the war was declared>
	},
	...
}
  • Upvote 1

sig_cybernations.PNG.8d49a01423f488a0f1b846927f5acc7e.PNG

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.