https://github.com/hizollo/osu-api
A Node.js library for interacting with osu!api, written in TypeScript.
https://github.com/hizollo/osu-api
osu osu-api typescript
Last synced: 4 months ago
JSON representation
A Node.js library for interacting with osu!api, written in TypeScript.
- Host: GitHub
- URL: https://github.com/hizollo/osu-api
- Owner: HiZollo
- License: mit
- Created: 2022-08-04T06:56:37.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-12-17T16:14:08.000Z (over 3 years ago)
- Last Synced: 2025-06-16T17:06:08.172Z (about 1 year ago)
- Topics: osu, osu-api, typescript
- Language: TypeScript
- Homepage: https://hizollo.github.io/osu-api/
- Size: 622 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @hizollo/osu-api
[](https://www.npmjs.com/package/@hizollo/osu-api)
[](https://www.npmjs.com/package/@hizollo/osu-api)
[](https://github.com/HiZollo/osu-api)
[](https://github.com/HiZollo/osu-api)

## About
This library is a node.js wrapper of [osu!api](https://osu.ppy.sh/wiki/en/osu!api) v1.
## Documentation
You can look up the documentation [here](https://hizollo.github.io/osu-api).
## Installation
```
npm install @hizollo/osu-api
yarn add @hizollo/osu-api
```
## Examples
Import the package:
```ts
// CommonJS
const { Client } = require('@hizollo/osu-api')
// ESM
import { Client } from '@hizollo/osu-api'
```
Create a client to interact with [osu!api](https://osu.ppy.sh/wiki/en/osu!api):
```ts
const osu = new Client({
apiKey: 'your-osu-api-key'
})
```
Get a user's data:
```ts
const user = await osu.users.getUser({
user: 'Cookiezi'
})
```
Get a player's top 5 play:
```ts
const bp = await osu.users.getUserBest({
user: '214187',
type: UserRequestType.Id,
mode: GameMode.Catch,
limit: 5
})
```
Fetch a player's banner:
```ts
// 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.