-
Notifications
You must be signed in to change notification settings - Fork 16
v2.beatmaps.packs.list_v3
ck edited this page Oct 6, 2024
·
2 revisions
async
Retrieves a list of all available beatmap packs.
const { auth, v2 } = require('osu-api-extended');
async function main() {
try {
await auth.login({
type: 'v2',
client_id: CLIENT_ID,
client_secret: CLIENT_SECRET,
cachedTokenPath: './test.json' // path to the file your auth token will be saved (to prevent osu!api spam)
});
const result = await v2.beatmaps.packs.list({
type: 'loved'
});
if (result.error != null) {
console.log(result.error);
return;
};
console.log(result);
} catch (error) {
console.log(error);
};
};
main();
Parameter | Type | Description |
---|---|---|
params.type | 'standard' or 'featured' or 'tournament' or 'loved' or 'chart' or 'theme' or 'artist' | |
params.cursor_string? | string | |
addons.legacy_only? | boolean | |
addons.apiVersion? | '20240130' | '99999999' |
addons.authKey? | string | |
addons.timeout_ms? | number | |
addons.ignoreSessionRefresh? | boolean |
export interface BeatmapsPacksListResponse {
beatmap_packs: BeatmapPack[]
cursor: Cursor
cursor_string: string
}
export interface BeatmapPack {
author: string
date: string
name: string
no_diff_reduction: boolean
ruleset_id?: number
tag: string
url: string
}
export interface Cursor {
pack_id: number
}