Skip to content

User Points

A call to this endpoint will retrieve a given user's hardcore and softcore points.

HTTP Request

GET

https://retroachievements.org/API/API_GetUserPoints.php?u=Hexadigital

Query Parameters

NameRequired?Description
zYesYour username.
yYesYour web API key.
uYesThe target username.

Client Library

ts
import { buildAuthorization, getUserPoints } 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 userPoints = await getUserPoints(authorization, {
  username: "Hexadigital",
});
kotlin
val credentials = RetroCredentials("<username>", "<web api key>")
val api: RetroInterface = RetroClient(credentials).api

val response: NetworkResponse<GetUserPoints.Response, ErrorResponse> = api.getUserPoints(
    username = "Hexadigital"
)

if (response is NetworkResponse.Success) {
    // handle the data
    val userPoints: GetUserPoints.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
{
  "Points": 31299,
  "SoftcorePoints": 24264
}
json
{
  "points": 31299,
  "softcorePoints": 24264
}

Source

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

Released under the MIT license.