beastsaber-api
TypeScript icon, indicating that this package has built-in type declarations

2.2.1 • Public • Published

beastsaber-api

BeastSaber scrapping API wrapper

npm

Installation

npm install beastsaber-api

Usage

const BeastSaber = require('beastsaber-api')

const api = new BeastSaber()

const map = await api.getMapByKey("1d62f")
const map = await api.getMapById(1694841)

const maps = await api.getMaps({
    sortOrder: "new",
    page: 1,
    curatorOnly: true,
})
const maps = await api.getPlaylistMaps("alphabeats-monstercat-music-pack")
const maps = await api.getUploadedBy("smokeybacon")
const maps = await api.getBookmarkedBy("nitronikexe")
const maps = await api.getMostReviewed(/*page*/ 3)
const maps = await api.getTopUserReviewsAll()

// bookmark a map
await api.bookmarkAdd(map.id)

// advanced: set a custom request handler
// may be needed to use login operations in a browser, where a standard CORS proxy does not forward cookies
// see the built-in AxiosRequestHandler for an implementation example
api.setRequestHandler(handler)

// login
const cookies = await api.login("username", "password")

Package Sidebar

Install

npm i beastsaber-api

Weekly Downloads

9

Version

2.2.1

License

MIT

Unpacked Size

35.4 kB

Total Files

39

Last publish

Collaborators

  • kuba2k2