Get ranking
The ranking.getRanking method on a Client instance makes a GET request to the rankings/{mode}/{type} endpoint and returns an object containing ranking data.
Example
const rankings = await api.ranking.getRanking('osu', 'performance', {
query: {
country: 'US'
}
});
Parameters
| Parameter | Type | Optional | Description |
|---|---|---|---|
| mode | GameMode | Ranking gamemode | |
| type | RankingType | Ranking type | |
| options | GetRankingOptions | ✓ |
options.query
| Parameter | Type | Optional | Description |
|---|---|---|---|
| country | string | ✓ | Filter by country code (only available for type performance) |
| filter | ‘all’ | ‘friends’ | ✓ | Show all users or friend ranking |
| spotlight | number | ✓ | ID of the spotlight (if type is charts) |
| variant | string | ✓ | Filter ranking by specified mode variant (only available for type performance) |
Returns
Promise<Rankings>;
Types
Possible Exceptions
See the error handling documentation for more information.
invalid_json_syntaxnetwork_errorunexpected_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 .