Constructor
new Client(apiKey, optionsopt)
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) |
|
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. |
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:
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>