Package for interacting with the Acousticbrainz API.
npm i acousticbrainz
import { AcousticBrainz } from 'acousticbrainz'
const ab = new AcousticBrainz()
const { AcousticBrainz } = require('acousticbrainz')
const ab = new AcousticBrainz()
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,
}
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.