acousticbrainz
v0.0.3
Published
wrapper package for the acousticbrainz api
Downloads
6
Readme
Acousticbrainz
Package for interacting with the Acousticbrainz API.
Installation
npm i acousticbrainz
Usage
Typescript
import { AcousticBrainz } from 'acousticbrainz'
const ab = new AcousticBrainz()
JavaScript
const { AcousticBrainz } = require('acousticbrainz')
const ab = new AcousticBrainz()
Config Options
The constructor takes an optional configuration object:
{
// Your AcousticBrainz API Key. Optional - May increase rate limits
apiKey: '',
// If true acousticbrainz will throw an error if it believes it has hit the rate limit
errorOnRateLimit: false,
// If true disable all rate limit checks
disableRateLimitCheck: false,
}
Rate Limiting
AcousticBrainz's API implements rate limiting which is communicated via headers on the API responses. This library attempts to mitigate rejected API calls caused by rate limiting by waiting until the rate limit has refreshed if it believes it has exceeded the rate limit. This is mostly untested and can be disabled via the disableRateLimitCheck
configuration option.