sonovault 4.2.1 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -1
- package/dist/index.cjs +6 -1
- package/dist/index.d.cts +53 -3
- package/dist/index.d.ts +53 -3
- package/dist/index.js +6 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://github.com/rekordcloud/sonovault-js/actions/workflows/ci.yml)
|
|
4
4
|
[](https://www.npmjs.com/package/sonovault)
|
|
5
5
|
|
|
6
|
-
TypeScript/Node client for the **[SonoVault](https://sonovault.now)** music metadata API. 93M+ tracks with ISRC, ISWC, genre, record label, canonical release dates, and cross-platform IDs for Spotify, Apple Music, Tidal, Beatport, Discogs, and MusicBrainz. One call resolves them all.
|
|
6
|
+
TypeScript/Node client for the **[SonoVault](https://sonovault.now)** music metadata API. 93M+ tracks with ISRC, ISWC, genre, BPM, musical key, record label, canonical release dates, and cross-platform IDs for Spotify, Apple Music, Tidal, Beatport, Discogs, and MusicBrainz. One call resolves them all.
|
|
7
7
|
|
|
8
8
|
- **One key, no OAuth.** A single `x-api-key` header, no approval queue.
|
|
9
9
|
- **Free tier.** 1,000 requests/month, no credit card: [get an API key](https://sonovault.now).
|
|
@@ -30,6 +30,7 @@ const sv = new SonoVault({ apiKey: process.env.SONOVAULT_API_KEY! });
|
|
|
30
30
|
const { results } = await sv.tracks.search({ artist: "Daft Punk", title: "One More Time" });
|
|
31
31
|
console.log(results[0].isrc); // "GBDUW0000053"
|
|
32
32
|
console.log(results[0].genre, results[0].releases[0]?.label?.name);
|
|
33
|
+
console.log(results[0].bpm, results[0].key_alphanumeric); // 123 "10B"
|
|
33
34
|
|
|
34
35
|
// Resolve that ISRC to its ID on every platform
|
|
35
36
|
const { links } = await sv.tracks.links({ isrc: "GBDUW0000053" });
|
|
@@ -56,6 +57,26 @@ const work = await sv.tracks.iswc({ isrc: "GBDUW0000053" });
|
|
|
56
57
|
const friday = await sv.labels.releases(1, { from: "2026-09-11", until: "2026-09-11" });
|
|
57
58
|
```
|
|
58
59
|
|
|
60
|
+
## Key and BPM
|
|
61
|
+
|
|
62
|
+
Every track (search, lookups, browse, resolve, release tracklists, stream events) carries its tempo and musical key. Key comes from OpenKeyScan and BPM from the Lexicon DJ beat detector (trusted by 100k+ DJs), both run by SonoVault on the audio.
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
const track = await sv.tracks.byIsrc("GBDUW0000053"); // Daft Punk, One More Time
|
|
66
|
+
|
|
67
|
+
track.bpm; // 123 (full tempo, up to 2 decimals)
|
|
68
|
+
track.key_alphanumeric; // "10B" (1 to 12, A = minor, B = major)
|
|
69
|
+
track.key_musical; // "D"
|
|
70
|
+
track.key_open; // "3d" (Open Key notation)
|
|
71
|
+
|
|
72
|
+
// Every key we hold, one entry per source
|
|
73
|
+
for (const k of track.keys) {
|
|
74
|
+
console.log(k.source, k.key_alphanumeric); // openkeyscan 10B
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
All of these are `null` (and `keys` is `[]`) when a track has not been analysed yet. Other audio features such as energy or danceability are not exposed.
|
|
79
|
+
|
|
59
80
|
## Bulk resolve
|
|
60
81
|
|
|
61
82
|
Resolve up to 100 lines in one request: track names, ISRCs, or platform IDs. Useful for enriching play logs and library exports.
|
|
@@ -131,6 +152,8 @@ Runnable scripts live in [`examples/`](examples/): find an ISRC, resolve cross-p
|
|
|
131
152
|
| `sv.genres` | `list` |
|
|
132
153
|
| `sv.suggestions` | `submit`, `list` |
|
|
133
154
|
| `sv.streams` | `create`, `list`, `get`, `update`, `history`, `report`, `live`, `stop` |
|
|
155
|
+
|
|
156
|
+
If a station moves to a new stream URL, `sv.streams.update(id, { url })` repoints the stream in place, keeping its id and history.
|
|
134
157
|
| `sv.webhooks` | `create`, `list`, `get`, `update`, `delete`, `test`, `deliveries` |
|
|
135
158
|
|
|
136
159
|
Some endpoints (audio identify, browse, stream monitoring) need a paid tier. See [pricing](https://sonovault.now/pricing). Everything else works on the free tier.
|
package/dist/index.cjs
CHANGED
|
@@ -50,7 +50,7 @@ var SonoVaultError = class extends Error {
|
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
// src/version.ts
|
|
53
|
-
var VERSION = "4.
|
|
53
|
+
var VERSION = "4.4.0";
|
|
54
54
|
|
|
55
55
|
// src/client.ts
|
|
56
56
|
var SonoVault = class {
|
|
@@ -130,6 +130,11 @@ var SonoVault = class {
|
|
|
130
130
|
create: (body) => this.request("/v1/streams", { method: "POST", json: body }),
|
|
131
131
|
list: () => this.request("/v1/streams"),
|
|
132
132
|
get: (id) => this.request(`/v1/streams/${id}`),
|
|
133
|
+
/**
|
|
134
|
+
* Change a stream's `url`, `format`, `detection_mode` and/or
|
|
135
|
+
* `outage_notifications`. A new `url` keeps the stream's id, history and
|
|
136
|
+
* billing. Paid tiers.
|
|
137
|
+
*/
|
|
133
138
|
update: (id, body) => this.request(`/v1/streams/${id}`, { method: "PATCH", json: body }),
|
|
134
139
|
history: (id, params = {}) => this.request(`/v1/streams/${id}/history`, { query: params }),
|
|
135
140
|
report: (params) => this.request("/v1/streams/report", { query: params }),
|
package/dist/index.d.cts
CHANGED
|
@@ -20,8 +20,25 @@ interface TrackRelease {
|
|
|
20
20
|
release_date: string | null;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
23
|
+
* Where a key estimate came from. Only `"openkeyscan"` today; more sources may
|
|
24
|
+
* be added, so treat unknown values as valid.
|
|
25
|
+
*/
|
|
26
|
+
type KeySource = "openkeyscan" | (string & {});
|
|
27
|
+
/** One musical key estimate for a track, in all three notations. */
|
|
28
|
+
interface TrackKey {
|
|
29
|
+
/** Alphanumeric key: 1 to 12 plus `A` (minor) or `B` (major), e.g. `"10B"`. */
|
|
30
|
+
key_alphanumeric: string;
|
|
31
|
+
/** Musical notation, e.g. `"D"`, `"Am"`, `"F#m"`, `"Ebm"`. */
|
|
32
|
+
key_musical: string;
|
|
33
|
+
/** Open Key notation, lowercase, e.g. `"3d"`, `"1m"`. */
|
|
34
|
+
key_open: string;
|
|
35
|
+
/** Which analyser produced this key. */
|
|
36
|
+
source: KeySource;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The public track shape returned by search, lookups, browse, resolve, and
|
|
40
|
+
* stream events. BPM and musical key are included (`bpm`, `key_*`, `keys`);
|
|
41
|
+
* other audio features such as energy or danceability are not exposed.
|
|
25
42
|
*/
|
|
26
43
|
interface Track {
|
|
27
44
|
id: number;
|
|
@@ -30,6 +47,19 @@ interface Track {
|
|
|
30
47
|
artists: TrackArtist[];
|
|
31
48
|
isrc: string | null;
|
|
32
49
|
duration: number | null;
|
|
50
|
+
/**
|
|
51
|
+
* Tempo in beats per minute, up to 2 decimals. Full tempo (174, not 87).
|
|
52
|
+
* Null when the track has not been analysed.
|
|
53
|
+
*/
|
|
54
|
+
bpm: number | null;
|
|
55
|
+
/** Alphanumeric key, e.g. `"10B"`. Null when the track has not been analysed. */
|
|
56
|
+
key_alphanumeric: string | null;
|
|
57
|
+
/** Musical key, e.g. `"D"` or `"F#m"`. Null when the track has not been analysed. */
|
|
58
|
+
key_musical: string | null;
|
|
59
|
+
/** Open Key notation, e.g. `"3d"`. Null when the track has not been analysed. */
|
|
60
|
+
key_open: string | null;
|
|
61
|
+
/** Every key we hold for the track, one per source. Empty when not analysed. */
|
|
62
|
+
keys: TrackKey[];
|
|
33
63
|
/** Canonical genres. Empty array when the track is unclassified. */
|
|
34
64
|
genre: string[];
|
|
35
65
|
/** Canonical subgenres. Empty array when none apply. */
|
|
@@ -47,6 +77,19 @@ interface ReleaseTrack {
|
|
|
47
77
|
artists: TrackArtist[];
|
|
48
78
|
isrc: string | null;
|
|
49
79
|
duration: number | null;
|
|
80
|
+
/**
|
|
81
|
+
* Tempo in beats per minute, up to 2 decimals. Full tempo (174, not 87).
|
|
82
|
+
* Null when the track has not been analysed.
|
|
83
|
+
*/
|
|
84
|
+
bpm: number | null;
|
|
85
|
+
/** Alphanumeric key, e.g. `"10B"`. Null when the track has not been analysed. */
|
|
86
|
+
key_alphanumeric: string | null;
|
|
87
|
+
/** Musical key, e.g. `"D"` or `"F#m"`. Null when the track has not been analysed. */
|
|
88
|
+
key_musical: string | null;
|
|
89
|
+
/** Open Key notation, e.g. `"3d"`. Null when the track has not been analysed. */
|
|
90
|
+
key_open: string | null;
|
|
91
|
+
/** Every key we hold for the track, one per source. Empty when not analysed. */
|
|
92
|
+
keys: TrackKey[];
|
|
50
93
|
/** Canonical genres. Empty array when the track is unclassified. */
|
|
51
94
|
genre: string[];
|
|
52
95
|
/** Canonical subgenres. Empty array when none apply. */
|
|
@@ -309,6 +352,8 @@ interface StreamStatus extends Stream {
|
|
|
309
352
|
*/
|
|
310
353
|
interface StreamUpdateResponse {
|
|
311
354
|
id: string;
|
|
355
|
+
/** The stream URL now in force, as stored (it may be normalised). */
|
|
356
|
+
url?: string;
|
|
312
357
|
format?: "electronic" | "classical" | "pop" | null;
|
|
313
358
|
detection_mode?: "precise" | "balanced" | "broad";
|
|
314
359
|
outage_notifications?: boolean;
|
|
@@ -494,6 +539,11 @@ declare class SonoVault {
|
|
|
494
539
|
streams: Stream[];
|
|
495
540
|
}>;
|
|
496
541
|
get: (id: string) => Promise<StreamStatus>;
|
|
542
|
+
/**
|
|
543
|
+
* Change a stream's `url`, `format`, `detection_mode` and/or
|
|
544
|
+
* `outage_notifications`. A new `url` keeps the stream's id, history and
|
|
545
|
+
* billing. Paid tiers.
|
|
546
|
+
*/
|
|
497
547
|
update: (id: string, body: Record<string, unknown>) => Promise<StreamUpdateResponse>;
|
|
498
548
|
history: (id: string, params?: {
|
|
499
549
|
since?: string;
|
|
@@ -593,4 +643,4 @@ declare function verifyWebhookSignature(options: {
|
|
|
593
643
|
*/
|
|
594
644
|
declare function paginate<T>(fetchPage: (cursor: string | undefined) => Promise<Page<T>>): AsyncGenerator<T>;
|
|
595
645
|
|
|
596
|
-
export { type Artist, type Genre, type IdentifyResponse, type IdentifyResult, type IswcLookupResponse, type Label, type Page, type PlatformLink, type PlatformLinksResponse, type Release, type ReleaseEdition, type ReleaseListParams, type ReleaseTrack, type ResolveInputType, type ResolveRequest, type ResolveResponse, type ResolveResult, SonoVault, SonoVaultError, type SonoVaultOptions, type Stream, type StreamEvent, type StreamStatus, type StreamUpdateResponse, type Track, type TrackArtist, type TrackRelease, type Webhook, paginate, verifyWebhookSignature };
|
|
646
|
+
export { type Artist, type Genre, type IdentifyResponse, type IdentifyResult, type IswcLookupResponse, type KeySource, type Label, type Page, type PlatformLink, type PlatformLinksResponse, type Release, type ReleaseEdition, type ReleaseListParams, type ReleaseTrack, type ResolveInputType, type ResolveRequest, type ResolveResponse, type ResolveResult, SonoVault, SonoVaultError, type SonoVaultOptions, type Stream, type StreamEvent, type StreamStatus, type StreamUpdateResponse, type Track, type TrackArtist, type TrackKey, type TrackRelease, type Webhook, paginate, verifyWebhookSignature };
|
package/dist/index.d.ts
CHANGED
|
@@ -20,8 +20,25 @@ interface TrackRelease {
|
|
|
20
20
|
release_date: string | null;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
23
|
+
* Where a key estimate came from. Only `"openkeyscan"` today; more sources may
|
|
24
|
+
* be added, so treat unknown values as valid.
|
|
25
|
+
*/
|
|
26
|
+
type KeySource = "openkeyscan" | (string & {});
|
|
27
|
+
/** One musical key estimate for a track, in all three notations. */
|
|
28
|
+
interface TrackKey {
|
|
29
|
+
/** Alphanumeric key: 1 to 12 plus `A` (minor) or `B` (major), e.g. `"10B"`. */
|
|
30
|
+
key_alphanumeric: string;
|
|
31
|
+
/** Musical notation, e.g. `"D"`, `"Am"`, `"F#m"`, `"Ebm"`. */
|
|
32
|
+
key_musical: string;
|
|
33
|
+
/** Open Key notation, lowercase, e.g. `"3d"`, `"1m"`. */
|
|
34
|
+
key_open: string;
|
|
35
|
+
/** Which analyser produced this key. */
|
|
36
|
+
source: KeySource;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The public track shape returned by search, lookups, browse, resolve, and
|
|
40
|
+
* stream events. BPM and musical key are included (`bpm`, `key_*`, `keys`);
|
|
41
|
+
* other audio features such as energy or danceability are not exposed.
|
|
25
42
|
*/
|
|
26
43
|
interface Track {
|
|
27
44
|
id: number;
|
|
@@ -30,6 +47,19 @@ interface Track {
|
|
|
30
47
|
artists: TrackArtist[];
|
|
31
48
|
isrc: string | null;
|
|
32
49
|
duration: number | null;
|
|
50
|
+
/**
|
|
51
|
+
* Tempo in beats per minute, up to 2 decimals. Full tempo (174, not 87).
|
|
52
|
+
* Null when the track has not been analysed.
|
|
53
|
+
*/
|
|
54
|
+
bpm: number | null;
|
|
55
|
+
/** Alphanumeric key, e.g. `"10B"`. Null when the track has not been analysed. */
|
|
56
|
+
key_alphanumeric: string | null;
|
|
57
|
+
/** Musical key, e.g. `"D"` or `"F#m"`. Null when the track has not been analysed. */
|
|
58
|
+
key_musical: string | null;
|
|
59
|
+
/** Open Key notation, e.g. `"3d"`. Null when the track has not been analysed. */
|
|
60
|
+
key_open: string | null;
|
|
61
|
+
/** Every key we hold for the track, one per source. Empty when not analysed. */
|
|
62
|
+
keys: TrackKey[];
|
|
33
63
|
/** Canonical genres. Empty array when the track is unclassified. */
|
|
34
64
|
genre: string[];
|
|
35
65
|
/** Canonical subgenres. Empty array when none apply. */
|
|
@@ -47,6 +77,19 @@ interface ReleaseTrack {
|
|
|
47
77
|
artists: TrackArtist[];
|
|
48
78
|
isrc: string | null;
|
|
49
79
|
duration: number | null;
|
|
80
|
+
/**
|
|
81
|
+
* Tempo in beats per minute, up to 2 decimals. Full tempo (174, not 87).
|
|
82
|
+
* Null when the track has not been analysed.
|
|
83
|
+
*/
|
|
84
|
+
bpm: number | null;
|
|
85
|
+
/** Alphanumeric key, e.g. `"10B"`. Null when the track has not been analysed. */
|
|
86
|
+
key_alphanumeric: string | null;
|
|
87
|
+
/** Musical key, e.g. `"D"` or `"F#m"`. Null when the track has not been analysed. */
|
|
88
|
+
key_musical: string | null;
|
|
89
|
+
/** Open Key notation, e.g. `"3d"`. Null when the track has not been analysed. */
|
|
90
|
+
key_open: string | null;
|
|
91
|
+
/** Every key we hold for the track, one per source. Empty when not analysed. */
|
|
92
|
+
keys: TrackKey[];
|
|
50
93
|
/** Canonical genres. Empty array when the track is unclassified. */
|
|
51
94
|
genre: string[];
|
|
52
95
|
/** Canonical subgenres. Empty array when none apply. */
|
|
@@ -309,6 +352,8 @@ interface StreamStatus extends Stream {
|
|
|
309
352
|
*/
|
|
310
353
|
interface StreamUpdateResponse {
|
|
311
354
|
id: string;
|
|
355
|
+
/** The stream URL now in force, as stored (it may be normalised). */
|
|
356
|
+
url?: string;
|
|
312
357
|
format?: "electronic" | "classical" | "pop" | null;
|
|
313
358
|
detection_mode?: "precise" | "balanced" | "broad";
|
|
314
359
|
outage_notifications?: boolean;
|
|
@@ -494,6 +539,11 @@ declare class SonoVault {
|
|
|
494
539
|
streams: Stream[];
|
|
495
540
|
}>;
|
|
496
541
|
get: (id: string) => Promise<StreamStatus>;
|
|
542
|
+
/**
|
|
543
|
+
* Change a stream's `url`, `format`, `detection_mode` and/or
|
|
544
|
+
* `outage_notifications`. A new `url` keeps the stream's id, history and
|
|
545
|
+
* billing. Paid tiers.
|
|
546
|
+
*/
|
|
497
547
|
update: (id: string, body: Record<string, unknown>) => Promise<StreamUpdateResponse>;
|
|
498
548
|
history: (id: string, params?: {
|
|
499
549
|
since?: string;
|
|
@@ -593,4 +643,4 @@ declare function verifyWebhookSignature(options: {
|
|
|
593
643
|
*/
|
|
594
644
|
declare function paginate<T>(fetchPage: (cursor: string | undefined) => Promise<Page<T>>): AsyncGenerator<T>;
|
|
595
645
|
|
|
596
|
-
export { type Artist, type Genre, type IdentifyResponse, type IdentifyResult, type IswcLookupResponse, type Label, type Page, type PlatformLink, type PlatformLinksResponse, type Release, type ReleaseEdition, type ReleaseListParams, type ReleaseTrack, type ResolveInputType, type ResolveRequest, type ResolveResponse, type ResolveResult, SonoVault, SonoVaultError, type SonoVaultOptions, type Stream, type StreamEvent, type StreamStatus, type StreamUpdateResponse, type Track, type TrackArtist, type TrackRelease, type Webhook, paginate, verifyWebhookSignature };
|
|
646
|
+
export { type Artist, type Genre, type IdentifyResponse, type IdentifyResult, type IswcLookupResponse, type KeySource, type Label, type Page, type PlatformLink, type PlatformLinksResponse, type Release, type ReleaseEdition, type ReleaseListParams, type ReleaseTrack, type ResolveInputType, type ResolveRequest, type ResolveResponse, type ResolveResult, SonoVault, SonoVaultError, type SonoVaultOptions, type Stream, type StreamEvent, type StreamStatus, type StreamUpdateResponse, type Track, type TrackArtist, type TrackKey, type TrackRelease, type Webhook, paginate, verifyWebhookSignature };
|
package/dist/index.js
CHANGED
|
@@ -21,7 +21,7 @@ var SonoVaultError = class extends Error {
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
// src/version.ts
|
|
24
|
-
var VERSION = "4.
|
|
24
|
+
var VERSION = "4.4.0";
|
|
25
25
|
|
|
26
26
|
// src/client.ts
|
|
27
27
|
var SonoVault = class {
|
|
@@ -101,6 +101,11 @@ var SonoVault = class {
|
|
|
101
101
|
create: (body) => this.request("/v1/streams", { method: "POST", json: body }),
|
|
102
102
|
list: () => this.request("/v1/streams"),
|
|
103
103
|
get: (id) => this.request(`/v1/streams/${id}`),
|
|
104
|
+
/**
|
|
105
|
+
* Change a stream's `url`, `format`, `detection_mode` and/or
|
|
106
|
+
* `outage_notifications`. A new `url` keeps the stream's id, history and
|
|
107
|
+
* billing. Paid tiers.
|
|
108
|
+
*/
|
|
104
109
|
update: (id, body) => this.request(`/v1/streams/${id}`, { method: "PATCH", json: body }),
|
|
105
110
|
history: (id, params = {}) => this.request(`/v1/streams/${id}/history`, { query: params }),
|
|
106
111
|
report: (params) => this.request("/v1/streams/report", { query: params }),
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sonovault",
|
|
3
|
-
"version": "4.
|
|
4
|
-
"description": "TypeScript/Node client for the SonoVault music metadata API
|
|
3
|
+
"version": "4.4.0",
|
|
4
|
+
"description": "TypeScript/Node client for the SonoVault music metadata API: ISRC, ISWC, genre, BPM, key, labels, release dates, and cross-platform IDs for 93M+ tracks.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"music",
|
|
7
7
|
"metadata",
|