Documentation

GetLeaderboardAroundCharacter

Retrieves a list of ranked characters for the given statistic, centered on the requested Character ID

Request Details

GetLeaderboardAroundCharacterRequest
Request Properties
CharacterId (required) String

Unique PlayFab assigned ID for a specific character on which to center the leaderboard.

CharacterType String

Optional character type on which to filter the leaderboard entries.

MaxResultsCount int32

Maximum number of entries to retrieve. Default 10, maximum 100.

StatisticName (required) String

Unique identifier for the title-specific statistic for the leaderboard.

POST https://{{TitleID}}.playfabapi.com/Client/GetLeaderboardAroundCharacter
    Content-Type: application/json
    X-Authentication: <user_session_ticket_value>
{
  "StatisticName": "Kills",
  "CharacterId": "987343220",
  "MaxResultsCount": 20
}
        

Response Details

Note: When calling 'GetLeaderboardAround...' APIs, the position of the character defaults to 0 when the character does not have the corresponding statistic.

GetLeaderboardAroundCharacterResult
Result Properties
Leaderboard List<CharacterLeaderboardEntry>

Ordered list of leaderboard entries.

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "code": 200,
  "status": "OK",
  "data": {
    "Leaderboard": [
      {
        "PlayFabId": "10931252888739651331",
        "CharacterId": "987343220",
        "CharacterName": "FighterDude",
        "DisplayName": "username",
        "CharacterType": "blue_warrior",
        "StatValue": 12,
        "Position": 0
      }
    ]
  }
}

Authentication

SessionTicket

Possible Error Codes

Name Code