v2.0.0 Nations API Endpoint

URL: /api/v2/nations/{APIKey}/

For assistance with the API, please join the Discord Server and ask in the channel #api

Example Endpoints

URL Details
/api/v2/nations/{APIKey}/ Return all nations in compact (default) format
/api/v2/nations/{APIKey}/&format=1 Return all nations in pretty format
/api/v2/nations/{APIKey}/&alliance_id=2082 Return all nations in New Pacific Order
/api/v2/nations/{APIKey}/&alliance_id=2082&alliance_position=5 Return all Leaders in New Pacific Order
/api/v2/nations/{APIKey}/&date_created=20190930 Return all nations created on September 30, 2019
/api/v2/nations/{APIKey}/&color=beige Return all nations on the color Beige
/api/v2/nations/{APIKey}/&color=red&min_cities=5 Return all nations on the color Red with 5 or more Cities
/api/v2/nations/{APIKey}/&min_score=500&max_score=1500 Return all nations with scores between [500,1500]

Acceptable Parameters

Key Required Details
format Optional If value set to 1, returns JSON formatted nicely.
alliance_id Optional If valid, limits results to nations in the inputted alliance. Can be comma separated.
alliance_position Optional If valid, limits results to nations with inputted alliance position. Can be comma separated.
date_created Optional Accepts a date in the following format 'yyyymmdd'. If valid, limits results to nations created on the date inputted.
color Optional Accepts the standard color name, and if valid returns only nations on the inputted color.
v_mode Optional By default, all nations are shown regardless of Vacation Mode status. With inputted value 1, will only return nations on Vacation Mode. With inputted value 0, will only return nations not on Vacation Mode.
min_score Optional Accepts a numeric value, if valid filters results to only nations with equal to or greater score than inputted value.
max_score Optional Accepts a numeric value, if valid filters results to only nations with equal to or less score than inputted value.
cities Optional Accepts a numeric value, if valid filters results to only nations with number of cities cities equal to the inputted value.
min_cities Optional Accepts a numeric value, if valid filters results to only nations with number of cities cities equal to or greater than the inputted value.
max_cities Optional Accepts a numeric value, if valid filters results to only nations with number of cities cities equal to or less than the inputted value.

Field List

Field Type Details
nation_id Integer
nation String Nation Name
leader String Leader Name
continent Integer Data Mapping:
  • North America - 1
  • South America - 2
  • Europe - 3
  • Africa - 4
  • Asia - 5
  • Australia - 6
  • Antarctica - 7
war_policy Integer Data Mapping:
  • Attrition - 1
  • Turtle - 2
  • Blitzkrieg - 3
  • Fortress - 4
  • Moneybags - 5
  • Pirate - 6
  • Tactician - 7
  • Guardian - 8
  • Covert - 9
  • Arcane - 10
domestic_policy Integer Data Mapping:
  • Manifest Destiny - 1
  • Open Markets - 2
  • Technological Advancement - 3
  • Imperialism - 4
  • Urbanization - 5
color Integer Data Mapping:
  • Beige - 0
  • Gray - 1
  • Lime - 2
  • Green - 3
  • White - 4
  • Brown - 5
  • Maroon - 6
  • Purple - 7
  • Blue - 8
  • Red - 9
  • Orange - 10
  • Olive - 11
  • Aqua - 12
  • Black - 13
  • Yellow - 14
  • Pink - 15
alliance_id Integer
alliance String
alliance_position Integer Data Mapping:
  • No Alliance - 0
  • Applicant - 1
  • Member - 2
  • Officer - 3
  • Heir - 4
  • Leader - 5
cities Integer
offensive_wars Integer
defensive_wars Integer
score Float
v_mode Boolean Indicates whether the nation is in Vacation Mode or not. Returns true or false.
v_mode_turns Integer For nations in Vacation Mode, returns the number of turns remaining.
beige_turns Integer For nations on Beige, returns the number of turns remaining.
last_active DateTime
founded DateTime
soldiers Integer
tanks Integer
aircraft Integer
ships Integer
missiles Integer
nukes Integer

Possible Errors

Error Details
The API key sent for this request is invalid. API key was not valid.
You are making API requests too quickly. Your API key is limited to X requests per second. API key is rate limited to X requests per second and this request would cause the limit to be exceeded so it is rejected.
You have reached your limit for API requests today. Your API key is limited to Z requests per day. API key is rate limited to Z requests per day, and this request would cause the limit to be exceeded so it is rejected. This daily limit is reset at midnight UTC.
No results to display. The request was valid, but returned no results.

Sample Output

Sample URL: https://test.politicsandwar.com/api/v2/nations/XXXXXXXXXXX/&format=1&min_cities=35

Sample Output: pastebin.com/jran8APJ