Politics & War

App · Gaming · 20 actions

Connect your Politics & War nation to read the browser game's live data through its official GraphQL API: look up nations, alliances, cities, wars and war attacks, trades and market prices, bank records, bounties, treaties, treasures, embargoes, color blocs, and your own nation and API quota.

Actions

ActionWhat it does
Get allianceLook up a single alliance by its id, including its score, treaties, and tax brackets.
Get cityLook up a single city by its id, including its infrastructure, land, power, and every improvement it has built.
Get game infoGet the current in-game date and the radiation level of each continent (from nuclear strikes).
Get my nationGet the nation that owns the connected API key, along with the key's request quota for the day.
Get nationLook up a single nation by its id, including its alliance, score, cities, military, policies, and (if your key has permission) its resources.
Get warLook up a single war by its id, including both sides, resistance, resources used, and its individual attacks.
List alliancesBrowse and filter alliances by name, sorted however you like.
List bank recordsList bank transaction records, filtered by sender, recipient, and whether each party is a nation or an alliance.
List bountiesList active war bounties placed on nations, filtered by nation and bounty amount.
List citiesList cities, optionally limited to one nation's cities.
List color blocsList every color bloc and its current daily turn bonus (the income nations in that bloc earn).
List embargoesList active trade embargoes between nations, including who placed each one and the stated reason.
List nationsSearch and filter nations by name, leader, alliance, color, score, city count, and vacation mode, sorted however you like.
List trade pricesGet recent daily average market prices for every resource (most recent first).
List tradesList market trades, filtered by nation, trade type, resource, buy/sell side, and whether they were accepted.
List treasure tradesList trades of in-game treasures between nations.
List treasuresList all in-game treasures, their score bonus, the continent they are on, and the nation that currently holds each one.
List treatiesList alliance treaties (the diplomatic agreements between alliances), including their type and turns remaining.
List war attacksList individual attacks, usually for one war, including the attack type, victor, loot, and infrastructure destroyed.
List warsList wars, filtered by nation, alliance, or active status, sorted by id or date.

Get alliance

Look up a single alliance by its id, including its score, treaties, and tax brackets.

Inputs

Alliance IDalliance_idnumberRequired
The alliance's numeric id, e.g. 790.At least 1.

Outputs

None.

Example output
{
  "acceptmem": true,
  "acronym": "Rose",
  "color": "blue",
  "date": "2019-01-01 00:00:00",
  "flag": "https://politicsandwar.com/uploads/flag.png",
  "id": "790",
  "name": "Rose",
  "score": 512000.0,
  "treaties": [
    {
      "alliance1_id": "790",
      "alliance2_id": "913",
      "id": "5001",
      "treaty_type": "MDP",
      "turns_left": 120
    }
  ]
}

Get city

Look up a single city by its id, including its infrastructure, land, power, and every improvement it has built.

Inputs

City IDcity_idnumberRequired
The city's numeric id.At least 1.

Outputs

None.

Example output
{
  "bank": 5,
  "farm": 10,
  "id": "12345",
  "infrastructure": 2000.0,
  "land": 1800.0,
  "name": "Capital City",
  "nation_id": "6",
  "powered": true,
  "supermarket": 4
}

Get game info

Get the current in-game date and the radiation level of each continent (from nuclear strikes).

Inputs

None.

Outputs

None.

Example output
{
  "game_date": "2026-08-13 18:00:00",
  "radiation": {
    "africa": 6.0,
    "antarctica": 0.0,
    "asia": 15.7,
    "australia": 2.1,
    "europe": 20.5,
    "global": 12.4,
    "north_america": 8.1,
    "south_america": 3.2
  }
}

Get my nation

Get the nation that owns the connected API key, along with the key's request quota for the day.

Inputs

None.

Outputs

