Skip to content

crate.resolve(query)

resolve(query: string | ResolveQuery, opts?: RequestOptions): Promise<IdentityResolution>

Resolve any identifier to a canonical IdentityResolution. Identity is the hard problem in music data — the same artist is a Bandcamp subdomain, a Discogs id, an MBID and five spellings. This collapses any of them to crate’s single canonical cluster_id, plus every other place that artist lives online. It’s the first call in most workflows, because almost everything else is keyed on cluster_id. Accepts a bare string (inferred: URL → url, discogs:/mbid: → locator, 64-hex → cluster, else → q) or an explicit one-of object. A 200 with cluster_id: null is an honest gap, not an error.

EndpointGET /api/v2/resolve
Authkey
ReturnsIdentityResolution
Retryableyes
Idempotentyes
const id = await crate.resolve('https://fourtet.bandcamp.com');
// → { cluster_id: '9f2c…', display: 'Four Tet', resolved_from: 'url',
// locators: { discogs: 1234, bandcamp: ['fourtet'], … } }
await crate.resolve({ discogs: 1234 }); // or an explicit one-of
  • exactly_one_of — if zero/multiple identifiers are given.
  • CrateAPIError — on a non-2xx response.