User Endpoints

Every battle one player has played, tournament and casual alike.

Battles a player has taken part in, newest first. The date range is optional. Archived battles are left out.

Path Parameters

ParameterTypeRequiredDescription
publicIdstringRequiredThe public player id. It comes back as playerId on leaderboard rows, battle players and army lists.

Query Parameters

ParameterTypeRequiredDescription
fromstringOptionalOnly battles played on or after this date. Leave out for no lower bound.
tostringOptionalOnly battles played on or before this date (UTC, whole day). Leave out for no upper bound. Give both and the window may not be longer than a year. "from" and "to" are UTC calendar days. A battle's "date" is in the tournament's time zone, so near midnight the two can differ by a day.
cursorstringOptionalComes from the "next" link of a previous response.
limitintegerOptionalResults per page. Default: 20, max: 100.

Response Fields (per battle)

idstring
The battle id. Pass it to /battles/{id}.
datestring (YYYY-MM-DD) | null
The day the battle was played, as a local date.
tournamentstring | null
Slug of the tournament the battle belongs to. Null for a casual battle.See Tournament
stagestring | null
Id of the tournament stage the battle was played in, for example "swiss". Null for a casual battle.See Stage
roundnumber | null
Round number, counting from 1.
state"setup" | "ongoing" | "finished"
How far the battle has got. "setup" before the first round, "ongoing" until the result is confirmed, then "finished". Only a finished battle has a result.
scenariostring | null
Scenario played.
battlePackstring | null
Name of the battle pack the battle was played with.
battleSizenumber
Points limit per army, for example 2000.
winnerstring | null
Name of the winning player. Null on a draw, and null until the battle is finished.
victorySize"major" | "minor" | null
How big the win was. Null until the battle is finished.
playersBattlePlayer[]
The two players and how they scored.
urlstring
Link to the battle page on milarki.com.
teamMatchTeamMatch | null
The team-against-team match this battle is one game of. Null on every battle outside a team tournament, which is most of them.

Returns 404 if the player does not exist.

Example request

bash
curl "https://milarki.com/api/v1/users/L80MTI4R/battles?from=2025-01-01&to=2025-12-31" \
  -H "Authorization: Bearer mlk_v1_yourkey"

Example response

json
{
  "data": [
    {
      "id": "000b1161c8a864a1f75f",
      "date": "2025-01-14",
      "tournament": "the-behemoth",
      "stage": "knockout",
      "round": 6,
      "scenario": "Lines of Communication",
      "battlePack": "GHB 24/25 4th",
      "battleSize": 2000,
      "winner": "Anders Larsson",
      "victorySize": "major",
      "players": [
        {
          "player": "Anders Larsson",
          "playerId": "L80MTI4R",
          "faction": "Disciples of Tzeentch",
          "subFaction": "Guild of Summoners",
          "outcome": "win",
          "battlePoints": 20,
          "victoryPoints": 28,
          "objectivePoints": 18,
          "battleTacticsScored": 3,
          "drops": 6,
          "role": "attacker",
          "metrics": {}
        }
      ],
      "url": "https://www.milarki.com/battles/000b1161c8a864a1f75f"
    }
  ],
  "next": "https://milarki.com/api/v1/users/L80MTI4R/battles?cursor=eyJpZCI6Im5leHQifQ&limit=20"
}