Guides

Leaderboards and ratings

Three reads cover every screen that shows a rating.

You want Call
A "top players" board with ranks GET /v1/pool/leaderboard
Everyone in the pool, page by page GET /v1/pool/rankings
The ratings of players you name GET /v1/user/ratings

All three read the default pool as written here. For another pool, put its id in the path (/v1/pool/<poolId>/leaderboard) or pass poolId as a query parameter. Ratings never cross pools.

Top 100 with ranks

The pool's best 100 players, paged within those 100. Every row carries its absolute rank.

curl https://api.inhouseranks.com/v1/pool/leaderboard \
  -H "x-api-key: $INHOUSE_API_KEY"
{
  "poolId": "6b01eb7991a8d0c2e72af66b",
  "leaderboard": [
    {
      "rank": 1,
      "mmrEntityExternalId": "carol",
      "mmrEntity": {
        "name": "Carol C.",
        "stats": [
          {
            "mmr": { "value": 1600 /* ... */ },
            "wins": 1,
            "losses": 0,
            "matchCount": 1
            // ...
          }
        ],
        "externalId": "carol"
        // ...
      }
      // ...
    },
    {
      "rank": 2,
      "mmrEntityExternalId": "alice",
      "mmrEntity": {
        "name": "alice",
        "stats": [
          {
            "mmr": { "value": 1545.086633573829 /* ... */ },
            "wins": 3,
            "losses": 0,
            "matchCount": 3
            // ...
          }
        ],
        "externalId": "alice"
        // ...
      }
      // ...
    }
    // ... 2 more
  ],
  "page": 1,
  "pageSize": 25,
  "totalCount": 4,
  "hasMore": false
}
  • Nobody below rank 100 is ever returned. page starts at 1 and pageSize is 1–100 (default 25). Page 2 at the default size starts at rank 26.
  • Only players with a ranked result appear: at least one win, loss or tie. Players who were created but never played, whose matches are all still pending, or who have only played unranked matches are left off. Archived players never appear.
  • rank is the position on this board: 1, 2, 3. Tied players don't share a rank. Equal ratings rank whoever played first higher.
  • The board is read live. A rating that changes between two page requests can move a player across a page boundary. For one consistent board, fetch it in a single call with pageSize=100.

rank is the player's place on the board. The band their rating falls in ("Gold") is a rank band.

Everyone in the pool

/rankings lists every active player in the pool, best first, 25 per page. Unlike the top-100 board it includes players who have never played a ranked match, and it has no ranks or totals.

curl "https://api.inhouseranks.com/v1/pool/rankings?page=1" \
  -H "x-api-key: $INHOUSE_API_KEY"
{
  "mmrEntities": [
    {
      "mmrEntity": {
        "name": "Carol C.",
        "stats": [
          {
            "mmr": { "value": 1600 /* ... */ },
            "wins": 1,
            "losses": 0,
            "matchCount": 1
            // ...
          }
        ],
        "externalId": "carol"
        // ...
      }
      // ...
    }
    // ... 3 more
  ],
  "page": 1
}
  • Each element wraps the player. It is { "mmrEntity": {...}, "groupMembers": [] }, so a rating is mmrEntities[i].mmrEntity.stats[0].mmr.value. groupMembers is always empty.
  • There is no totalCount. Pages start at 1, and a full page of 25 means "ask for the next one".

Specific players

For a scoreboard, a lobby or a profile screen, ask for the players by id instead of paging the ladder looking for them.

curl "https://api.inhouseranks.com/v1/user/ratings?mmrEntityExternalIds=alice,bob,zoe" \
  -H "x-api-key: $INHOUSE_API_KEY"
{
  "poolId": "6b01eb7991a8d0c2e72af66b",
  "ratings": [
    {
      "mmrEntityExternalId": "alice",
      "mmrEntity": {
        "name": "alice",
        "stats": [
          {
            "mmr": { "value": 1545.086633573829 /* ... */ },
            "wins": 3,
            "losses": 0,
            "matchCount": 3
            // ...
          }
        ],
        "externalId": "alice"
        // ...
      }
      // ...
    }
    // ... 1 more
  ],
  "missing": ["zoe"]
}
  • mmrEntityExternalIds is a comma-separated list of your player ids, at most 100 per call. An id that itself contains a comma can't be asked for here.
  • ratings comes back in the order you asked, not in rating order. Repeated ids collapse to one row.
  • Ids with no player in this pool land in missing. That is how you tell "hasn't played yet" from "wrong id". This call never creates the players it doesn't find.

Read a rating

Every call above returns the same rated user object, so one client model reads them all. The parts you'll use:

Field Meaning
externalId Your id for the player: the mmrEntityExternalId you sent.
name Their display name. It's the mmrEntityExternalId until you set one.
stats[] One block per position. The block with positionId: null is the overall rating.
stats[].mmr.value The rating.
stats[].wins, losses, ties, matchCount The record. matchCount includes unranked matches.
stats[].lastPlayedAt When the block last played a ranked match. null before the first.
stats[].groupRank The rank band the rating falls in. null in a pool without bands.
stats[].hideRating true when the pool says not to show this rating yet. See Hidden ratings.

Every field is listed under Rated user.

A pool whose game declares positions keeps a stats block per position. A match played in a position moves that block and the overall one. Add positionId=<id> to /leaderboard or /rankings to rank by that block instead of the overall one.