Documentation

GetCharacterLeaderboard

Retrieves a list of ranked characters for the given statistic, starting from the indicated point in the leaderboard

Request Details

GetCharacterLeaderboardRequest
Request Properties
CharacterType String

Optional character type on which to filter the leaderboard entries.

MaxResultsCount (required) int32

Maximum number of entries to retrieve.

StartPosition (required) int32

First entry in the leaderboard to be retrieved.

StatisticName (required) String

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

POST https://{{TitleID}}.playfabapi.com/Server/GetCharacterLeaderboard
    Content-Type: application/json
    X-SecretKey: <developer_secret_key>
{
  "StatisticName": "Kills",
  "StartPosition": 0,
  "MaxResultsCount": 20
}
        

Response Details

Note that the Position of the character in the results is for the overall leaderboard.

GetCharacterLeaderboardResult
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": "9874325",
        "DisplayName": "username",
        "CharacterType": "blue_warriors",
        "StatValue": 12,
        "Position": 0
      }
    ]
  }
}

Authentication

SecretKey

Possible Error Codes

Name Code