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
Parameter | Type | Optional | Description |
---|---|---|---|
user | number | ID of the user to get their scores | |
type | UserScoreType | Score type |
If type
is set to recent
then the parameters are as follows:
Parameter | Type | Optional | Description |
---|---|---|---|
user | number | ID of the user to get their scores | |
type | ‘recent’ | Score type | |
options | GetUserRecentScoresOptions | ✓ |
options.query
Parameter | Type | Optional | Description |
---|---|---|---|
limit | number | ✓ | Limit number of results |
offset | number | ✓ | Pagination offset |
mode | GameMode | ✓ | Gamemode of the scores to return |
include_fails | boolean | number | ✓ | Include failed scores? |
If type
is set to best
or firsts
then the parameters are as follows:
Parameter | Type | Optional | Description |
---|---|---|---|
user | number | ID of the user to get their scores | |
type | ‘best’ | ‘firsts’ | Score type | |
options | GetUserScoresOptions | ✓ |
options.query
Parameter | Type | Optional | Description |
---|---|---|---|
limit | number | ✓ | Limit number of results |
offset | number | ✓ | Pagination offset |
mode | GameMode | ✓ | Gamemode 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 .