Composed adjacency evidence for one artist — movements, not scores
const url = 'https://crate.hosaka.fm/api/v2/artist/example/similar';const options = {method: 'GET', headers: {'X-API-Key': '<X-API-Key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://crate.hosaka.fm/api/v2/artist/example/similar \ --header 'X-API-Key: <X-API-Key>'Cycle-112 + cycle-113 — one call returning adjacency EVIDENCE grouped per axis, for suggestion/recommendation consumers (the Public Office Listen shape). NO composite similarity score exists anywhere on this surface: each axis carries its substrate’s own counts + recency VERBATIM and the consumer ranks; similar[] order is a deterministic presentation convention (axis breadth → most recent evidence → key), never a ranking. EIGHT axes. co_appearance (seen.artist_co_appearance public co-booking edges — the SAME substrate as the dossier’s connections.related, so this endpoint gives one-call parity with related[] plus the other axes). radio_co_play (seen.radio_co_play — programmed adjacency within 5 positions in the same radio set, NOT whole-show membership; artists in >1000 sets carry no edges, the HUB_CAP). shared_dj_champions (seen.dj_champion 2-hop: DJs championing the subject who also champion the suggested artist; attribution-bounded per source — kexp 100% DJ names, skylab 0). lineage (mirror.cluster_derivation_edges_v1 — the MusicBrainz derivation graph at CLUSTER grain: samples/remixes/edits/dj-mixes/mashups at recording level, versions/adaptations/arrangements/medleys/quotations at composition level. Endpoints resolve at BILLING grain, so read as graph participation, never authorship — MB credits a remix to the ORIGINAL billed artist; direction ‘derived’ = the subject’s work derives from the suggested artist’s, ‘source’ = the reverse). session_credit (mirror.session_credit_edges_v1 — 5.86M undirected co-credit edges: shared recordings, shared works, and allowlisted direct MusicBrainz artist relations. COUNTS ONLY upstream; edgeWeight is the producer’s own total support, NOT a similarity. relationTypes is empty and firstYear/lastYear are null on the current producer refresh). label_mates (mirror.artist_label_tenure_v1 — shared label rosters on the cluster spine, with each label’s rosterSize served BECAUSE a large roster is a weak adjacency. ROSTER FAMILIES ONLY: the six ’… position at’ relations are label EMPLOYMENT and are excluded. Coverage is double-gated and reaches ~0.73% of clusters, so absence is the norm, not a claim. No label name — the identity surface is the artist spine and carries none). influence (mirror.influence_edges_v1 — Wikidata P737 ‘influenced by’, DIRECT edges only; transitive depth-2 chains are excluded. A sparse crowd-curated canonical layer). attention_flow (mirror.attention_flow_edges_v1 — Wikimedia Clickstream navigation, direction FROM→TO and NOT symmetric; carries the upstream n>=10 suppression floor, so a missing edge means below-floor or not Wikipedia-resolvable, never zero navigation. Attention flows to band members and side projects first). CROSS-AXIS: cluster identity is keyed on the NORMALISED ARTIST NAME (pe-norm-v1), so an alias or legal name is a DIFFERENT cluster and can appear as its own adjacency; session_credit and lineage are CREDIT graphs, so engineers and producers appear wherever MusicBrainz credits them; the seen-sourced axes carry an ARRIVAL LATENCY of up to ~7 days for a newly observed artist (weekly Sunday cluster fill) even though existing rows refresh nightly. Per-axis cap 10; artists appearing on multiple axes are DEDUPED with all their axes[] listed. Fail-soft per axis: a failed leg degrades ONLY its axisState (response stays 200); state:‘degraded’ means ≥1 axis could not be read. {key} = 64-hex cluster_id (canonical) or a name slug; the endpoint is CLUSTER-KEYED — a subject resolving without a cluster anchor returns an honest empty with a /resolve pointer, never a guess. Member names hydrate from mirror.cluster_identity_v1; a member outside that surface keeps name:null. Keyed (X-API-Key); ONE crate_reader checkout.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Header Parameters
Section titled “Header Parameters ”Optional. A partner fronting many end users with one key names the end user this call is made for (an opaque, stable id of YOUR choosing: 1–128 chars of [A-Za-z0-9._:@-]). The key stays the customer; the profile becomes a metering dimension — usage rolls up per profile (GET /api/v2/me/usage?profile=
Responses
Section titled “ Responses ”Adjacency evidence grouped per axis (deduped artists, axes[] each), or an honest empty when the subject has no cluster anchor
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
Example
{ "object": "artist.similar", "state": "ok", "axisStates": { "co_appearance": "ok", "radio_co_play": "ok", "shared_dj_champions": "ok", "lineage": "ok", "session_credit": "ok", "label_mates": "ok", "influence": "ok", "attention_flow": "ok" }, "similar": [ { "axes": [ { "axis": "co_appearance" } ] } ]}Headers
Section titled “Headers ”Requests allowed in the current window.
Requests remaining in the current window.
Unix epoch (seconds) when the current window resets.
The tier’s included monthly 2xx allowance.
Included allowance minus the requests gated this month — an UPPER BOUND on billable 2xx (errors are counted at the gate but never billed; /api/v2/me/usage is the billable truth). 0 once the included bucket is spent (overage, where enabled, is flagged by X-Overage).
Unix epoch (seconds) of the next UTC month start, when the monthly counter resets.
Validation failure (invalid query, malformed body, bad facet name)
The error envelope for all 4xx/5xx responses. error is the only guaranteed field — branch on it, never on HTTP status alone. An unresolved/empty lookup is NOT an error: it returns HTTP 200 with present:false / a null field / state:"honest_gap".
| code | HTTP | when thrown | fix |
|---|---|---|---|
invalid_artist_key | 400 | /artist/{key} key is not a 64-hex cluster_id, discogs:<id>, or mbid:<uuid> | resolve by name first: GET /api/v2/resolve?q=<name>, then call /artist/{cluster_id} |
use_resolve_for_locator | 400 | /artist/{key} given a discogs:/mbid: locator (not a canonical address) | GET /api/v2/resolve?discogs=<id> (or ?mbid=), then use the returned cluster_id (the response next field is the ready-to-call URL) |
invalid_label_key | 400 | /label/{key} key is not a 64-hex label_cluster_id or name-slug (e.g. a discogs:/mbid: locator — not resolvable for labels yet) | address a label by its 64-hex label_cluster_id or its name-slug (e.g. /api/v2/label/warp) |
invalid_fields | 400 | /artist/{key}?fields= lists a facet that is not a valid top-level dossier field | use only the fields in the response valid set; omit ?fields= entirely for the full dossier (see the example field) |
missing_locator | 400 | /resolve called with none of q/cluster/discogs/mbid | pass exactly one locator |
invalid_locator | 400 | a /resolve locator is malformed for its type | fix the format, or fall back to ?q=<name> |
invalid_query | 400 | /search ?q= missing/empty, or any Zod validation failure (details[] attached) | pass ?q=<text>; fix each details entry |
invalid_facet | 400 | an unknown facet filter name was supplied | GET /api/v2/facets for valid names + values |
invalid_range | 400 | /me/usage ?from/?to is not an ISO day (YYYY-MM-DD), to is before from, or the span exceeds 62 days | omit both for the current month to date, or page one calendar month per call (the hint names the exact fix) |
invalid_on_behalf_of | 400 | X-On-Behalf-Of (or /me/usage?profile=, /me/profiles/{profile_id}) is not 1–128 chars of [A-Za-z0-9._:@-] | fix the id, or omit the header to meter the key as one principal |
invalid_cursor | 400 | /search ?after= is malformed, tampered, or was minted for a different query (q/filters changed) | pass pagination.next_cursor from the previous page of the SAME query unchanged; drop after to restart |
rate_limited | 429 | an IP/key/tier rate, monthly quota, or concurrency cap was exceeded (retry_after_seconds + Retry-After + X-RateLimit-* set; a monthly-quota stop also carries X-Quota-Remaining: 0 + X-Quota-Reset) | back off retry_after_seconds (or until X-RateLimit-Reset), then retry |
pool_exhausted | 503 | the database pool could not hand out a connection within the acquire timeout (Retry-After: 5) | retry after 5 s |
query_timeout | 503 | a statement was cancelled by crate’s own budget (statement_timeout; Retry-After: 30) — capacity, not a gateway timeout; during the upstream database’s daily 04–07Z stall this is transient, for very broad /search ?q= (single common words) it recurs | retry after 30 s; narrow a broad ?q= with filters |
request_aborted | 504 | the 15 s request deadline passed before the response was assembled (a statement the deadline cancelled mid-flight answers this code, not query_timeout) | retry later; on the artist dossier, request fewer ?fields= |
internal | 500 | an unexpected error (logged server-side) | retry once; report if it persists |
object
Machine-readable error code (stable lowercase snake_case). The ONLY field guaranteed on every error body — switch on it programmatically, never on HTTP status alone (several codes share a status). See the code table in this schema’s description.
One-sentence human-readable statement of WHAT is wrong (developer-facing). Present only for catalogued codes. Describes the violated rule — not a fix (see hint/next).
Actionable remediation in human terms — what to DO next, often naming the exact endpoint (a template with next.
Deep link to this code’s docs: https://crate.hosaka.fm/docs/api#error-. Auto-populated for catalogued codes.
The specific request parameter that caused the failure (e.g. “key”, “q”), so a client can point at the offending input. Present only when the code declares one.
A copy-pasteable, fully-formed corrected call (a concrete URL, NOT a template) an agent can fire verbatim to recover — the machine-actionable counterpart to hint. Present only when a handler supplies one.
Structured validation breakdown — on Zod 400s (invalid_query), an array of { path, message }, one per failed field. Present only when validation specifics are attached.
On a 429 rate_limited response, seconds to wait before retrying (mirrors the Retry-After header). Sleep at least this long, then re-issue the identical request.
Echoed on master_not_found (404) — the master id that did not resolve.
Example
{ "error": "invalid_query"}Authentication failure
The error envelope for all 4xx/5xx responses. error is the only guaranteed field — branch on it, never on HTTP status alone. An unresolved/empty lookup is NOT an error: it returns HTTP 200 with present:false / a null field / state:"honest_gap".
| code | HTTP | when thrown | fix |
|---|---|---|---|
invalid_artist_key | 400 | /artist/{key} key is not a 64-hex cluster_id, discogs:<id>, or mbid:<uuid> | resolve by name first: GET /api/v2/resolve?q=<name>, then call /artist/{cluster_id} |
use_resolve_for_locator | 400 | /artist/{key} given a discogs:/mbid: locator (not a canonical address) | GET /api/v2/resolve?discogs=<id> (or ?mbid=), then use the returned cluster_id (the response next field is the ready-to-call URL) |
invalid_label_key | 400 | /label/{key} key is not a 64-hex label_cluster_id or name-slug (e.g. a discogs:/mbid: locator — not resolvable for labels yet) | address a label by its 64-hex label_cluster_id or its name-slug (e.g. /api/v2/label/warp) |
invalid_fields | 400 | /artist/{key}?fields= lists a facet that is not a valid top-level dossier field | use only the fields in the response valid set; omit ?fields= entirely for the full dossier (see the example field) |
missing_locator | 400 | /resolve called with none of q/cluster/discogs/mbid | pass exactly one locator |
invalid_locator | 400 | a /resolve locator is malformed for its type | fix the format, or fall back to ?q=<name> |
invalid_query | 400 | /search ?q= missing/empty, or any Zod validation failure (details[] attached) | pass ?q=<text>; fix each details entry |
invalid_facet | 400 | an unknown facet filter name was supplied | GET /api/v2/facets for valid names + values |
invalid_range | 400 | /me/usage ?from/?to is not an ISO day (YYYY-MM-DD), to is before from, or the span exceeds 62 days | omit both for the current month to date, or page one calendar month per call (the hint names the exact fix) |
invalid_on_behalf_of | 400 | X-On-Behalf-Of (or /me/usage?profile=, /me/profiles/{profile_id}) is not 1–128 chars of [A-Za-z0-9._:@-] | fix the id, or omit the header to meter the key as one principal |
invalid_cursor | 400 | /search ?after= is malformed, tampered, or was minted for a different query (q/filters changed) | pass pagination.next_cursor from the previous page of the SAME query unchanged; drop after to restart |
rate_limited | 429 | an IP/key/tier rate, monthly quota, or concurrency cap was exceeded (retry_after_seconds + Retry-After + X-RateLimit-* set; a monthly-quota stop also carries X-Quota-Remaining: 0 + X-Quota-Reset) | back off retry_after_seconds (or until X-RateLimit-Reset), then retry |
pool_exhausted | 503 | the database pool could not hand out a connection within the acquire timeout (Retry-After: 5) | retry after 5 s |
query_timeout | 503 | a statement was cancelled by crate’s own budget (statement_timeout; Retry-After: 30) — capacity, not a gateway timeout; during the upstream database’s daily 04–07Z stall this is transient, for very broad /search ?q= (single common words) it recurs | retry after 30 s; narrow a broad ?q= with filters |
request_aborted | 504 | the 15 s request deadline passed before the response was assembled (a statement the deadline cancelled mid-flight answers this code, not query_timeout) | retry later; on the artist dossier, request fewer ?fields= |
internal | 500 | an unexpected error (logged server-side) | retry once; report if it persists |
object
Machine-readable error code (stable lowercase snake_case). The ONLY field guaranteed on every error body — switch on it programmatically, never on HTTP status alone (several codes share a status). See the code table in this schema’s description.
One-sentence human-readable statement of WHAT is wrong (developer-facing). Present only for catalogued codes. Describes the violated rule — not a fix (see hint/next).
Actionable remediation in human terms — what to DO next, often naming the exact endpoint (a template with next.
Deep link to this code’s docs: https://crate.hosaka.fm/docs/api#error-. Auto-populated for catalogued codes.
The specific request parameter that caused the failure (e.g. “key”, “q”), so a client can point at the offending input. Present only when the code declares one.
A copy-pasteable, fully-formed corrected call (a concrete URL, NOT a template) an agent can fire verbatim to recover — the machine-actionable counterpart to hint. Present only when a handler supplies one.
Structured validation breakdown — on Zod 400s (invalid_query), an array of { path, message }, one per failed field. Present only when validation specifics are attached.
On a 429 rate_limited response, seconds to wait before retrying (mirrors the Retry-After header). Sleep at least this long, then re-issue the identical request.
Echoed on master_not_found (404) — the master id that did not resolve.
Example
{ "error": "invalid_query"}Rate limit exceeded — see Retry-After + X-RateLimit-* headers
object
Example
{ "error": "rate_limited"}Internal server error
The error envelope for all 4xx/5xx responses. error is the only guaranteed field — branch on it, never on HTTP status alone. An unresolved/empty lookup is NOT an error: it returns HTTP 200 with present:false / a null field / state:"honest_gap".
| code | HTTP | when thrown | fix |
|---|---|---|---|
invalid_artist_key | 400 | /artist/{key} key is not a 64-hex cluster_id, discogs:<id>, or mbid:<uuid> | resolve by name first: GET /api/v2/resolve?q=<name>, then call /artist/{cluster_id} |
use_resolve_for_locator | 400 | /artist/{key} given a discogs:/mbid: locator (not a canonical address) | GET /api/v2/resolve?discogs=<id> (or ?mbid=), then use the returned cluster_id (the response next field is the ready-to-call URL) |
invalid_label_key | 400 | /label/{key} key is not a 64-hex label_cluster_id or name-slug (e.g. a discogs:/mbid: locator — not resolvable for labels yet) | address a label by its 64-hex label_cluster_id or its name-slug (e.g. /api/v2/label/warp) |
invalid_fields | 400 | /artist/{key}?fields= lists a facet that is not a valid top-level dossier field | use only the fields in the response valid set; omit ?fields= entirely for the full dossier (see the example field) |
missing_locator | 400 | /resolve called with none of q/cluster/discogs/mbid | pass exactly one locator |
invalid_locator | 400 | a /resolve locator is malformed for its type | fix the format, or fall back to ?q=<name> |
invalid_query | 400 | /search ?q= missing/empty, or any Zod validation failure (details[] attached) | pass ?q=<text>; fix each details entry |
invalid_facet | 400 | an unknown facet filter name was supplied | GET /api/v2/facets for valid names + values |
invalid_range | 400 | /me/usage ?from/?to is not an ISO day (YYYY-MM-DD), to is before from, or the span exceeds 62 days | omit both for the current month to date, or page one calendar month per call (the hint names the exact fix) |
invalid_on_behalf_of | 400 | X-On-Behalf-Of (or /me/usage?profile=, /me/profiles/{profile_id}) is not 1–128 chars of [A-Za-z0-9._:@-] | fix the id, or omit the header to meter the key as one principal |
invalid_cursor | 400 | /search ?after= is malformed, tampered, or was minted for a different query (q/filters changed) | pass pagination.next_cursor from the previous page of the SAME query unchanged; drop after to restart |
rate_limited | 429 | an IP/key/tier rate, monthly quota, or concurrency cap was exceeded (retry_after_seconds + Retry-After + X-RateLimit-* set; a monthly-quota stop also carries X-Quota-Remaining: 0 + X-Quota-Reset) | back off retry_after_seconds (or until X-RateLimit-Reset), then retry |
pool_exhausted | 503 | the database pool could not hand out a connection within the acquire timeout (Retry-After: 5) | retry after 5 s |
query_timeout | 503 | a statement was cancelled by crate’s own budget (statement_timeout; Retry-After: 30) — capacity, not a gateway timeout; during the upstream database’s daily 04–07Z stall this is transient, for very broad /search ?q= (single common words) it recurs | retry after 30 s; narrow a broad ?q= with filters |
request_aborted | 504 | the 15 s request deadline passed before the response was assembled (a statement the deadline cancelled mid-flight answers this code, not query_timeout) | retry later; on the artist dossier, request fewer ?fields= |
internal | 500 | an unexpected error (logged server-side) | retry once; report if it persists |
object
Machine-readable error code (stable lowercase snake_case). The ONLY field guaranteed on every error body — switch on it programmatically, never on HTTP status alone (several codes share a status). See the code table in this schema’s description.
One-sentence human-readable statement of WHAT is wrong (developer-facing). Present only for catalogued codes. Describes the violated rule — not a fix (see hint/next).
Actionable remediation in human terms — what to DO next, often naming the exact endpoint (a template with next.
Deep link to this code’s docs: https://crate.hosaka.fm/docs/api#error-. Auto-populated for catalogued codes.
The specific request parameter that caused the failure (e.g. “key”, “q”), so a client can point at the offending input. Present only when the code declares one.
A copy-pasteable, fully-formed corrected call (a concrete URL, NOT a template) an agent can fire verbatim to recover — the machine-actionable counterpart to hint. Present only when a handler supplies one.
Structured validation breakdown — on Zod 400s (invalid_query), an array of { path, message }, one per failed field. Present only when validation specifics are attached.
On a 429 rate_limited response, seconds to wait before retrying (mirrors the Retry-After header). Sleep at least this long, then re-issue the identical request.
Echoed on master_not_found (404) — the master id that did not resolve.
Example
{ "error": "invalid_query"}Capacity — pool_exhausted (no connection within the acquire timeout; Retry-After: 5) or query_timeout (the statement was cancelled by crate’s own statement budget; Retry-After: 30); honour Retry-After
The error envelope for all 4xx/5xx responses. error is the only guaranteed field — branch on it, never on HTTP status alone. An unresolved/empty lookup is NOT an error: it returns HTTP 200 with present:false / a null field / state:"honest_gap".
| code | HTTP | when thrown | fix |
|---|---|---|---|
invalid_artist_key | 400 | /artist/{key} key is not a 64-hex cluster_id, discogs:<id>, or mbid:<uuid> | resolve by name first: GET /api/v2/resolve?q=<name>, then call /artist/{cluster_id} |
use_resolve_for_locator | 400 | /artist/{key} given a discogs:/mbid: locator (not a canonical address) | GET /api/v2/resolve?discogs=<id> (or ?mbid=), then use the returned cluster_id (the response next field is the ready-to-call URL) |
invalid_label_key | 400 | /label/{key} key is not a 64-hex label_cluster_id or name-slug (e.g. a discogs:/mbid: locator — not resolvable for labels yet) | address a label by its 64-hex label_cluster_id or its name-slug (e.g. /api/v2/label/warp) |
invalid_fields | 400 | /artist/{key}?fields= lists a facet that is not a valid top-level dossier field | use only the fields in the response valid set; omit ?fields= entirely for the full dossier (see the example field) |
missing_locator | 400 | /resolve called with none of q/cluster/discogs/mbid | pass exactly one locator |
invalid_locator | 400 | a /resolve locator is malformed for its type | fix the format, or fall back to ?q=<name> |
invalid_query | 400 | /search ?q= missing/empty, or any Zod validation failure (details[] attached) | pass ?q=<text>; fix each details entry |
invalid_facet | 400 | an unknown facet filter name was supplied | GET /api/v2/facets for valid names + values |
invalid_range | 400 | /me/usage ?from/?to is not an ISO day (YYYY-MM-DD), to is before from, or the span exceeds 62 days | omit both for the current month to date, or page one calendar month per call (the hint names the exact fix) |
invalid_on_behalf_of | 400 | X-On-Behalf-Of (or /me/usage?profile=, /me/profiles/{profile_id}) is not 1–128 chars of [A-Za-z0-9._:@-] | fix the id, or omit the header to meter the key as one principal |
invalid_cursor | 400 | /search ?after= is malformed, tampered, or was minted for a different query (q/filters changed) | pass pagination.next_cursor from the previous page of the SAME query unchanged; drop after to restart |
rate_limited | 429 | an IP/key/tier rate, monthly quota, or concurrency cap was exceeded (retry_after_seconds + Retry-After + X-RateLimit-* set; a monthly-quota stop also carries X-Quota-Remaining: 0 + X-Quota-Reset) | back off retry_after_seconds (or until X-RateLimit-Reset), then retry |
pool_exhausted | 503 | the database pool could not hand out a connection within the acquire timeout (Retry-After: 5) | retry after 5 s |
query_timeout | 503 | a statement was cancelled by crate’s own budget (statement_timeout; Retry-After: 30) — capacity, not a gateway timeout; during the upstream database’s daily 04–07Z stall this is transient, for very broad /search ?q= (single common words) it recurs | retry after 30 s; narrow a broad ?q= with filters |
request_aborted | 504 | the 15 s request deadline passed before the response was assembled (a statement the deadline cancelled mid-flight answers this code, not query_timeout) | retry later; on the artist dossier, request fewer ?fields= |
internal | 500 | an unexpected error (logged server-side) | retry once; report if it persists |
object
Machine-readable error code (stable lowercase snake_case). The ONLY field guaranteed on every error body — switch on it programmatically, never on HTTP status alone (several codes share a status). See the code table in this schema’s description.
One-sentence human-readable statement of WHAT is wrong (developer-facing). Present only for catalogued codes. Describes the violated rule — not a fix (see hint/next).
Actionable remediation in human terms — what to DO next, often naming the exact endpoint (a template with next.
Deep link to this code’s docs: https://crate.hosaka.fm/docs/api#error-. Auto-populated for catalogued codes.
The specific request parameter that caused the failure (e.g. “key”, “q”), so a client can point at the offending input. Present only when the code declares one.
A copy-pasteable, fully-formed corrected call (a concrete URL, NOT a template) an agent can fire verbatim to recover — the machine-actionable counterpart to hint. Present only when a handler supplies one.
Structured validation breakdown — on Zod 400s (invalid_query), an array of { path, message }, one per failed field. Present only when validation specifics are attached.
On a 429 rate_limited response, seconds to wait before retrying (mirrors the Retry-After header). Sleep at least this long, then re-issue the identical request.
Echoed on master_not_found (404) — the master id that did not resolve.
Example
{ "error": "invalid_query"}The 15 s request deadline passed before the response was assembled (request_aborted)
The error envelope for all 4xx/5xx responses. error is the only guaranteed field — branch on it, never on HTTP status alone. An unresolved/empty lookup is NOT an error: it returns HTTP 200 with present:false / a null field / state:"honest_gap".
| code | HTTP | when thrown | fix |
|---|---|---|---|
invalid_artist_key | 400 | /artist/{key} key is not a 64-hex cluster_id, discogs:<id>, or mbid:<uuid> | resolve by name first: GET /api/v2/resolve?q=<name>, then call /artist/{cluster_id} |
use_resolve_for_locator | 400 | /artist/{key} given a discogs:/mbid: locator (not a canonical address) | GET /api/v2/resolve?discogs=<id> (or ?mbid=), then use the returned cluster_id (the response next field is the ready-to-call URL) |
invalid_label_key | 400 | /label/{key} key is not a 64-hex label_cluster_id or name-slug (e.g. a discogs:/mbid: locator — not resolvable for labels yet) | address a label by its 64-hex label_cluster_id or its name-slug (e.g. /api/v2/label/warp) |
invalid_fields | 400 | /artist/{key}?fields= lists a facet that is not a valid top-level dossier field | use only the fields in the response valid set; omit ?fields= entirely for the full dossier (see the example field) |
missing_locator | 400 | /resolve called with none of q/cluster/discogs/mbid | pass exactly one locator |
invalid_locator | 400 | a /resolve locator is malformed for its type | fix the format, or fall back to ?q=<name> |
invalid_query | 400 | /search ?q= missing/empty, or any Zod validation failure (details[] attached) | pass ?q=<text>; fix each details entry |
invalid_facet | 400 | an unknown facet filter name was supplied | GET /api/v2/facets for valid names + values |
invalid_range | 400 | /me/usage ?from/?to is not an ISO day (YYYY-MM-DD), to is before from, or the span exceeds 62 days | omit both for the current month to date, or page one calendar month per call (the hint names the exact fix) |
invalid_on_behalf_of | 400 | X-On-Behalf-Of (or /me/usage?profile=, /me/profiles/{profile_id}) is not 1–128 chars of [A-Za-z0-9._:@-] | fix the id, or omit the header to meter the key as one principal |
invalid_cursor | 400 | /search ?after= is malformed, tampered, or was minted for a different query (q/filters changed) | pass pagination.next_cursor from the previous page of the SAME query unchanged; drop after to restart |
rate_limited | 429 | an IP/key/tier rate, monthly quota, or concurrency cap was exceeded (retry_after_seconds + Retry-After + X-RateLimit-* set; a monthly-quota stop also carries X-Quota-Remaining: 0 + X-Quota-Reset) | back off retry_after_seconds (or until X-RateLimit-Reset), then retry |
pool_exhausted | 503 | the database pool could not hand out a connection within the acquire timeout (Retry-After: 5) | retry after 5 s |
query_timeout | 503 | a statement was cancelled by crate’s own budget (statement_timeout; Retry-After: 30) — capacity, not a gateway timeout; during the upstream database’s daily 04–07Z stall this is transient, for very broad /search ?q= (single common words) it recurs | retry after 30 s; narrow a broad ?q= with filters |
request_aborted | 504 | the 15 s request deadline passed before the response was assembled (a statement the deadline cancelled mid-flight answers this code, not query_timeout) | retry later; on the artist dossier, request fewer ?fields= |
internal | 500 | an unexpected error (logged server-side) | retry once; report if it persists |
object
Machine-readable error code (stable lowercase snake_case). The ONLY field guaranteed on every error body — switch on it programmatically, never on HTTP status alone (several codes share a status). See the code table in this schema’s description.
One-sentence human-readable statement of WHAT is wrong (developer-facing). Present only for catalogued codes. Describes the violated rule — not a fix (see hint/next).
Actionable remediation in human terms — what to DO next, often naming the exact endpoint (a template with next.
Deep link to this code’s docs: https://crate.hosaka.fm/docs/api#error-. Auto-populated for catalogued codes.
The specific request parameter that caused the failure (e.g. “key”, “q”), so a client can point at the offending input. Present only when the code declares one.
A copy-pasteable, fully-formed corrected call (a concrete URL, NOT a template) an agent can fire verbatim to recover — the machine-actionable counterpart to hint. Present only when a handler supplies one.
Structured validation breakdown — on Zod 400s (invalid_query), an array of { path, message }, one per failed field. Present only when validation specifics are attached.
On a 429 rate_limited response, seconds to wait before retrying (mirrors the Retry-After header). Sleep at least this long, then re-issue the identical request.
Echoed on master_not_found (404) — the master id that did not resolve.
Example
{ "error": "invalid_query"}