nationobject
Example output
{
  "max_requests": 2000,
  "nation": {
    "aircraft": 1500,
    "alliance": {
      "acronym": "Rose",
      "id": "790",
      "name": "Rose"
    },
    "alliance_id": "790",
    "alliance_position": "MEMBER",
    "color": "blue",
    "continent": "na",
    "id": "6",
    "leader_name": "Test Leader",
    "missiles": 12,
    "nation_name": "Testlandia",
    "nukes": 8,
    "num_cities": 25,
    "population": 3500000,
    "score": 4210.5,
    "ships": 300,
    "soldiers": 250000,
    "tanks": 20000,
    "wars_lost": 9,
    "wars_won": 42
  },
  "requests": 152
}

Get nation

Look up a single nation by its id, including its alliance, score, cities, military, policies, and (if your key has permission) its resources.

Inputs

Nation IDnation_idnumberRequired
The nation's numeric id, e.g. 6.At least 1.

Outputs

None.

Example output
{
  "aircraft": 1500,
  "alliance": {
    "acronym": "Rose",
    "id": "790",
    "name": "Rose"
  },
  "alliance_id": "790",
  "alliance_position": "MEMBER",
  "color": "blue",
  "continent": "na",
  "id": "6",
  "leader_name": "Test Leader",
  "missiles": 12,
  "nation_name": "Testlandia",
  "nukes": 8,
  "num_cities": 25,
  "population": 3500000,
  "score": 4210.5,
  "ships": 300,
  "soldiers": 250000,
  "tanks": 20000,
  "wars_lost": 9,
  "wars_won": 42
}

Get war

Look up a single war by its id, including both sides, resistance, resources used, and its individual attacks.

Inputs

War IDwar_idnumberRequired
The war's numeric id.At least 1.

Outputs

None.

Example output
{
  "att_resistance": 100,
  "attacker": {
    "id": "6",
    "nation_name": "Testlandia"
  },
  "attacks": [
    {
      "attid": "6",
      "date": "2026-08-10 15:00:00",
      "defid": "9",
      "id": "50000001",
      "success": 3,
      "type": "GROUND",
      "victor": "6"
    }
  ],
  "date": "2026-08-10 14:00:00",
  "def_resistance": 82,
  "defender": {
    "id": "9",
    "nation_name": "Defenderland"
  },
  "id": "1000001",
  "reason": "Raiding for loot",
  "turnsleft": 48,
  "war_type": "RAID"
}

List alliances

Browse and filter alliances by name, sorted however you like.

Inputs

Alliance IDalliance_idnumber
Filter to a specific alliance id.At least 1.
Namenametext
Filter to an alliance with this exact name.
Sort bysort_bytext
Which field to sort the results by.One of: ID, DATE, SCORE.
Sort directionsort_directiontext
Whether to sort ascending or descending. Defaults to descending.One of: ASC (Ascending), DESC (Descending). Default: DESC.
Results per pagefirstnumber
How many results to return per page (1-500). Defaults to 25.From 1 to 500. Default: 25.
Pagepagenumber
Which page of results to return. Defaults to 1.At least 1. Default: 1.

Outputs

datalist
Example output
{
  "data": [
    {
      "acceptmem": true,
      "acronym": "Rose",
      "color": "blue",
      "date": "2019-01-01 00:00:00",
      "flag": "https://politicsandwar.com/uploads/flag.png",
      "id": "790",
      "name": "Rose",
      "score": 512000.0
    }
  ],
  "paginatorInfo": {
    "count": 1,
    "currentPage": 1,
    "hasMorePages": false,
    "lastPage": 1,
    "perPage": 25,
    "total": 1
  }
}

List bank records

List bank transaction records, filtered by sender, recipient, and whether each party is a nation or an alliance. Money and resource amounts require a key with bank-view permission.

Inputs

