URL: /api/v2/nations/{APIKey}/
For assistance with the API, please join the Discord Server and ask in the channel #api
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] |
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 | Type | Details |
---|---|---|
nation_id | Integer | |
nation | String | Nation Name |
leader | String | Leader Name |
continent | Integer |
Data Mapping:
|
war_policy | Integer |
Data Mapping:
|
domestic_policy | Integer |
Data Mapping:
|
color | Integer |
Data Mapping:
|
alliance_id | Integer | |
alliance | String | |
alliance_position | Integer |
Data Mapping:
|
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 |
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 URL: https://test.politicsandwar.com/api/v2/nations/XXXXXXXXXXX/&format=1&min_cities=35
Sample Output: pastebin.com/jran8APJ