Skip to content

Leaderboard Entries

A call to this endpoint will retrieve a given leaderboard's entries, targeted by its ID.

On-site Representation

A leaderboards's entries can be found on the leaderboard info page:

Leaderboard Entires

HTTP Request

GET

https://retroachievements.org/API/API_GetLeaderboardEntries.php?i=104370

Query Parameters

NameRequired?Description
yYesYour web API key.
iYesThe target leaderboard ID.
cCount, number of records to return (default: 100, max: 500).
oOffset, number of entries to skip (default: 0).

Client Library

Kotlin
val credentials = RetroCredentials("<username>", "<web api key>")
val api: RetroInterface = RetroClient(credentials).api

val response: NetworkResponse<GetLeaderboardEntries.Response, ErrorResponse> = api.getLeaderboardEntries(
    gameId = 14402
)

if (response is NetworkResponse.Success) {
    // handle the data
    val leaderboardEntries: GetLeaderboardEntries.Response = response.body

} else if (response is NetworkResponse.Error) {
    // if the server returns an error it be found here
    val errorResponse: ErrorResponse? = response.body

    // if the api (locally) had an internal error, it'll be found here
    val internalError: Throwable? = response.error
}

Response

json
{
  "Count": 100,
  "Total": 1287,
  "Results": [
    {
      "Rank": 1,
      "User": "vani11a",
      "Score": 390490,
      "FormattedScore": "390,490",
      "DateSubmitted": "2024-07-25T15:51:00+00:00"
    }
    // ...
  ]
}

Source

RepoURL
RAWebhttps://github.com/RetroAchievements/RAWeb/blob/master/public/API/API_GetLeaderboardEntries.php
api-kotlinhttps://github.com/RetroAchievements/api-kotlin/blob/main/src/main/kotlin/org/retroachivements/api/RetroInterface.kt

Released under the MIT license.