sonovault 4.2.0 → 4.3.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 CHANGED
@@ -3,7 +3,7 @@
3
3
  [![CI](https://github.com/rekordcloud/sonovault-js/actions/workflows/ci.yml/badge.svg)](https://github.com/rekordcloud/sonovault-js/actions/workflows/ci.yml)
4
4
  [![npm](https://img.shields.io/npm/v/sonovault)](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.
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.2.0";
53
+ var VERSION = "4.3.0";
54
54
 
55
55
  // src/client.ts
56
56
  var SonoVault = class {
package/dist/index.d.cts CHANGED
@@ -20,8 +20,25 @@ interface TrackRelease {
20
20
  release_date: string | null;
21
21
  }
22
22
  /**
23
- * The public track shape returned by search, lookups, and resolve.
24
- * Note: audio features (BPM, key, energy, …) are not exposed on the public API.
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. */
@@ -233,7 +276,11 @@ interface IswcLookupResponse {
233
276
  type ResolveInputType = "track_name" | "isrc" | "sonovault_id" | "spotify_id" | "applemusic_id" | "tidal_id" | "beatport_id" | "discogs_id" | "musicbrainz_id";
234
277
  interface ResolveRequest {
235
278
  input_type: ResolveInputType;
236
- /** 1–100 entries. `{ artist, title }` objects for `track_name`, strings otherwise. */
279
+ /**
280
+ * 1–100 entries. `{ artist, title }` objects for `track_name`, strings otherwise.
281
+ * For `discogs_id` each string is a Discogs track key (release ID plus track
282
+ * position, e.g. `2844-A`), not a bare release ID.
283
+ */
237
284
  items: (string | {
238
285
  artist: string;
239
286
  title: string;
@@ -391,6 +438,7 @@ declare class SonoVault {
391
438
  isrc?: string;
392
439
  spotify_id?: string;
393
440
  beatport_id?: string;
441
+ /** Discogs track key: release ID plus track position, e.g. `2844-A`. A bare release ID matches nothing. */
394
442
  discogs_id?: string;
395
443
  musicbrainz_id?: string;
396
444
  applemusic_id?: string;
@@ -588,4 +636,4 @@ declare function verifyWebhookSignature(options: {
588
636
  */
589
637
  declare function paginate<T>(fetchPage: (cursor: string | undefined) => Promise<Page<T>>): AsyncGenerator<T>;
590
638
 
591
- 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 };
639
+ 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
- * The public track shape returned by search, lookups, and resolve.
24
- * Note: audio features (BPM, key, energy, …) are not exposed on the public API.
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. */
@@ -233,7 +276,11 @@ interface IswcLookupResponse {
233
276
  type ResolveInputType = "track_name" | "isrc" | "sonovault_id" | "spotify_id" | "applemusic_id" | "tidal_id" | "beatport_id" | "discogs_id" | "musicbrainz_id";
234
277
  interface ResolveRequest {
235
278
  input_type: ResolveInputType;
236
- /** 1–100 entries. `{ artist, title }` objects for `track_name`, strings otherwise. */
279
+ /**
280
+ * 1–100 entries. `{ artist, title }` objects for `track_name`, strings otherwise.
281
+ * For `discogs_id` each string is a Discogs track key (release ID plus track
282
+ * position, e.g. `2844-A`), not a bare release ID.
283
+ */
237
284
  items: (string | {
238
285
  artist: string;
239
286
  title: string;
@@ -391,6 +438,7 @@ declare class SonoVault {
391
438
  isrc?: string;
392
439
  spotify_id?: string;
393
440
  beatport_id?: string;
441
+ /** Discogs track key: release ID plus track position, e.g. `2844-A`. A bare release ID matches nothing. */
394
442
  discogs_id?: string;
395
443
  musicbrainz_id?: string;
396
444
  applemusic_id?: string;
@@ -588,4 +636,4 @@ declare function verifyWebhookSignature(options: {
588
636
  */
589
637
  declare function paginate<T>(fetchPage: (cursor: string | undefined) => Promise<Page<T>>): AsyncGenerator<T>;
590
638
 
591
- 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 };
639
+ 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.2.0";
24
+ var VERSION = "4.3.0";
25
25
 
26
26
  // src/client.ts
27
27
  var SonoVault = class {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sonovault",
3
- "version": "4.2.0",
4
- "description": "TypeScript/Node client for the SonoVault music metadata API \u2014 ISRC, ISWC, genre, labels, release dates, and cross-platform IDs for 93M+ tracks.",
3
+ "version": "4.3.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",