Get user
The users.getUser
method on a Client
instance makes a GET
request to the users/{user}/{mode?}
endpoint and returns a user.
Example
const user = await api.users.getUser(14544646, {
urlParams: {
mode: 'osu'
}
});
Parameters
Parameter | Type | Optional | Description |
---|---|---|---|
user | string | number | ID of the user to get their beatmapsets | |
options | GetUserOptions | ✓ |
options.urlParams
Parameter | Type | Optional | Description |
---|---|---|---|
mode | GameMode | ✓ | Gamemode of the profile to return |
options.query
Parameter | Type | Optional | Description |
---|---|---|---|
key | ‘id’ | ✓ | Specify if the user param is an id or a username |
Returns
Promise<UserExtended[]>;
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 .