Record IDrecord_idnumber
Filter to a specific bank-record id.At least 1.
Sender IDsender_idnumber
Only include records sent by this nation or alliance id.At least 1.
Recipient IDrecipient_idnumber
Only include records received by this nation or alliance id.At least 1.
Sender typesender_typetext
Whether the sender is a nation or an alliance.One of: 1 (Nation), 2 (Alliance).
Recipient typerecipient_typetext
Whether the recipient is a nation or an alliance.One of: 1 (Nation), 2 (Alliance).
Sort bysort_bytext
Which field to sort the results by.One of: ID, DATE, MONEY.
Sort directionsort_directiontext
Whether to sort ascending or descending. Defaults to descending.One of: ASC (Ascending), DESC (Descending). Default: DESC.
Results per pagefirstnumber
How many results to return per page (1-500). Defaults to 25.From 1 to 500. Default: 25.
Pagepagenumber
Which page of results to return. Defaults to 1.At least 1. Default: 1.

Outputs

datalist
Example output
{
  "data": [
    {
      "date": "2026-08-13 10:00:00",
      "id": "9000001",
      "money": 5000000.0,
      "note": "Alliance grant",
      "rid": "6",
      "rtype": 1,
      "sid": "790",
      "steel": 1000.0,
      "stype": 2
    }
  ],
  "paginatorInfo": {
    "count": 1,
    "currentPage": 1,
    "hasMorePages": false,
    "lastPage": 1,
    "perPage": 25,
    "total": 1
  }
}

List bounties

List active war bounties placed on nations, filtered by nation and bounty amount.

Inputs

Nation IDnation_idnumber
Only include bounties placed on this nation.At least 1.
Minimum amountmin_amountnumber
Only include bounties worth at least this much.At least 0.
Maximum amountmax_amountnumber
Only include bounties worth at most this much.At least 0.
Sort bysort_bytext
Which field to sort the results by.One of: ID, DATE, AMOUNT.
Sort directionsort_directiontext
Whether to sort ascending or descending. Defaults to descending.One of: ASC (Ascending), DESC (Descending). Default: DESC.
Results per pagefirstnumber
How many results to return per page (1-500). Defaults to 25.From 1 to 500. Default: 25.
Pagepagenumber
Which page of results to return. Defaults to 1.At least 1. Default: 1.

Outputs

datalist
Example output
{
  "data": [
    {
      "amount": 25000000,
      "date": "2026-08-12",
      "id": "8000001",
      "nation": {
        "id": "9",
        "nation_name": "Defenderland"
      },
      "nation_id": "9"
    }
  ],
  "paginatorInfo": {
    "count": 1,
    "currentPage": 1,
    "hasMorePages": false,
    "lastPage": 1,
    "perPage": 25,
    "total": 1
  }
}

List cities

List cities, optionally limited to one nation's cities.

Inputs

Nation IDnation_idnumber
Only include cities belonging to this nation.At least 1.
City IDcity_idnumber
Filter to a specific city id.At least 1.
Sort bysort_bytext
Which field to sort the results by.One of: ID, DATE, INFRASTRUCTURE, MAXINFRA (Max infrastructure), LAND.
Sort directionsort_directiontext
Whether to sort ascending or descending. Defaults to descending.One of: ASC (Ascending), DESC (Descending). Default: DESC.
Results per pagefirstnumber
How many results to return per page (1-500). Defaults to 25.From 1 to 500. Default: 25.
Pagepagenumber
Which page of results to return. Defaults to 1.At least 1. Default: 1.

Outputs

datalist
Example output
{
  "data": [
    {
      "id": "12345",
      "infrastructure": 2000.0,
      "land": 1800.0,
      "name": "Capital City",
      "nation_id": "6",
      "powered": true
    }
  ],
  "paginatorInfo": {
    "count": 1,
    "currentPage": 1,
    "hasMorePages": false,
    "lastPage": 1,
    "perPage": 25,
    "total": 1
  }
}

List color blocs

List every color bloc and its current daily turn bonus (the income nations in that bloc earn).

