FANDOM


The Wars API provides information about the list of wars in the game.

Access URL Edit

baseurl/wars

Parameters Edit

accessurl/{NUMBER OF WARS}

By default it only displays the 100 most recent wars. The minimum is 1 and maximum is 5000. For example, you can increase it to 5000 by using https://politicsandwar.com/api/wars/5000

accessurl/?alliance_id={ALLIANCE ID}

You can also filter by alliance ID e.g. https://politicsandwar.com/api/wars/?alliance_id=1584

accessurl/?alliance_id={ALLIANCE ID},{ALLIANCE ID 2},{ALLIANCE ID 3}...

You can also filter by multiple alliance IDs e.g. https://politicsandwar.com/api/wars/?alliance_id=1584,3427,619,3339

accessurl/{NUMBER OF WARS}&alliance_id={ALLIANCE ID}

Both parameters can be combined e.g. https://politicsandwar.com/api/wars/5000&alliance_id=1584

accessurl/{NUMBER OF WARS}&alliance_id={ALLIANCE ID},{ALLIANCE ID 2},{ALLIANCE ID 3}...

You can do the same for multiple alliances at once e.g. https://politicsandwar.com/api/wars/5000&alliance_id=1584,3427,619,3339

JSON Example Edit

{
"success":true,
"wars:[{"warID":372418,
"attackerID":65927,
"defenderID":135028,
"attackerAA":"Camelot",
"defenderAA":"Paradox",
"war_type":"raid",
"status":"Active",
"date":"2018-12-09T02:00:29+00:00"
}]}
Community content is available under CC-BY-SA unless otherwise noted.