Get user scores

The users.getUserScores method on a Client instance makes a GET request to the users/{user}/scores/{type} endpoint and returns an array of the specified user’s scores.

Example

const scores = await api.users.getUserScores(14544646, 'best', {
  query: {
    mode: 'osu',
    limit: 3
  }
});

Parameters

ParameterTypeOptionalDescription
usernumberID of the user to get their scores
typeUserScoreTypeScore type

If type is set to recent then the parameters are as follows:

ParameterTypeOptionalDescription
usernumberID of the user to get their scores
type‘recent’Score type
optionsGetUserRecentScoresOptions

options.query

ParameterTypeOptionalDescription
limitnumberLimit number of results
offsetnumberPagination offset
modeGameModeGamemode of the scores to return
include_failsboolean | numberInclude failed scores?

If type is set to best or firsts then the parameters are as follows:

ParameterTypeOptionalDescription
usernumberID of the user to get their scores
type‘best’ | ‘firsts’Score type
optionsGetUserScoresOptions

options.query

ParameterTypeOptionalDescription
limitnumberLimit number of results
offsetnumberPagination offset
modeGameModeGamemode of the scores to return

Returns

If type is set to recent:

Promise<UserBestScore[]>;

Types

If type is set to best or firsts:

Promise<UserScore[]>;

Types

Possible Exceptions

See the error handling documentation for more information.

  • invalid_json_syntax
  • network_error
  • unexpected_response

Notice that something is missing? Found a typo? Think something's incomplete? Or think that something can be explained better? Feel free to open a pull request or submit an issue on the library's Github repository .