Skip to content

v2.rooms.leaderboard_v3

ck edited this page Oct 6, 2024 · 1 revision

async Retrieve a leaderboard from a room.

Usage example

const { auth, v2 } = require('osu-api-extended');

async function main() {
  try {
    await auth.login({
      type: 'lazer',
      login,
      password,
      cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
    });

    const result = await v2.rooms.leaderboard({
      id: 582265,
    });
    if (result.error != null) {
      console.log(result.error);
      return;
    };

    console.log(result);
  } catch (error) {
    console.log(error);
  };
};

main();
Parameter Type Description
params.id number
params.limit? number
addons.legacy_only? boolean
addons.apiVersion? '20240130' '99999999'
addons.authKey? string
addons.timeout_ms? number
addons.ignoreSessionRefresh? boolean

Response

export interface RoomsLeaderboardResponse {
  leaderboard: Leaderboard[]
  user_score: any
}

export interface Leaderboard {
  accuracy: number
  attempts: number
  completed: number
  pp: number
  room_id: number
  total_score: number
  user_id: number
  user: User
}

export interface User {
  avatar_url: string
  country_code: string
  default_group: string
  id: number
  is_active: boolean
  is_bot: boolean
  is_deleted: boolean
  is_online: boolean
  is_supporter: boolean
  last_visit: string
  pm_friends_only: boolean
  profile_colour: any
  username: string
  country: Country
}

export interface Country {
  code: string
  name: string
}

[v3.x.x] Documentation


[v2.x.x] Documentation

Clone this wiki locally