This library is a node.js wrapper of osu!api v1.
You can look up the documentation here.
npm install @hizollo/osu-api
yarn add @hizollo/osu-api
Import the package:
// CommonJSconst{ Client }=require('@hizollo/osu-api')// ESMimport{Client}from'@hizollo/osu-api'Create a client to interact with osu!api:
constosu=newClient({apiKey: 'your-osu-api-key'})Get a user's data:
constuser=awaitosu.users.getUser({user: 'Cookiezi'})Get a player's top 5 play:
constbp=awaitosu.users.getUserBest({user: '214187',type: UserRequestType.Id,mode: GameMode.Catch,limit: 5})Fetch a player's banner:
// Fetch directlyconstbannerURL=awaitosu.users.fetchBanner({id: '7823498'})// ... or if you have the user objectconstbannerURL=awaituser.fetchBanner();This package is published under the MIT license.