1.1.1 • Published 6 months ago
yabsl v1.1.1
yabsl
Yet another Beat Saber library. A wrapper for all major Beat Saber services.
Installation
npm i yabsl
# or
yarn add yabsl
Usage
CommonJS import
const yabsl = require('yabsl');
const beatsaver = yabsl.BeatSaver
OR
const { BeatSaver } = require('yabsl');
ES6 import
import yabsl from 'yabsl';
const beatsaver = yabsl.BeatSaver
OR
import { BeatSaver } from 'yabsl';
Using the wrapper
import { BeatSaver } from 'yabsl';
async function someFunction() {
const maps = await BeatSaver.maps.search("Latest", "Camellia", 0, {
verified: true
});
// Returns an array of maps fitting the search criteria
}
The library is fully typed so all of the objects and functions will display what they need/have.
Yabsl is compatible with both JavaScript and TypeScript
Roadmap
- BeatLeader support
- Full AccSaber support
All yabsl functions
BeatSaver
Usable functions
Maps:
id
- Get a map by it's idhash
- Get a map by it's hashmultiple
- Get multiple maps by id (eg. '1', '2', '3')uploader
- Get maps by uploadercollaborations
- Get maps by uploader including collaborationslatest
- Get the latest mapssearch
- Search for the maps, more options explained later.
Playlists:
id
- Get a playlist by iduser
- Get playlists made by a userlatest
- Get the latest playlistssearch
- Search for the playlists, more options explained later.
Users:
id
- Get a user by their idname
- Get a user by their name
Votes:
get
- Get all the votes from a specific date onward
Options
ALL OPTIONS ARE OPTIONAL!!!
Map search options:
Option | Type |
---|---|
automapper | boolean |
chroma | boolean |
cinema | boolean |
curated | boolean |
from | string (date) |
fullSpread | boolean |
maxBpm | number |
maxDuration | number |
maxNps | number |
maxRating | number |
minBpm | number |
minDuration | number |
minNps | number |
minRating | number |
noodle | boolean |
tags | string[] |
to | string (date) |
verified | boolean |
Playlist search options:
Option | Type |
---|---|
curated | boolean |
from | string (date) |
includeEmpty | boolean |
maxNps | number |
minNps | number |
to | string (date) |
verified | boolean |
BeatLeader
Usable functions
Leaderboards:
id
- Get a leaderboard by it's id, more options explained laterclanRanking
- Get the clean ranking on a leaderboardclanRankingGlobal
- Get the clan ranking on all leaderboardshash
- Get the leaderboard by hashget
- Get leaderboards by your query options, more options explained latergetGruoped
- Same as above but groupedranking
- Get the ranking of a certain mapstatistic
- Get the statistics of a certain leaderboard
Players:
id
- Get the player by their iddiscord
- Get the player by their discord idbeatsaver
- Get the player by their beatsaver idget
- Get multiple players by your query, more options explained laterevent
- Get the event by it's id, more options explained later
Scores:
get
- Get the scores of a player, more options explained latergetCompact
- Get the scores of a player but it's compact now, same options asget
getValue
- Get the score value of a player on a certain maphistogram
- Get the histogram of a player, options the same asget
with the addedbatch
propertyaccGraph
- Get the accuracy graph of a playerhistory
- Get the history of a playergetPinnedScores
- Get the pinned scores of a player
Clans:
get
- Get the clans according to your query, more options explained latertag
- Get the clan according to your tag, more options explained later
Playlists:
get
- Get all the playlistsid
- Get the playlist data according to it's idimage
- Get the playlist image as a buffer or download it
Events:
get
- Get the events according to your query, more options explained laterid
- Get an event by it's id
Options
ALL OPTIONS ARE OPTIONAL!!!
Leaderboards id options:
Option | Type |
---|---|
page | number |
count | number |
sortBy | string |
order | number |
scoreStatus | number |
leaderboardContext | number |
countries | string |
search | string |
modifiers | string |
Leaderboard get and getGroupped options:
Option | Type |
---|---|
page | number |
count | number |
sortBy | number |
order | number |
search | string |
type | number |
mode | string |
mapType | number |
allTypes | number |
mapRequirements | number |
allRequirements | number |
myType | number |
stars_from | string |
stars_to | string |
accrating_from | number |
accrating_to | number |
passrating_from | number |
passrating_to | number |
techrating_from | number |
techrating_to | number |
date_from | number |
date_to | number |
Players get options:
Option | Type |
---|---|
sortBy | string |
page | number |
count | number |
search | string |
order | number |
countries | string |
mapTypes | string |
ppType | string |
leaderboardContext | number |
pp_range | string |
score_range | string |
platform | string |
role | string |
hmd | string |
clans | string |
activityPeriod | number |
banned | boolean |
Player events options:
Option | Type |
---|---|
sortBy | string |
page | number |
count | number |
search | string |
order | number |
countries | string |
Scores get options:
Option | Type |
---|---|
sortBy | string |
order | number |
page | number |
count | number |
search | string |
diff | string |
mode | string |
requirements | number |
scoreStatus | number |
leaderboardContext | number |
type | string |
modifiers | string |
stars_from | number |
stars_to | number |
time_from | number |
time_to | number |
eventId | number |
Clans get options:
Option | Type |
---|---|
page | number |
count | number |
search | string |
sort | string |
order | number |
type | string |
sortBy | string |
Clan tag options:
Option | Type |
---|---|
page | number |
count | number |
search | string |
sort | string |
order | number |
capturedLeaderboards | string |
Events get options:
Option | Type |
---|---|
page | number |
count | number |
sortBy | string |
search | string |
order | number |
ScoreSaber
Usable functions
Leaderboards:
get
- Get leaderboards by a text query, more options explained laterid
- Get a leaderboard by it's idinfoByHash
- Get a leaderboard by a song's hash and difficultyscoresById
- Get the scores on a leaderboard by it's idscoresByHash
- Get the scores by the songs's hash and difficulty, more options explained latergetDifficulties
- Get the difficulties of a map by it's hash
Players:
get
- Get the players by querying their namecount
- Returns the amount of players by your querybasic
- Get the basic info of a player with their IDfull
- Get the full info of a player with their IDscores
- Get the player's scores by their id
Rankings:
id
- Get a ranking request by it's IDleaderboardId
- Get a ranking request by it's leaderboard ID
Options
ALL OPTIONS ARE OPTIONAL!!!
Leadearboards get options:
Option | Type |
---|---|
ranked | boolean |
qualified | boolean |
loved | boolean |
minStar | number |
maxStar | number |
category | number |
sort | number |
unique | boolean |
withMetadata | boolean |
Scores by hash options:
Option | Type |
---|---|
countries | string[] |
search | string |
withMetadata | boolean |
Hitbloq
Usable functions
Ladders:
get
- Get the ladder for a certain pool IDnear
- Get the players near the player of the pool ID
Pools:
get
- Get the pool namesdetailed
- Get the pools but with more informationpopular
- Get the names of all the popular pools
Ranked:
id
- Get the pool information + the first 30 ranked mapsmaps
- Get the ranked maps from a pool
Users:
scores
- Get a few scores from a user on a certain poolallScores
- Get all the scores from a user on a certain poolbadges
- Get the list of badges that a user has
AccSaber
Leaderboards:
overallAcc
- Get all the players on the leaderboard for overall accuracytechAcc
- Get all the players on the leaderboard for tech accuracytrueAcc
- Get all the players on the leaderboard for true accuracystandardAcc
- Get all the players on the leaderboard for standard accuracy
Players:
get
- Get all the players on AccSaberid
- Get a certain player and choose which category to look up their stats for
Maps:
get
- Get all ranked mapsid
- Get the map with a certain leaderboard idcategory
- Get all ranked maps of a certain categoryplaylist
- Get or download a playlist of all ranked maps