Inputs

None.

Outputs

colorslist
Example output
{
  "colors": [
    {
      "bloc_name": "Blue Bloc",
      "color": "blue",
      "turn_bonus": 235
    },
    {
      "bloc_name": "Beige",
      "color": "beige",
      "turn_bonus": 0
    }
  ]
}

List embargoes

List active trade embargoes between nations, including who placed each one and the stated reason.

Inputs

Results per pagefirstnumber
How many results to return per page (1-500). Defaults to 25.From 1 to 500. Default: 25.
Pagepagenumber
Which page of results to return. Defaults to 1.At least 1. Default: 1.

Outputs

datalist
Example output
{
  "data": [
    {
      "date": "2026-08-11 08:00:00",
      "id": "2001",
      "reason": "Hostilities",
      "receiver": {
        "id": "9",
        "nation_name": "Defenderland"
      },
      "receiver_id": "9",
      "sender": {
        "id": "6",
        "nation_name": "Testlandia"
      },
      "sender_id": "6"
    }
  ],
  "paginatorInfo": {
    "count": 1,
    "currentPage": 1,
    "hasMorePages": false,
    "lastPage": 1,
    "perPage": 25,
    "total": 1
  }
}

List nations

Search and filter nations by name, leader, alliance, color, score, city count, and vacation mode, sorted however you like.

Inputs

Nation namenation_nametext
Filter to a nation with this exact name.
Leader nameleader_nametext
Filter to a nation with this exact leader name.
Alliancesalliance_idlist
Limit results to these alliances (pick by name, or leave empty for all).
Color bloccolortext
Only include nations in this color bloc.One of: aqua, black, blue, brown, green, lime, maroon, olive, orange, pink, and 6 more.
Minimum scoremin_scorenumber
Only include nations with at least this score.At least 0.
Maximum scoremax_scorenumber
Only include nations with at most this score.At least 0.
Minimum citiesmin_citiesnumber
Only include nations with at least this many cities.At least 1.
Maximum citiesmax_citiesnumber
Only include nations with at most this many cities.At least 1.
In vacation modevmodetrue/false
Filter by whether the nation is in vacation mode.
Created aftercreated_afterdate and time
Only include nations created after this date and time.
Sort bysort_bytext
Which field to sort the results by.One of: ID, DATE, SCORE, CITIES, POPULATION, SOLDIERS, TANKS, AIRCRAFT, SHIPS, MISSILES, NUKES.
Sort directionsort_directiontext
Whether to sort ascending or descending. Defaults to descending.One of: ASC (Ascending), DESC (Descending). Default: DESC.
Results per pagefirstnumber
How many results to return per page (1-500). Defaults to 25.From 1 to 500. Default: 25.
Pagepagenumber
Which page of results to return. Defaults to 1.At least 1. Default: 1.

Outputs

datalist
Example output
{
  "data": [
    {
      "aircraft": 1500,
      "alliance": {
        "acronym": "Rose",
        "id": "790",
        "name": "Rose"
      },
      "alliance_id": "790",
      "alliance_position": "MEMBER",
      "color": "blue",
      "continent": "na",
      "id": "6",
      "leader_name": "Test Leader",
      "missiles": 12,
      "nation_name": "Testlandia",
      "nukes": 8,
      "num_cities": 25,
      "population": 3500000,
      "score": 4210.5,
      "ships": 300,
      "soldiers": 250000,
      "tanks": 20000,
      "wars_lost": 9,
      "wars_won": 42
    }
  ],
  "paginatorInfo": {
    "count": 1,
    "currentPage": 1,
    "hasMorePages": false,
    "lastPage": 1,
    "perPage": 25,
    "total": 1
  }
}

List trade prices

Get recent daily average market prices for every resource (most recent first).

Inputs

