| This page documents the API.
This page is about the API for the game. It contains information such as contents, structure, & other miscellany. See Category:API for other pages on the API. |
This endpoint is deprecated and planned to potentially be removed by December 2023. It is recommended to switch to v3 of the API.
Overview[]
The Nation API provides information about a given nation.
Access URL[]
baseurl/nation/id={nation id}/&key={api key}
Returned JSON[]
- Like all of the P&W APIs the Nation API is inconsistent in number typing with some being plain numbers & others strings. Care should be taken to check data types when using the API.
- Projects are listed with values of "1" & "0" corresponding to true & false respectively.
- The "alliancepostion" property is a number code with higher positions having a higher number. Leader = "5", Vice-Leader = "4", Officers = "3", Members = "2", Applicants = "1" There also seems to be a value of -3, which as far as I can tell only occurs in old vacation mode Sunray members.
- Nations not in an alliance will return "0" for the "allianceid" & "alliancepostion" properties while the "alliance" property returns "None"
{
"cityids": ["10618", "131681", "375813", "375814"],
"cityprojecttimerturns": 0,
"success": true,
"nationid": "6",
"name": "Mountania",
"prename": "The Dominion of",
"continent": "North America",
"socialpolicy": "moderate",
"color": "gray",
"minutessinceactive": 52,
"uniqueid": "6d0f74044933a737514e9379b",
"government": "People's Republic",
"domestic_policy": "Manifest Destiny",
"war_policy": "Turtle",
"founded": "2014-08-05 00:10:59",
"daysold": 2369,
"alliance": "None",
"allianceposition": "0",
"allianceid": "0",
"flagurl": "https:\/\/politicsandwar.com\/uploads\/125eff51f3476cd5f24debb891968eeb58bef89a566.png",
"leadername": "Alex",
"title": "",
"ecopolicy": "moderate",
"approvalrating": "-7470.9895",
"nationrank": 4302,
"nationrankstrings": "4302 of 35256 Nations",
"nrtotal": 35256,
"cities": 4,
"latitude": "52.70",
"longitude": "-131.61",
"score": "605.75",
"population": "659932",
"gdp": "254856190",
"totalinfrastructure": 5990.17,
"landarea": 10550,
"soldiers": "0",
"soldiercasualties": "1182297",
"soldierskilled": "1228534",
"tanks": "0",
"tankcasualties": "47481",
"tankskilled": "9059",
"aircraft": "0",
"aircraftcasualties": "2618",
"aircraftkilled": "1060",
"ships": "6",
"shipcasualties": "466",
"shipskilled": "70",
"missiles": "8",
"missilelaunched": "3",
"missileseaten": "5",
"nukes": "0",
"nukeslaunched": "6",
"nukeseaten": "8",
"infdesttot": "7043.76",
"infraLost": "28101",
"moneyLooted": "4439972.68",
"ironworks": "0",
"bauxiteworks": "0",
"armsstockpile": "0",
"emgasreserve": "0",
"massirrigation": "0",
"inttradecenter": "0",
"missilelpad": "1",
"nuclearresfac": "1",
"irondome": "0",
"vitaldefsys": "0",
"intagncy": "1",
"uraniumenrich": "1",
"propbureau": "0",
"cenciveng": "0",
"city_planning": "1",
"adv_city_planning": "0",
"space_program": "0",
"spy_satellite": "0",
"moon_landing": "0",
"green_technologies": "0",
"telecommunications_satellite": "0",
"recycling_initiative": "0",
"pirate_economy": "0",
"clinical_research_center": "0",
"specialized_police_training": "0",
"arable_land_agency": "0",
"adv_engineering_corps": "0",
"vmode": "0",
"offensivewars": 0,
"defensivewars": 3,
"offensivewar_ids": [],
"defensivewar_ids": ["846216", "846535", "846990"],
"beige_turns_left": 0,
"radiation_index": 42.61291666666667,
"season": "winter",
"espionage_available": true
}
Error JSON[]
With an incorrect nation id:
{
'success': False,
'error': "Nation doesn't exist."
}