Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aturingmachine/acousticbrainz
https://github.com/aturingmachine/acousticbrainz
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/aturingmachine/acousticbrainz
- Owner: aturingmachine
- Created: 2021-09-27T04:38:40.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-09-30T03:40:00.000Z (over 3 years ago)
- Last Synced: 2024-11-21T14:06:08.064Z (about 2 months ago)
- Language: TypeScript
- Size: 228 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Acousticbrainz
Package for interacting with the [Acousticbrainz API](https://similarity.acousticbrainz.org/data).
## Installation
```sh
npm i acousticbrainz
```## Usage
### Typescript
```typescript
import { AcousticBrainz } from 'acousticbrainz'const ab = new AcousticBrainz()
```### JavaScript
```javascript
const { AcousticBrainz } = require('acousticbrainz')const ab = new AcousticBrainz()
```## Config Options
The constructor takes an optional configuration object:
```javascript
{
// 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.