Skip to content

Top Ten Ranked Users

A call to this endpoint will retrieve the current top ten users, ranked by hardcore points, on the site.

HTTP Request

GET

https://retroachievements.org/API/API_GetTopTenUsers.php

Query Parameters

NameRequired?Description
yYesYour web API key.

Client Library

ts
import { buildAuthorization, getTopTenUsers } from "@retroachievements/api";

// First, build your authorization object.
const username = "<your username on RA>";
const webApiKey = "<your web API key>";

const authorization = buildAuthorization({ username, webApiKey });

// Then, make the API call.
const topTenUsers = await getTopTenUsers(authorization);
kotlin
val credentials = RetroCredentials("<username>", "<web api key>")
val api: RetroInterface = RetroClient(credentials).api

val response: NetworkResponse<GetTopTenUsers.Response, ErrorResponse> = api.getTopTenUsers()

if (response is NetworkResponse.Success) {
    // handle the data
    val topUsers: GetTopTenUsers.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
[
  {
    "1": "MaxMilyin",
    "2": 399597, // the user's hardcore points
    "3": 1599212 // the user's RetroPoints (white points)
  }
  // ...
]
json
[
  {
    "username": "MaxMilyin",
    "totalPoints": 399597,
    "totalRatioPoints": 1599212
  }
  // ...
]

Source

RepoURL
RAWebhttps://github.com/RetroAchievements/RAWeb/blob/master/public/API/API_GetTopTenUsers.php
api-jshttps://github.com/RetroAchievements/api-js/blob/main/src/feed/getTopTenUsers.ts
api-kotlinhttps://github.com/RetroAchievements/api-kotlin/blob/main/src/main/kotlin/org/retroachivements/api/RetroInterface.kt

Released under the MIT license.