Results per pagefirstnumber
How many results to return per page (1-500). Defaults to 25.From 1 to 500. Default: 25.
Pagepagenumber
Which page of results to return. Defaults to 1.At least 1. Default: 1.

Outputs

datalist
Example output
{
  "data": [
    {
      "aluminum": 3100.0,
      "coal": 2100.0,
      "credits": 4200000.0,
      "date": "2026-08-13",
      "food": 180.0,
      "id": "3000",
      "oil": 3200.0,
      "steel": 4200.0
    }
  ],
  "paginatorInfo": {
    "count": 1,
    "currentPage": 1,
    "hasMorePages": false,
    "lastPage": 1,
    "perPage": 25,
    "total": 1
  }
}

List trades

List market trades, filtered by nation, trade type, resource, buy/sell side, and whether they were accepted.

Inputs

Nation IDnation_idnumber
Only include trades involving this nation.At least 1.
Trade typetrade_typetext
Only include trades of this type.One of: GLOBAL, PERSONAL, ALLIANCE.
Resourceoffer_resourcetext
Only include trades offering this resource.One of: food, coal, oil, uranium, lead, iron, bauxite, gasoline, munitions, steel, aluminum, credits.
Buy or sellbuy_or_selltext
Only include buy offers or sell offers.One of: buy, sell.
Accepted onlyacceptedtrue/false
Filter by whether the trade has been accepted.
Sort bysort_bytext
Which field to sort the results by.One of: ID, DATE, DATE_ACCEPTED (Date accepted), OFFER_RESOURCE (Offered resource), OFFER_AMOUNT (Offered amount).
Sort directionsort_directiontext
Whether to sort ascending or descending. Defaults to descending.One of: ASC (Ascending), DESC (Descending). Default: DESC.
Results per pagefirstnumber
How many results to return per page (1-500). Defaults to 25.From 1 to 500. Default: 25.
Pagepagenumber
Which page of results to return. Defaults to 1.At least 1. Default: 1.

Outputs

datalist
Example output
{
  "data": [
    {
      "accepted": false,
      "buy_or_sell": "sell",
      "date": "2026-08-13 12:00:00",
      "id": "7000001",
      "offer_amount": 5000,
      "offer_resource": "steel",
      "rid": "9",
      "sid": "6",
      "total": 15000000,
      "type": "GLOBAL"
    }
  ],
  "paginatorInfo": {
    "count": 1,
    "currentPage": 1,
    "hasMorePages": false,
    "lastPage": 1,
    "perPage": 25,
    "total": 1
  }
}

List treasure trades

List trades of in-game treasures between nations.

Inputs

Results per pagefirstnumber
How many results to return per page (1-500). Defaults to 25.From 1 to 500. Default: 25.
Pagepagenumber
Which page of results to return. Defaults to 1.At least 1. Default: 1.

Outputs

datalist
Example output
{
  "data": [
    {
      "accept_date": "2026-08-10 09:00:00",
      "accepted": true,
      "id": "2500",
      "money": 50000000,
      "offer_date": "2026-08-10 08:00:00",
      "receiver_id": "9",
      "sender_id": "6"
    }
  ],
  "paginatorInfo": {
    "count": 1,
    "currentPage": 1,
    "hasMorePages": false,
    "lastPage": 1,
    "perPage": 25,
    "total": 1
  }
}

List treasures

List all in-game treasures, their score bonus, the continent they are on, and the nation that currently holds each one.

Inputs

None.

Outputs

treasureslist
Example output
{
  "treasures": [
    {
      "bonus": 8,
      "color": "white",
      "continent": "na",
      "name": "The Declaration of Independence",
      "nation": {
        "id": "6",
        "nation_name": "Testlandia"
      },
      "spawndate": "2026-05-01"
    }
  ]
}

List treaties

List alliance treaties (the diplomatic agreements between alliances), including their type and turns remaining.

Inputs

