@hizollo/osu-api
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

@hizollo/osu-api

npm version Downloads Last Commit Code Size License

About

This library is a node.js wrapper of osu!api v1.

Documentation

You can look up the documentation here.

Installation

npm install @hizollo/osu-api
yarn add @hizollo/osu-api

Examples

Import the package:

// CommonJS
const { Client } = require('@hizollo/osu-api')

// ESM
import { Client } from '@hizollo/osu-api'

Create a client to interact with osu!api:

const osu = new Client({
    apiKey: 'your-osu-api-key'
})

Get a user's data:

const user = await osu.users.getUser({ 
    user: 'Cookiezi'
})

Get a player's top 5 play:

const bp = await osu.users.getUserBest({
    user: '214187',
    type: UserRequestType.Id,
    mode: GameMode.Catch,
    limit: 5
})

Fetch a player's banner:

// Fetch directly
const bannerURL = await osu.users.fetchBanner({
    id: '7823498'
})

// ... or if you have the user object
const bannerURL = await user.fetchBanner();

License

This package is published under the MIT license.

Readme

Keywords

Package Sidebar

Install

npm i @hizollo/osu-api

Weekly Downloads

0

Version

1.2.1

License

MIT

Unpacked Size

198 kB

Total Files

8

Last publish

Collaborators

  • zollo757347
  • kyometori