# Politics & War

> 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.

App · Gaming · 20 actions. Web page: https://docs.lodol.com/docs/integrations/politics-and-war

## Actions

### Get alliance

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

**Inputs**

- Alliance ID (`alliance_id`, number, required): The alliance's numeric id, e.g. 790. At least 1.

**Outputs**: None.

**Example output**

```json
{
  "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 ID (`city_id`, number, required): The city's numeric id. At least 1.

**Outputs**: None.

**Example output**

```json
{
  "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**

```json
{
  "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**

- `nation` (object)

**Example output**

```json
{
  "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 ID (`nation_id`, number, required): The nation's numeric id, e.g. 6. At least 1.

**Outputs**: None.

**Example output**

```json
{
  "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 ID (`war_id`, number, required): The war's numeric id. At least 1.

**Outputs**: None.

**Example output**

```json
{
  "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 ID (`alliance_id`, number): Filter to a specific alliance id. At least 1.
- Name (`name`, text): Filter to an alliance with this exact name.
- Sort by (`sort_by`, text): Which field to sort the results by. One of: `ID`, `DATE`, `SCORE`.
- Sort direction (`sort_direction`, text): Whether to sort ascending or descending. Defaults to descending. One of: `ASC` (Ascending), `DESC` (Descending). Default: `DESC`.
- Results per page (`first`, number): How many results to return per page (1-500). Defaults to 25. From 1 to 500. Default: `25`.
- Page (`page`, number): Which page of results to return. Defaults to 1. At least 1. Default: `1`.

**Outputs**

- `data` (list)

**Example output**

```json
{
  "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 ID (`record_id`, number): Filter to a specific bank-record id. At least 1.
- Sender ID (`sender_id`, number): Only include records sent by this nation or alliance id. At least 1.
- Recipient ID (`recipient_id`, number): Only include records received by this nation or alliance id. At least 1.
- Sender type (`sender_type`, text): Whether the sender is a nation or an alliance. One of: `1` (Nation), `2` (Alliance).
- Recipient type (`recipient_type`, text): Whether the recipient is a nation or an alliance. One of: `1` (Nation), `2` (Alliance).
- Sort by (`sort_by`, text): Which field to sort the results by. One of: `ID`, `DATE`, `MONEY`.
- Sort direction (`sort_direction`, text): Whether to sort ascending or descending. Defaults to descending. One of: `ASC` (Ascending), `DESC` (Descending). Default: `DESC`.
- Results per page (`first`, number): How many results to return per page (1-500). Defaults to 25. From 1 to 500. Default: `25`.
- Page (`page`, number): Which page of results to return. Defaults to 1. At least 1. Default: `1`.

**Outputs**

- `data` (list)

**Example output**

```json
{
  "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 ID (`nation_id`, number): Only include bounties placed on this nation. At least 1.
- Minimum amount (`min_amount`, number): Only include bounties worth at least this much. At least 0.
- Maximum amount (`max_amount`, number): Only include bounties worth at most this much. At least 0.
- Sort by (`sort_by`, text): Which field to sort the results by. One of: `ID`, `DATE`, `AMOUNT`.
- Sort direction (`sort_direction`, text): Whether to sort ascending or descending. Defaults to descending. One of: `ASC` (Ascending), `DESC` (Descending). Default: `DESC`.
- Results per page (`first`, number): How many results to return per page (1-500). Defaults to 25. From 1 to 500. Default: `25`.
- Page (`page`, number): Which page of results to return. Defaults to 1. At least 1. Default: `1`.

**Outputs**

- `data` (list)

**Example output**

```json
{
  "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 ID (`nation_id`, number): Only include cities belonging to this nation. At least 1.
- City ID (`city_id`, number): Filter to a specific city id. At least 1.
- Sort by (`sort_by`, text): Which field to sort the results by. One of: `ID`, `DATE`, `INFRASTRUCTURE`, `MAXINFRA` (Max infrastructure), `LAND`.
- Sort direction (`sort_direction`, text): Whether to sort ascending or descending. Defaults to descending. One of: `ASC` (Ascending), `DESC` (Descending). Default: `DESC`.
- Results per page (`first`, number): How many results to return per page (1-500). Defaults to 25. From 1 to 500. Default: `25`.
- Page (`page`, number): Which page of results to return. Defaults to 1. At least 1. Default: `1`.

**Outputs**

- `data` (list)

**Example output**

```json
{
  "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**

- `colors` (list)

**Example output**

```json
{
  "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 page (`first`, number): How many results to return per page (1-500). Defaults to 25. From 1 to 500. Default: `25`.
- Page (`page`, number): Which page of results to return. Defaults to 1. At least 1. Default: `1`.

**Outputs**

- `data` (list)

**Example output**

```json
{
  "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 name (`nation_name`, text): Filter to a nation with this exact name.
- Leader name (`leader_name`, text): Filter to a nation with this exact leader name.
- Alliances (`alliance_id`, list): Limit results to these alliances (pick by name, or leave empty for all).
- Color bloc (`color`, text): Only include nations in this color bloc. One of: `aqua`, `black`, `blue`, `brown`, `green`, `lime`, `maroon`, `olive`, `orange`, `pink`, and 6 more.
- Minimum score (`min_score`, number): Only include nations with at least this score. At least 0.
- Maximum score (`max_score`, number): Only include nations with at most this score. At least 0.
- Minimum cities (`min_cities`, number): Only include nations with at least this many cities. At least 1.
- Maximum cities (`max_cities`, number): Only include nations with at most this many cities. At least 1.
- In vacation mode (`vmode`, true/false): Filter by whether the nation is in vacation mode.
- Created after (`created_after`, date and time): Only include nations created after this date and time.
- Sort by (`sort_by`, text): Which field to sort the results by. One of: `ID`, `DATE`, `SCORE`, `CITIES`, `POPULATION`, `SOLDIERS`, `TANKS`, `AIRCRAFT`, `SHIPS`, `MISSILES`, `NUKES`.
- Sort direction (`sort_direction`, text): Whether to sort ascending or descending. Defaults to descending. One of: `ASC` (Ascending), `DESC` (Descending). Default: `DESC`.
- Results per page (`first`, number): How many results to return per page (1-500). Defaults to 25. From 1 to 500. Default: `25`.
- Page (`page`, number): Which page of results to return. Defaults to 1. At least 1. Default: `1`.

**Outputs**

- `data` (list)

**Example output**

```json
{
  "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 page (`first`, number): How many results to return per page (1-500). Defaults to 25. From 1 to 500. Default: `25`.
- Page (`page`, number): Which page of results to return. Defaults to 1. At least 1. Default: `1`.

**Outputs**

- `data` (list)

**Example output**

```json
{
  "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 ID (`nation_id`, number): Only include trades involving this nation. At least 1.
- Trade type (`trade_type`, text): Only include trades of this type. One of: `GLOBAL`, `PERSONAL`, `ALLIANCE`.
- Resource (`offer_resource`, text): Only include trades offering this resource. One of: `food`, `coal`, `oil`, `uranium`, `lead`, `iron`, `bauxite`, `gasoline`, `munitions`, `steel`, `aluminum`, `credits`.
- Buy or sell (`buy_or_sell`, text): Only include buy offers or sell offers. One of: `buy`, `sell`.
- Accepted only (`accepted`, true/false): Filter by whether the trade has been accepted.
- Sort by (`sort_by`, text): Which field to sort the results by. One of: `ID`, `DATE`, `DATE_ACCEPTED` (Date accepted), `OFFER_RESOURCE` (Offered resource), `OFFER_AMOUNT` (Offered amount).
- Sort direction (`sort_direction`, text): Whether to sort ascending or descending. Defaults to descending. One of: `ASC` (Ascending), `DESC` (Descending). Default: `DESC`.
- Results per page (`first`, number): How many results to return per page (1-500). Defaults to 25. From 1 to 500. Default: `25`.
- Page (`page`, number): Which page of results to return. Defaults to 1. At least 1. Default: `1`.

**Outputs**

- `data` (list)

**Example output**

```json
{
  "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 page (`first`, number): How many results to return per page (1-500). Defaults to 25. From 1 to 500. Default: `25`.
- Page (`page`, number): Which page of results to return. Defaults to 1. At least 1. Default: `1`.

**Outputs**

- `data` (list)

**Example output**

```json
{
  "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**

- `treasures` (list)

**Example output**

```json
{
  "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 ID (`treaty_id`, number): Filter to a specific treaty id. At least 1.
- Sort by (`sort_by`, text): Which field to sort the results by. One of: `ID`, `DATE`, `TURNS_LEFT` (Turns left).
- Sort direction (`sort_direction`, text): Whether to sort ascending or descending. Defaults to descending. One of: `ASC` (Ascending), `DESC` (Descending). Default: `DESC`.
- Results per page (`first`, number): How many results to return per page (1-500). Defaults to 25. From 1 to 500. Default: `25`.
- Page (`page`, number): Which page of results to return. Defaults to 1. At least 1. Default: `1`.

**Outputs**

- `data` (list)

**Example output**

```json
{
  "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 ID (`war_id`, number): Only include attacks from this war. At least 1.
- Attack ID (`attack_id`, number): Filter to a specific attack id. At least 1.
- Sort by (`sort_by`, text): Which field to sort the results by. One of: `ID`, `DATE`.
- Sort direction (`sort_direction`, text): Whether to sort ascending or descending. Defaults to descending. One of: `ASC` (Ascending), `DESC` (Descending). Default: `DESC`.
- Results per page (`first`, number): How many results to return per page (1-500). Defaults to 25. From 1 to 500. Default: `25`.
- Page (`page`, number): Which page of results to return. Defaults to 1. At least 1. Default: `1`.

**Outputs**

- `data` (list)

**Example output**

```json
{
  "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 ID (`nation_id`, number): Only include wars involving this nation. At least 1.
- Alliances (`alliance_id`, list): Limit results to these alliances (pick by name, or leave empty for all).
- War ID (`war_id`, number): Filter to a specific war id. At least 1.
- Only active wars (`active`, true/false): Filter by whether the war is still active.
- Sort by (`sort_by`, text): Which field to sort the results by. One of: `ID`, `DATE`.
- Sort direction (`sort_direction`, text): Whether to sort ascending or descending. Defaults to descending. One of: `ASC` (Ascending), `DESC` (Descending). Default: `DESC`.
- Results per page (`first`, number): How many results to return per page (1-500). Defaults to 25. From 1 to 500. Default: `25`.
- Page (`page`, number): Which page of results to return. Defaults to 1. At least 1. Default: `1`.

**Outputs**

- `data` (list)

**Example output**

```json
{
  "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
  }
}
```