Treaty IDtreaty_idnumber
Filter to a specific treaty id.At least 1.
Sort bysort_bytext
Which field to sort the results by.One of: ID, DATE, TURNS_LEFT (Turns left).
Sort directionsort_directiontext
Whether to sort ascending or descending. Defaults to descending.One of: ASC (Ascending), DESC (Descending). Default: DESC.
Results per pagefirstnumber
How many results to return per page (1-500). Defaults to 25.From 1 to 500. Default: 25.
Pagepagenumber
Which page of results to return. Defaults to 1.At least 1. Default: 1.

Outputs

datalist
Example output
{
  "data": [
    {
      "alliance1": {
        "id": "790",
        "name": "Rose"
      },
      "alliance1_id": "790",
      "alliance2": {
        "id": "913",
        "name": "Eclipse"
      },
      "alliance2_id": "913",
      "date": "2026-01-01 00:00:00",
      "id": "5001",
      "treaty_type": "MDP",
      "turns_left": 120
    }
  ],
  "paginatorInfo": {
    "count": 1,
    "currentPage": 1,
    "hasMorePages": false,
    "lastPage": 1,
    "perPage": 25,
    "total": 1
  }
}

List war attacks

List individual attacks, usually for one war, including the attack type, victor, loot, and infrastructure destroyed.

Inputs

War IDwar_idnumber
Only include attacks from this war.At least 1.
Attack IDattack_idnumber
Filter to a specific attack id.At least 1.
Sort bysort_bytext
Which field to sort the results by.One of: ID, DATE.
Sort directionsort_directiontext
Whether to sort ascending or descending. Defaults to descending.One of: ASC (Ascending), DESC (Descending). Default: DESC.
Results per pagefirstnumber
How many results to return per page (1-500). Defaults to 25.From 1 to 500. Default: 25.
Pagepagenumber
Which page of results to return. Defaults to 1.At least 1. Default: 1.

Outputs

datalist
Example output
{
  "data": [
    {
      "attid": "6",
      "date": "2026-08-10 15:00:00",
      "defid": "9",
      "id": "50000001",
      "moneystolen": 1500000.0,
      "success": 3,
      "type": "GROUND",
      "victor": "6",
      "warid": "1000001"
    }
  ],
  "paginatorInfo": {
    "count": 1,
    "currentPage": 1,
    "hasMorePages": false,
    "lastPage": 1,
    "perPage": 25,
    "total": 1
  }
}

List wars

List wars, filtered by nation, alliance, or active status, sorted by id or date.

Inputs

Nation IDnation_idnumber
Only include wars involving this nation.At least 1.
Alliancesalliance_idlist
Limit results to these alliances (pick by name, or leave empty for all).
War IDwar_idnumber
Filter to a specific war id.At least 1.
Only active warsactivetrue/false
Filter by whether the war is still active.
Sort bysort_bytext
Which field to sort the results by.One of: ID, DATE.
Sort directionsort_directiontext
Whether to sort ascending or descending. Defaults to descending.One of: ASC (Ascending), DESC (Descending). Default: DESC.
Results per pagefirstnumber
How many results to return per page (1-500). Defaults to 25.From 1 to 500. Default: 25.
Pagepagenumber
Which page of results to return. Defaults to 1.At least 1. Default: 1.

Outputs

datalist
Example output
{
  "data": [
    {
      "att_resistance": 100,
      "attacker": {
        "id": "6",
        "nation_name": "Testlandia"
      },
      "date": "2026-08-10 14:00:00",
      "def_resistance": 82,
      "defender": {
        "id": "9",
        "nation_name": "Defenderland"
      },
      "id": "1000001",
      "reason": "Raiding for loot",
      "turnsleft": 48,
      "war_type": "RAID"
    }
  ],
  "paginatorInfo": {
    "count": 1,
    "currentPage": 1,
    "hasMorePages": false,
    "lastPage": 1,
    "perPage": 25,
    "total": 1
  }
}

On this page