Please use API.createAsync instead of the default constructor if you don't have at least an API.access_token!
An API object without an access_token is pretty much useless!
The key that allows you to talk with the API
The ID of your client, which you can get on https://osu.ppy.sh/home/account/edit#oauth
The Secret of your client, which you can get or reset on https://osu.ppy.sh/home/account/edit#oauth
The expiration date of your access_token
Used in practically all requests, those are all the headers the package uses excluding Authorization, the one with the token
Valid for an unknown amount of time, it allows you to get a new token without going through the Authorization Code Grant again! Use API.refreshToken to make use of this token
If true, upon failing a request due to a 401, it will call API.refreshToken (defaults to true)
If true, the application will silently call API.refreshToken when theAPI.access_token is set to expire, as determined by API.expires (defaults to false)
In seconds, how long should it wait after a request failed before retrying? (defaults to 2)
How many retries maximum before throwing an APIError (defaults to 4)
Should it retry a request upon successfully refreshing the token due to API.refresh_token_on_401 being true? (defaults to true)
Upon failing a request and receiving a response, because of which received status code should the request be retried? (defaults to [429])
Should it retry a request if that request failed because it has been aborted by the API.timeout? (defaults to false)
Used by practically every method to interact with the API.server (defaults to [api, v2])
Used for getting an API.access_token and using your API.refresh_token (defaults to [oauth, token])
The base url of the server where the requests should land (defaults to https://osu.ppy.sh)
Should always be "Bearer"
The osu! user id of the user who went through the Authorization Code Grant
Which events should be logged (defaults to none)
Whether or not the token has been refreshed
The function that directly communicates with the API! Almost every functions of the API object uses this function!
The type of request, each endpoint uses a specific one (if it uses multiple, the intent and parameters become different)
What comes in the URL after api/, DO NOT USE TEMPLATE LITERALS (`) OR THE ADDITION OPERATOR (+), put everything separately for type safety
The things to specify in the request, such as the beatmap_id when looking for a beatmap
Optionalsettings: Omit<RequestInit, "body">Additional settings to add to the current settings of the fetch() request
Context given by a prior request
A Promise with the API's response
Revoke your current token! This will revoke the API.refresh_token as well if it exists, so use this with care
Uses API.route_api instead of API.route_token, as normally expected by the server
You can use this to specify additional settings for the method you're going to call, such as headers, an AbortSignal, and more advanced things!
You may get more info at https://developer.mozilla.org/en-US/docs/Web/API/RequestInit#instance_properties
A special version of the API that changes how requests are done
StaticcreateThe normal way to create an API instance! Make sure to await it
The ID of your client, which you can get on https://osu.ppy.sh/home/account/edit#oauth
The Secret of your client, which you can get or reset on https://osu.ppy.sh/home/account/edit#oauth
Optionaluser: { code: string; redirect_uri: string }If the instance is supposed to represent a user, use their Authorization Code and the Application Callback URL of your application!
The code that appeared as a GET argument when they got redirected to the Application Callback URL (redirect_uri)
The Application Callback URL; Where the User has been redirected to after saying "okay" to your application doing stuff
Optionalsettings: Partial<API>Additional settings you'd like to specify now rather than later, check out the Accessors at https://osu-v2.taevas.xyz/classes/API.html
A promise with an API instance
ReadonlygetGet extensive beatmap data about whichever beatmap you want!
Get extensive beatmap data about whichever beatmap you want!
ReadonlygetGet various data about the difficulty of a beatmap!
Get various data about the difficulty of a beatmap!
The Beatmap in question
Optionalmods: number | string[] | Mod[]Can be a bitset of mods, an array of mod acronyms, or an array of Mods (ignores mod settings) (defaults to No Mod)
Optionalruleset: RulesetUseful to specify if the beatmap is a convert (defaults to the ruleset the beatmap was intended for)
You may want to use API.getBeatmapDifficultyAttributesOsu (or Taiko or whatever) instead for better type safety
You may want to use API.getBeatmapDifficultyAttributesOsu (or Taiko or whatever) instead for better type safety
ReadonlygetGet various data about the difficulty of a ctb beatmap!
ReadonlygetGet various data about the difficulty of a mania beatmap!
ReadonlygetGet various data about the difficulty of an osu! beatmap!
ReadonlygetGet various data about the difficulty of a taiko beatmap!
ReadonlygetGet data about a Beatmap.Pack using its tag!
Get data about a Beatmap.Pack using its tag!
Currently in https://osu.ppy.sh/beatmaps/packs, when hovering a pack, its URL with its tag should be preview by your browser
Currently in https://osu.ppy.sh/beatmaps/packs, when hovering a pack, its URL with its tag should be preview by your browser
ReadonlygetGet an Array of up to 100 Beatmap.Packs of a specific type!
Get an Array of up to 100 Beatmap.Packs of a specific type!
The type of the BeatmapPacks (defaults to standard)
Optionalcursor_string: stringUse a response's cursor_string with the same parameters to get the next "page" of results!
ReadonlygetGet extensive beatmap data for up to 50 beatmaps at once!
Get extensive beatmap data for up to 50 beatmaps at once!
ReadonlygetGet the top scores of a beatmap!
ReadonlygetGet the score on a beatmap made by a specific user (with specific mods and on a specific ruleset if needed)
Get the score on a beatmap made by a specific user (with specific mods and on a specific ruleset if needed)
An Object with the position of the score according to the specified Mods and Ruleset, and with the score itself
ReadonlygetGet the scores on a beatmap made by a specific user (with the possibility to specify if the scores are on a convert)
ReadonlygetGet all the UserTags that currently exist in the game!
ReadonlylookupGet extensive beatmap data about whichever beatmap you want!
Get extensive beatmap data about whichever beatmap you want!
What to specify in order to find the right beatmap
ReadonlygetGet extensive beatmapset data about whichever beatmapset you want!
Get extensive beatmapset data about whichever beatmapset you want!
The beatmapset or the id of the beatmapset you're trying to get
ReadonlygetGet complex data about the posts of a beatmapset's discussion or of a user!
Get complex data about the posts of a beatmapset's discussion or of a user!
Optionalfrom: { discussion?: number | Beatmapset.Discussion; user?: number | User }From where/who are the posts coming from? A specific discussion, a specific user?
Optionaltypes: ("first" | "reply" | "system")[]What kind of posts?
Optionalconfig: Miscellaneous.ConfigHow many results maximum, how to sort them, which page of those, maybe a cursor_string...
Relevant posts and info about them
ReadonlygetGet complex data about the discussion page of any beatmapet that you want!
Get complex data about the discussion page of any beatmapet that you want!
Optionalfrom: {From where/who are the discussions coming from? Maybe only qualified sets?
Optionalfilter: {Should those discussions only be unresolved problems, for example?
Optionalconfig: Miscellaneous.ConfigHow many results maximum, how to sort them, which page of those, maybe a cursor_string...
Relevant discussions and info about them
ReadonlygetGet complex data about the votes of a beatmapset's discussions or/and received/given by a specific user!
Get complex data about the votes of a beatmapset's discussions or/and received/given by a specific user!
Optionalfrom: {The discussion with the votes, the user who voted, the user who's gotten the votes...
Optionalscore: 1 | -1An upvote (1) or a downvote (-1)
Optionalconfig: Miscellaneous.ConfigHow many results maximum, how to sort them, which page of those, maybe a cursor_string...
Relevant votes and info about them
ReadonlygetGet complex data about the events of a beatmapset and the users involved with them!
Get complex data about the events of a beatmapset and the users involved with them!
Optionalfrom: {Which beatmapset, or caused by which user? When?
Optionaltypes: (What kinds of events?
Optionalconfig: Miscellaneous.ConfigHow many results maximum, how to sort them, which page of those, maybe a cursor_string...
Relevant events and users
ReadonlylookupGet extensive data about a beatmapset by using a beatmap!
ReadonlysearchSearch for beatmapsets as if you were on the website or on lazer!
Search for beatmapsets as if you were on the website or on lazer!
Optionalquery: {All the filters and sorting options that you'd normally find on the website or on lazer
Optionalcategories?: Filter in sets depending on their status or on their relation with the authorized user (defaults to all that have a leaderboard)
Optionalcursor_string?: stringThe thing you've got from a previous request to get another page of results!
Optionalextra?: ("must_have_video" | "must_have_storyboard")[]Should all sets have a video, a storyboard, maybe both at once?
Optionalgeneral?: (Various filters to activate
Optionalgenre?: Specify the musical genre of the music of the beatmapsets you're searching for (don't specify to get any genre)
Optionalhide_explicit_content?: trueUse this to hide all sets that are marked as explicit
Optionalkeywords?: stringWhat you'd put in the searchbar, like the name of a beatmapset or a mapper!
Optionallanguage?: Specify the spoken language of the music of the beatmapsets you're searching for (don't specify to get any language)
Optionalmode?: RulesetOnly get sets that have maps that you can play in the ruleset of your choice
Optionalplayed?: "Played" | "Unplayed"Does the authorized user with osu!supporter have already played those sets, or have they not played them yet?
Optionalrank_achieved?: ("Silver SS" | "SS" | "Silver S" | "S" | "A" | "B" | "C" | "D")[]Does the authorized user with osu!supporter have already achieved certain ranks on those sets?
Optionalsort?: {Sort by what, in ascending/descending order
Relevant Beatmapsets that contain Beatmaps, and a cursor_string to allow you to look for more of the same!
ReadonlygetGet details about the version/update/build of something related to osu!
Get details about the version/update/build of something related to osu!
The name of the thing related to osu!, like lazer, web, cuttingedge, beta40, stable40
The name of the version! Usually something like 2023.1026.0 for lazer, or 20230326 for stable
ReadonlygetGet up to 21 versions/updates/builds!
Get up to 21 versions/updates/builds!
Optionalstream: stringOnly get builds from a specific stream
Optionalrange: { from?: string; to?: string | number }Get builds that were released before/after (and including) those builds
Optionalfrom?: stringThe name of the build
Optionalto?: string | numberThe name or the id of the build
changelog_entries will have a message property if markdown, message_html property if html (defaults to both)
ReadonlygetAn effective way to get all available streams, as well as their latest version!
An effective way to get all available streams, as well as their latest version!
ReadonlylookupGet details about the version/update/build of something related to osu!
Get details about the version/update/build of something related to osu!
A stream name like lazer, a build version like 2023.1026.0, or the id of a build
changelog_entries will have a message property if markdown, message_html property if html (defaults to both)
ReadonlycreateCreate a new announcement!
ReadonlycreateCreate/Open/Join a private messages chat channel!
Create/Open/Join a private messages chat channel!
The newly created channel!
ReadonlygenerateGet a WebSocket to get Websocket events from!
Get a WebSocket to get Websocket events from!
Optionalheaders: { [key: string]: any }The headers that will be used to create the WebSocket (defaults to running getChatWebsocketHeaders())
The "notification websocket/server" URL (defaults to wss://notify.ppy.sh)
ReadonlygetGet a ChatChannel that you have joined, and the users in it if it is a private channel!
Get a ChatChannel that you have joined, and the users in it if it is a private channel!
ReadonlygetGet a list of all publicly joinable channels!
ReadonlygetGet the recent messages of a specific ChatChannel!
Get the recent messages of a specific ChatChannel!
The Channel you wanna get the messages from
The maximum amount of messages you want to get, up to 50! (defaults to 20)
Optionalsince: number | Chat.MessageGet the messages sent after this message
Optionaluntil: number | Chat.MessageGet the messages sent up to but not including this message
ReadonlygetGet the headers you might require in order to create a WebSocket connection!
Get the headers you might require in order to create a WebSocket connection!
An object with the proper Authorization: Bearer header, in addition to the headers used in other requests,
which are all specified in API.headers
Feel free to use this and ignore API.generateChatWebsocket if for example you're gonna use a third party package for handling websockets
Feel free to use this and ignore API.generateChatWebsocket if for example you're gonna use a third party package for handling websockets
An object with the proper Authorization: Bearer header, in addition to the headers used in other requests,
which are all specified in API.headers
ReadonlyjoinJoin a public or multiplayer ChatChannel, allowing you to interact with it!
Join a public or multiplayer ChatChannel, allowing you to interact with it!
ReadonlykeepNeeds to be done periodically to reset chat activity timeout
Needs to be done periodically to reset chat activity timeout
Optionalsince: { message?: number | Chat.Message; user_silence?: number | UserSilence }UserSilences that are before that will not be returned!
A list of recent silences
ReadonlyleaveLeave/Close a public ChatChannel!
ReadonlymarkMark a certain channel as read up to a given message!
ReadonlysendSend a message in a ChatChannel!
Send a message in a ChatChannel!
The newly sent ChatMessage!
ReadonlysendSend a private message to someone!
Send a private message to someone!
The message you sent
ReadonlygetGet a specific comment by using its id!
ReadonlygetGet comments that meet any of your requirements!
Get comments that meet any of your requirements!
Optionalfrom: { id: number; type: "beatmapset" | "build" | "news_post" }From where are the comments coming from? Maybe a beatmapset, but then, which beatmapset?
Optionalparent: number | CommentThe comments are replying to which comment? Make the id 0 to filter out replies (and only get top level comments)
Optionalsort: {Should the comments be sorted by votes? Should they be from after a certain date? Maybe you can give a cursor?
ReadonlygetGet everything note-worthy that happened on osu! recently!
Get everything note-worthy that happened on osu! recently!
Optionalconfig: Pick<Miscellaneous.Config, "sort" | "cursor_string">Sort the results differently, or use a cursor_string to get more results
ReadonlycreateCreate a new Forum.Topic in the forum of your choice!
Create a new Forum.Topic in the forum of your choice!
The Forum you're creating your topic in
The topic's title
The first post's content/message
Optionalpoll: {If you want to make a poll, specify the parameters of that poll!
Optionalhide_results?: booleanShould the results of the poll be hidden while the voting period is still active? (defaults to false)
Length of voting period in days, 0 means forever
Optionalmax_options?: numberThe maximum amount of votes per user! (defaults to 1)
The things the users can vote for
Optionalvote_change?: booleanDo you allow users to change their vote? (defaults to false)
An object with the topic you've made, and its first initial post (which uses your text)
ReadonlyeditEdit a ForumPost! Note that it can be the initial one of a ForumTopic!
ReadonlyeditEdit the title of a Forum.Topic!
ReadonlygetGet a Forum with a specific id, as well as its Forum.Topics!
Get a Forum with a specific id, as well as its Forum.Topics!
An object with the Forum, its topics, and the topics pinned in it
ReadonlygetGet a list of all top-level Forums!
Get a list of all top-level Forums!
All the top-level forums
ReadonlygetGet a Forum.Topic, as well as its main post (content) and the posts that were sent in it!
Get a Forum.Topic, as well as its main post (content) and the posts that were sent in it!
ReadonlygetGet multiple existing Forum.Topic, optionally in a specific Forum!
Get multiple existing Forum.Topic, optionally in a specific Forum!
Optionalconfig: Pick<Miscellaneous.Config, "sort" | "cursor_string" | "limit"> & {Specify the Forum of the Topics, sorting options, how many Topics maximum...
Optionalforum?: number | ForumFrom which specific Forum to get the topcis from
An object with an array of relevant Forum.Topic, and a cursor_string to allow you to go further
ReadonlyreplyMake and send a Forum.Post in a Forum.Topic!
ReadonlysearchLook for a user like you would on the website!
Look for a user like you would on the website!
What you would put in the searchbar
You normally get the first 20 results, but if page is 2, you'd get results 21 to 40 instead for example! (defaults to 1)
ReadonlysearchLook for a wiki page like you would on the website!
Look for a wiki page like you would on the website!
What you would put in the searchbar
You normally get the first 50 results, but if page is 2, you'd get results 51 to 100 instead for example! (defaults to 1)
ReadonlygetGet data of a multiplayer lobby from the stable (non-lazer) client that have URLs with community/matches or mp
Get data of a multiplayer lobby from the stable (non-lazer) client that have URLs with community/matches or mp
ReadonlygetGet the info about several matches!
Get the info about several matches!
Optionalconfig: Pick<Miscellaneous.Config, "sort" | "limit"> & {The id of the first match of the array, and the sorting and size of said array
Optionalfirst_match_in_array?: number | InfoWhich match should be featured at index 0 of the returned array? Will get one with a similar id if it is unavailable
ReadonlygetGet the top countries of a specific ruleset!
Get the top countries of a specific ruleset!
ReadonlygetGet the backgrounds made and selected for this season or for last season!
Get the backgrounds made and selected for this season or for last season!
When the season ended, and for each background, its URL and its artist
ReadonlygetGet the scores on a specific item of a room!
Get the scores on a specific item of a room!
An object with the id of the item in question, as well as the id of the room
Optionalconfig: Pick<Miscellaneous.Config, "sort" | "cursor_string" | "limit">How many scores, how are they sorted, is there a cursor_string?
This will not work for rooms created before ~March 5th 2024 https://github.com/ppy/osu-web/issues/10725
This will not work for rooms created before ~March 5th 2024 https://github.com/ppy/osu-web/issues/10725
ReadonlygetGet data about a lazer multiplayer room (realtime or playlists)!
Get data about a lazer multiplayer room (realtime or playlists)!
The room or the id of the room, can be found at the end of its URL (after /multiplayer/rooms/)
ReadonlygetGet all the events about a lazer realtime room!
Get all the events about a lazer realtime room!
The room (or its id) where the events occurred
ReadonlygetGet the room stats of all the users of that room!
Get the room stats of all the users of that room!
The room or the id of the room in question
An object with the leaderboard, and the score and position of the authorized user under user_score
ReadonlygetGet playlists/realtime rooms that are active, that have ended, that the user participated in, that the user made, or just simply any room!
Get playlists/realtime rooms that are active, that have ended, that the user participated in, that the user made, or just simply any room!
Whether the multiplayer rooms are in playlist format (like current spotlights) or realtime
The state of the room, or the relation of the authorized user with the room
The maximum amount of rooms to return, defaults to 10
Sort (where most recent is first) by creation date or end date, defaults to the creation date
Optionalseason_id: numberOnly get rooms (playlists) that belong to a specific (modern) Beatmap Spotlights season id
(so 5'd be summer 2020's mania rooms, not winter 2022!!)
ReadonlygetGet a NewsPost, its content, and the NewsPosts right before and right after it!
Get a NewsPost, its content, and the NewsPosts right before and right after it!
ReadonlygetGet all the NewsPosts of a specific year!
ReadonlygetGet the replay for a score!
ReadonlygetGet information about a score!
ReadonlygetGet up to the 1000 (!!) most recent scores!
Get up to the 1000 (!!) most recent scores!
Optionalconfig: Pick<Miscellaneous.Config, "cursor_string"> & {Specify the ruleset as a filter, or use a cursor_string to get even more scores
ReadonlygetGet the rankings of a spotlight from 2009 to 2020 on a specific ruleset!
Get the rankings of a spotlight from 2009 to 2020 on a specific ruleset!
Each spotlight has a different ranking (and often maps) depending on the ruleset
The spotlight in question
What kind of players do you want to see? Keep in mind friends has no effect if no authorized user (defaults to all)
ReadonlygetGet ALL legacy spotlights! (2009-2020, somewhat known as charts/ranking charts, available @ https://osu.ppy.sh/rankings/osu/charts)
Get ALL legacy spotlights! (2009-2020, somewhat known as charts/ranking charts, available @ https://osu.ppy.sh/rankings/osu/charts)
The data for newer spotlights (2020 onwards, somewhat known as seasons) can be obtained through getRoom()
but you can't really get the id of those newer spotlights without going through the website's URLs (https://osu.ppy.sh/seasons/latest) as far as I know :(
The data for newer spotlights (2020 onwards, somewhat known as seasons) can be obtained through getRoom()
but you can't really get the id of those newer spotlights without going through the website's URLs (https://osu.ppy.sh/seasons/latest) as far as I know :(
ReadonlygetGet the ids of the beatmapsets that have been marked as favourite by the authorized user!
Get the ids of the beatmapsets that have been marked as favourite by the authorized user!
A similar method in the User namespace (API.getUserBeatmaps) exists as well
A similar method in the User namespace (API.getUserBeatmaps) exists as well
ReadonlygetGet user data of each friend of the authorized user
ReadonlygetGet the top 50 players who have the most total kudosu!
Get the top 50 players who have the most total kudosu!
ReadonlygetGet extensive user data about the authorized user
Get extensive user data about the authorized user
ReadonlygetGet extensive user data about whoever you want!
ReadonlygetGet beatmaps favourited or made by a user!
Get beatmaps favourited or made by a user!
ReadonlygetGet data about the history of a user's kudosu!
ReadonlygetGet the beatmaps most played by a user!
ReadonlygetGet the ranked beatmaps of beatmapsets that have been passed by a specific user!
Get the ranked beatmaps of beatmapsets that have been passed by a specific user!
The user who has passed the beatmaps
The Beatmapsets that contain the Beatmaps that have been passed (up to 50 Beatmapsets)
Optionalconfig: {Various filters to set on and off
Optionalconverts?: booleanShould converts be considered? (defaults to true, passing a beatmap made for the osu! Ruleset with another Ruleset instead counts)
Optionalis_legacy?: booleanShould legacy scores (scores from stable) be considered? (defaults to true, consider legacy & non-legacy)
Optionalno_diff_reduction?: booleanShould scores that used difficulty reduction mods be excluded? (defaults to true, scores with NF, EZ, and the such are excluded)
Optionalruleset?: RulesetThe Ruleset of the score (defaults to all rulesets, no filter applied)
ReadonlygetGet the top players of the game, with some filters!
Get the top players of the game, with some filters!
Self-explanatory, is also known as "Gamemode"
Rank players by their performance points or by their ranked score?
Optionalconfig: {Specify which page, country, filter out non-friends...
Optionalcountry?: stringOnly get players from a specific country, using its ISO 3166-1 alpha-2 country code! (France would be FR, United States US)
Optionalfilter?: "all" | "friends"What kind of players do you want to see? Keep in mind friends has no effect if no authorized user
Optionalpage?: numberImagine the array you get as a page, it can only have a maximum of 50 players, while 50 others may be on the next one
Optionalvariant?: "4k" | "7k"If type is performance and ruleset is mania, choose between 4k and 7k!
ReadonlygetGet an array of Events of different types that relate to a user's activity during the last 31 days! (or 100 activities, whatever comes first)
Get an array of Events of different types that relate to a user's activity during the last 31 days! (or 100 activities, whatever comes first)
ReadonlygetGet user data for up to 50 users at once!
Get user data for up to 50 users at once!
ReadonlygetGet "notable" scores from a user
Get "notable" scores from a user
The user who set the scores
Do you want scores: in the user's top 100, that are top 1 on a beatmap, that have been recently set?
Optionalruleset: RulesetThe Ruleset the scores were made in (defaults to user's default Ruleset)
Optionalinclude: { fails?: boolean; lazer?: boolean }Do you also want lazer scores and failed scores? (defaults to true for lazer & false for fails)
Optionalconfig: User.ConfigArray limit & offset
ReadonlylookupLookup user data for up to 50 users at once!
Lookup user data for up to 50 users at once!
ReadonlygetGet a wiki page!
Get a wiki page!
What's in the page's URL after https://osu.ppy.sh/wiki/ (so the title, after the subtitle if there is a subtitle)
(An example for https://osu.ppy.sh/wiki/en/Game_mode/osu! would be Game_mode/osu!)
Lowercase language tag ("fr" for french, "pt-br" for brazilian portuguese) (defaults to en)
You can create an API instance without directly providing an access_token by using API.createAsync!