Create an object of this class to get started!

Constructors

  • Parameters

    • key: string

      Your API key, which you can get at https://osu.ppy.sh/p/api

    • verbose: "all" | "none" | "errors" = "none"

      (default none) Which events should be logged

    • server: string = "https://osu.ppy.sh/api/"

      (default https://osu.ppy.sh/api/) The server where the requests should be sent to

    Returns API

Properties

key: string
server: string
verbose: "all" | "none" | "errors"

Methods

  • Look for and get a singular Beatmap with this!

    Parameters

    • beatmap: Beatmap | {
          beatmap_id: number;
      }

      An Object with the ID of the difficulty/Beatmap of the beatmapset

    • mods: Mods = Mods.NONE

      A number representing the Mods to apply, defaults to 0 (no mod/None)

    • Optional gamemode: Gamemodes

      The gamemode the beatmap is in (useful if you wanna convert, for example, an osu! map to taiko)

    Returns Promise<Beatmap>

    A Promise with a Beatmap

  • Parameters

    • limit: number

      The maximum number of Scores to get, cannot exceed 100

    • gamemode: Gamemodes

      A number representing the Scores' Gamemode

    • beatmap: Beatmap | {
          beatmap_id: number;
      }

      An Object with the ID of the difficulty/Beatmap of the beatmapset

    • Optional user: User | {
          user_id?: number;
          username?: string;
      }

      The Scores' user, which is an Object with either a user_id or a username

    • Optional mods: Mods

      A number representing the Mods to apply

    Returns Promise<ScoreWithReplayavailablePp[]>

    A Promise with an array of Scores set on a beatmap

  • Look for and get Beatmaps with this! Throws an APIError if the array would be empty

    Parameters

    • limit: number

      The maximum number of Beatmaps there should be in the array, cannot exceed 500

    • gamemode: {
          allow_converts?: boolean;
          gamemode: "all" | Gamemodes;
      }

      Filter in the beatmaps by the gamemode (unless "all"), but if allow_converts then instead convert if possible the beatmaps to that gamemode

      • Optional allow_converts?: boolean
      • gamemode: "all" | Gamemodes
    • Optional beatmap: Beatmap | {
          beatmap_id?: number;
          beatmapset_id?: number;
          file_md5?: string;
      }

      Will look for its beatmapset_id (if undefined, its beatmap_id (if undefined, its file_md5))

    • mods: Mods = Mods.NONE

      A number representing the Mods to apply, defaults to 0 (no mod/None)

    • Optional set_owner: User | {
          user_id?: number;
          username?: string;
      }

      The User that owns the beatmapset

    • Optional since: Date

      Filters out any Beatmap of Category < 0, and any Beatmap with an approved_date older than what's given

    Returns Promise<Beatmap[]>

  • Parameters

    • id: number

      The ID of the Match

    Returns Promise<Match>

    A Promise with a Match

    Remarks

    If the API's server is set to https://ripple.moe/api, getMatch might not work as it's currently unsupported by Ripple, see https://docs.ripple.moe/docs/api/peppy

  • Specify the gamemode the score was set in, then say if you know the id of the Score OR if you know the score's User, Beatmap, and Mods

    Parameters

    • gamemode: Gamemodes

      A number representing the Gamemode the Score was set in

    • replay: {
          score?: Score | {
              score_id: number;
          };
          search?: {
              beatmap: Beatmap | {
                  beatmap_id: number;
              };
              mods: Mods;
              user: User | {
                  user_id?: number;
                  username?: string;
              };
          };
      }

      An Object that contains a score with an id, or an Object that specifies info about the score (User, Beatmap, and Mods)

      • Optional score?: Score | {
            score_id: number;
        }
      • Optional search?: {
            beatmap: Beatmap | {
                beatmap_id: number;
            };
            mods: Mods;
            user: User | {
                user_id?: number;
                username?: string;
            };
        }
        • beatmap: Beatmap | {
              beatmap_id: number;
          }
        • mods: Mods
        • user: User | {
              user_id?: number;
              username?: string;
          }

    Returns Promise<Replay>

    If possible, a Replay of that Score

    Remarks

    If the API's server is set to https://ripple.moe/api, getReplay might not work as it's currently unsupported by Ripple, see https://docs.ripple.moe/docs/api/peppy

  • Parameters

    • gamemode: Gamemodes

      The User's Gamemode

    • user: User | {
          user_id?: number;
          username?: string;
      }

      An Object with either a user_id or a username (ignores username if user_id is specified)

    Returns Promise<User>

    A Promise with a User found with the search

  • Parameters

    • limit: number

      The maximum number of Scores to get, cannot exceed 100

    • gamemode: Gamemodes

      The User's Gamemode

    • user: User | {
          user_id?: number;
          username?: string;
      }

      An Object with either a user_id or a username (user_id is preferred)

    Returns Promise<ScoreWithBeatmapidReplayavailablePp[]>

    A Promise with an array of Scores set by the User within the last 24 hours in a specific Gamemode

  • Parameters

    • limit: number

      The maximum number of Scores to get, cannot exceed 100

    • gamemode: Gamemodes

      The User's Gamemode

    • user: User | {
          user_id?: number;
          username?: string;
      }

      An Object with either a user_id or a username (user_id is preferred)

    Returns Promise<ScoreWithBeatmapid[]>

    A Promise with an array of Scores set by the User within the last 24 hours in a specific Gamemode

  • Use this instead of console.log to log any information

    Parameters

    • is_error: boolean

      Is the information an error?

    • Rest ...to_log: any[]

      Whatever you would put between the parentheses of console.log()

    Returns void

  • Parameters

    • endpoint: string

      Basically the endpoint, what comes in the URL after api/

    • parameters: string

      The things to specify in the request, such as the beatmap_id when looking for a beatmap

    • number_try: number = 1

      How many attempts there's been to get the data

    Returns Promise<any>

    A Promise with the API's response

Generated using TypeDoc