Appearance
Recommendations
Postgres + pgvector. Tracks get a 128-dimension embedding (track_embeddings, HNSW, cosine); listeners get a taste vector (user_taste_vectors). Candidates come from ANN search (<=>), co-listening (co_listen_pairs), new releases from followed creators, editorial picks and trending; a pure ranking engine scores, filters and spreads artists out. Personal products are built nightly on the reco queue and stored in candidate_sets; reads re-filter them (takedowns, hides, explicit setting) and hydrate track cards in one catalogue call.
All responses use { data, meta }. Errors are RFC 9457 problem details.
Shared shapes
RecommendedTrack: recordingId, title, releaseId|null, profileIds[] (primary first), artworkAssetId|null, durationMs, isExplicit, reason, reasonRecordingId|null, reasonProfileId|null.
reason: similar_sound, listened_together, followed_release, editorial, trending, taste_match, artist_you_like, familiar.
Shelf: key, kind, titleKey (i18n key, such as reco.daily_mix), slot, candidateSetId|null, seedRecordingId|null, seedProfileId|null, seedGenreId|null, generatedAt, expiresAt|null, items: RecommendedTrack[].
kind: daily_mix, discover_weekly, release_radar, because_you_played, artist_radio, track_radio, home_trending, home_editorial.
Endpoints
| Method | Path | Auth | Body / query | Response | Errors |
|---|---|---|---|---|---|
| GET | /v1/reco/home | optional | — | { personalized, shelves: Shelf[] }. Guests: trending + editorial only. Signed in: daily mixes, because-you-played, Discover Weekly, Release Radar, then trending/editorial for the listener's country (20 items each). Missing or expired products are queued for building. | 429 |
| GET | /v1/reco/radio/tracks/:recordingId | optional | limit 1–100 (50) | Shelf (track_radio), seed first. Personalised when signed in. | 400, 404 RECO_SEED_NOT_FOUND, 429 |
| GET | /v1/reco/radio/artists/:profileId | optional | limit 1–100 (50) | Shelf (artist_radio) | 400, 404 RECO_SEED_NOT_FOUND, 429 |
| GET | /v1/me/reco/daily-mixes | user | — | Shelf[], up to 6, slots 1–6 | 401 |
| GET | /v1/me/reco/daily-mixes/:slot | user | slot 1–6 | Shelf (up to 100 items) | 400, 401, 404 RECO_SET_NOT_FOUND |
| GET | /v1/me/reco/because-you-played | user | — | Shelf[], up to 3, each seeded by a recent favourite | 401 |
| GET | /v1/me/reco/discover-weekly | user | — | Shelf (30 unheard tracks; rebuilt Mondays 04:00 UTC) | 401, 404 RECO_SET_NOT_FOUND (not built yet; a build is queued) |
| GET | /v1/me/reco/release-radar | user | — | Shelf (new tracks from followed and loved creators, last 14 days; rebuilt Fridays) | 401, 404 RECO_SET_NOT_FOUND |
| GET | /v1/me/reco/explanations/:recordingId | user | — | `{ recordingId, reasons: [{ reason, strength 0–1, recordingId | null, profileId |
| POST | /v1/me/reco/feedback | user | { recordingId, kind, surface, candidateSetId?, profileId? } | 202 { status: "accepted" } | 400, 401, 429 |
| POST | /v1/me/reco/impressions | user | { items: [{ recordingId, surface, candidateSetId?, position }] } (1–100) | 202 { status: "accepted" } | 400, 401, 429 |
Feedback kind: skip (affinity −0.5, ranking penalty), like (+3), unlike (−3), hide (track never recommended again), hide_artist (needs profileId), unhide (removes the track, and the artist when profileId is given, from hidden).
surface: home, daily_mix, discover_weekly, release_radar, because_you_played, artist_radio, track_radio, assistant.
Rate limits: reads 240/min per user and per IP; feedback and impressions 600/min per user.
Errors
| Code | Status | Meaning |
|---|---|---|
RECO_SEED_NOT_FOUND | 404 | The radio seed is unknown, unavailable, or has nothing similar yet |
RECO_SET_NOT_FOUND | 404 | That product hasn't been built for this listener yet |
RECO_EXPLANATION_UNAVAILABLE | 404 | No evidence links this track to the listener |
Events
| Type | Payload | When |
|---|---|---|
recommendation.product.ready | { userId, kind, candidateSetId, slot, generatedAt } | Discover Weekly or Release Radar rebuilt with items (for "your mix is ready" notifications) |
Pipelines (reco queue)
| Job | Trigger | Work |
|---|---|---|
reco.stream | api.recordQualifiedStream | Dedupe on eventId (partitioned reco_listen_events), add decayed track and creator affinity |
reco.feedback | route / api.recordFeedback | Store feedback, adjust affinity or hidden items |
reco.impressions | route / api.recordImpressions | Insert into partitioned reco_impressions |
reco.features | api.upsertTrackFeatures | Store analysis scalars, genres, moods, optional audio embedding; then reco.embed |
reco.nightly | cron RECO_NIGHTLY_CRON | Create partitions 3 months ahead, drop old ones (listen 6 months, impressions 3), add yesterday's co-listen pairs, purge expired sets, start the embedding scan |
reco.embed-scan → reco.taste-scan → reco.user-products | chained | Embeddings for changed tracks, taste vectors for users active in RECO_ACTIVE_USER_DAYS, then each user's due products |
Account privacy
Data export section recommendation: track and artist affinity, feedback, hidden items. Deletion erases all signals.
Quick picks and deep cuts
GET /me/reco/quick-picks?limit (recent favourites, then tracks played alongside them) and GET /me/reco/deep-cuts?limit (least-streamed tracks from followed or most-played creators the person hasn't played). Both return a Shelf with kind quick_picks or deep_cuts; tracks carry artworkUrl.
Quick picks and deep cuts
GET /me/reco/quick-picks?limit (recent favourites, then tracks played alongside them) and GET /me/reco/deep-cuts?limit (less-streamed tracks from creators the person follows or plays). Both answer a shelf (kind: quick_picks | deep_cuts) with artworkUrl on items.