Class: Client

Client(apiKey, optionsopt) → {Client}

The main osu! API client.

Constructor

new Client(apiKey, optionsopt) → {Client}

Creates the osu! API client instance.
Parameters:
Name Type Attributes Description
apiKey String The osu! API key. - available from https://osu.ppy.sh/p/api
options Object <optional>
Options for the instance.
Properties
Name Type Attributes Default Description
disableRateLimiting Boolean <optional>
false Disabled ratelimiting through the client instance.
requestsPerMinute Number <optional>
60 Requests per minute for the main limiting bucket if ratelimiting is enabled (note that the replay endpoint has a special 10/minute bucket).
parseData Boolean <optional>
false If data should be parsed into our custom nodesu classes (experimental and could be subject to break).
baseUrl String <optional>
"https://osu.ppy.sh/api" osu! API base URL. May be changed for mocking purposes, or for using a rate-limiting proxy.
Properties:
Name Type Description
user UserComponent The set of functions that are related to the User section.
beatmaps BeatmapComponent The set of functions that are related to the Beatmap section.
scores ScoresComponent The set of functions that are related to the Score section.
replay ReplayComponent The set of functions that are related to the Replay section.
multi MultiComponent The set of functions that are related to the Multiplayer section.
apiKey String The osu! API key in use.
disableRateLimiting Boolean Should ratelimiting be used throughout the client instance.
requestsPerMinute Number How many requests per minute are allowed if ratelimiting is used.
parseData Boolean If data should be parsed into our custom nodesu classes. (experimental and could be subject to break)
Source:
Returns:
The osu! API client instance.
Type
Client

Methods

raw(endpoint, options) → {Promise.<Object>}

A direct raw API request with a payload of query string options.
Parameters:
Name Type Description
endpoint String The API endpoint.
options Object An object of query string options.
Source:
Returns:
The object returned from the API.
Type
Promise.<Object>