@aqilcont/osu-api-extended

Package for advanced work with 'osu' api

Usage no npm install needed!

<script type="module">
  import aqilcontOsuApiExtended from 'https://cdn.skypack.dev/@aqilcont/osu-api-extended';
</script>

README

osu-api-extended

npm npm bundle size npm NPM

Features

  • api v1
  • api v2
  • TypeScript support
  • Openable replay file

Installation

npm i @aqilcont/osu-api-extended

Usage

Links

Initialization

const { V1, V2, mods, tools } = require('osu-api-extended');
const v1 = new V1('YOUR_OSU_KEY');
//const v2 = new V2('YOUR_CLIENT_ID', 'YOUR_CLIENT_SECRET');

API v1

(async () => {
  try {
    let beatmap = await v1.beatmap({ b: 2632763 });
    console.log(beatmap.date.update);
  } catch (err) {
    console.error(err);
  }
})();

TypeScript support

https://i.imgur.com/VXKhD3q.gif

Endpoints

Api v1

v1.beatmap();

Get beatmap data

v1.best();

Get user best scores

v1.match();

Get match data

v1.recent();

Get recent user scores

v1.replay();

Download replay file of the score

v1.scores();

Get scores of user ob beatmap

v1.user();

Get user data


Tools

tools.country();

Get country name by code

tools.accuracy();

Calculate accuracy from hits

tools.diffFile();

Download beatmap file

tools.calc();

Remote pp calculation (std only)

tools.rank();

Calculate rank from hits


Mods

mods.id();

Get name of mods from id

mods.name();

Get id of mods from name