Skip to content

Quickstart

crate is key-first: every data endpoint needs an apiKey. The one exception is crate.index(), which is keyless — so you can get a green result before you have a key.

Terminal window
npm install @hosaka-fm/crate
import { Crate } from '@hosaka-fm/crate';
const crate = new Crate(); // no key needed for index()
const root = await crate.index(); // self-describing root: resources + recipes + error catalogue
console.log(root.resources.map((r) => r.name));
const crate = new Crate({ apiKey: process.env.CRATE_API_KEY });
const artist = await crate.artist('Four Tet'); // name | slug | cluster_id | discogs:/mbid:
console.log(artist.display, '', artist.resolved_via);

crate.artist(key) returns the full cluster-first dossier. Pass { fields: [...] } to trim it.