API reference

Leaderboards

Two reads of a pool's standings. For which to use when, see Leaderboards and ratings.

Get the top 100

GET/v1/pool/<poolId>/leaderboard

GET/v1/pool/leaderboard

The pool's best 100 players, each with an absolute rank, paged within those 100. Only players with a ranked result appear. Nobody below rank 100 is ever returned.

Parameters

Parameter In Required Description
poolId path no The pool's id. Leave the segment out for the default pool.
poolId query no The same id, as a query parameter instead.
page query no Starts at 1. Default 1.
pageSize query no 1–100. Default 25.
positionId query no Rank by this position's stats block instead of the overall one. Players with no block for it are left off.

Request

curl https://api.inhouseranks.com/v1/pool/leaderboard \
  -H "x-api-key: $INHOUSE_API_KEY"

Response 200

{
  "poolId": "6b01eb7991a8d0c2e72af66b",
  "leaderboard": [
    {
      "rank": 1,
      "mmrEntityExternalId": "carol",
      "mmrEntity": {
        "_id": "6b01eb7991a8d0c2e72af676",
        "name": "Carol C.",
        "stats": [
          {
            "positionId": null,
            "mmr": { "value": 1600 /* ... */ },
            "wins": 1,
            "losses": 0,
            "ties": 0,
            "matchCount": 1,
            "groupRank": {
              "lower": 1500,
              "upper": null,
              "rank": "Gold",
              "tier": null,
              "image": "https://assets.example.com/ranks/gold.png"
            },
            "hideRating": false
            // ...
          }
        ],
        "externalId": "carol"
        // ...
      }
      // ...
    }
    // ... 3 more
  ],
  "page": 1,
  "pageSize": 25,
  "totalCount": 4,
  "hasMore": false
}
Key Contains
poolId Inhouse's id for the pool.
leaderboard One row per player, best first: { rank, mmrEntityExternalId, userExternalId, mmrEntity }.
leaderboard[].rank The position on the board: 1, 2, 3. Tied players don't share a rank.
leaderboard[].mmrEntityExternalId Your id for the player, the same as mmrEntity.externalId. null for a rated user created without one. Also sent as userExternalId.
leaderboard[].mmrEntity The rated user.
page, pageSize The page returned.
totalCount How many players made the board: at most 100, fewer in a smaller pool.
hasMore Whether another page follows. A page past the end of the board comes back empty.

Order is rating, best first. Equal ratings rank whoever played first higher (the earliest lastPlayedAt), and always come back in the same order.

Errors

Status code When
400 invalid-pagination page is below 1, pageSize is outside 1–100, or either isn't a whole number. message names the bounds.

List rankings

GET/v1/pool/<poolId>/rankings

GET/v1/pool/rankings

Every active rated user in the pool, best first, 25 per page. Players who have never played a ranked match are included. Archived players are left out.

Parameters

Parameter In Required Description
poolId path no The pool's id. Leave the segment out for the default pool.
poolId query no The same id, as a query parameter instead.
page query no Starts at 1. Default 1.
positionId query no Sort by this position's stats block instead of the overall one.

Request

curl "https://api.inhouseranks.com/v1/pool/rankings?page=1" \
  -H "x-api-key: $INHOUSE_API_KEY"

Response 200

{
  "mmrEntities": [
    {
      "mmrEntity": {
        "_id": "6b01eb7991a8d0c2e72af676",
        "name": "Carol C.",
        "stats": [
          {
            "positionId": null,
            "mmr": { "value": 1600 /* ... */ },
            "wins": 1,
            "losses": 0,
            "ties": 0,
            "matchCount": 1,
            "groupRank": {
              "lower": 1500,
              "upper": null,
              "rank": "Gold",
              "tier": null,
              "image": "https://assets.example.com/ranks/gold.png"
            },
            "hideRating": false
            // ...
          }
        ],
        "externalId": "carol"
        // ...
      }
      // ...
    }
    // ... 3 more
  ],
  "page": 1
}
Key Contains
mmrEntities One wrapper per player: { mmrEntity, groupMembers }. The rated user is mmrEntities[i].mmrEntity, so a rating is mmrEntities[i].mmrEntity.stats[0].mmr.value. groupMembers is always []: a pool has no members.
page The page returned. There is no totalCount: a full page of 25 means "ask for the next one".

Equal ratings rank whoever played first higher. Players who have never played a ranked match come after everyone who has, and the rest is a fixed order, so a tie never repeats or vanishes across pages.

Errors

Status code When
400 invalid-pagination page isn't a whole number from 1 up.