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.
1. Install
Section titled “1. Install”npm install @hosaka-fm/crate2. Discover the API with zero credentials
Section titled “2. Discover the API with zero credentials”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 catalogueconsole.log(root.resources.map((r) => r.name));3. Make a keyed call
Section titled “3. Make a keyed call”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.