Skip to content

crate.artistOrNull(key)

artistOrNull(key: string, opts?: RequestOptions): Promise<ArtistDossierContract | null>

Like artist, but returns null for the honest-gap case (a locator or numeric id that resolves to no cluster) instead of throwing. crate is honest about absence — reach for this in pipelines and agent loops where ‘not found’ is a normal branch, not an exception to catch.

EndpointGET /api/v2/artist/{key}
Authkey
Returns`ArtistDossierContract
Retryableyes
Idempotentyes
const a = await crate.artistOrNull('discogs:999999'); // → null if unresolved
if (a) console.log(a.display);
  • CrateAPIError — on a non-2xx response.