musiccloud / developer

API reference

Generated from the public OpenAPI contract for version 2.1.10.

Integration guide

Integration essentials

Authentication

Send X-API-Key with your mc_live key. Never expose that key in browser code.

Requests

Use JSON request bodies and read JSON responses from the versioned api.musiccloud.io base URL.

Errors

Every backend error includes a stable code, safe message, and errorId for support correlation.

Limits

Authenticated requests share the Developer Project's minute and day quotas; registration caps can only narrow them.

Versioning

This page is generated from public API version 2.1.10.

OpenAPI contract

The public OpenAPI contract is available at https://api.musiccloud.io/docs/json.

Authenticated request

# Requires MUSICCLOUD_API_KEY to be set in your shell environment.
curl https://api.musiccloud.io/api/v1/resolve \
  -H "X-API-Key: ${MUSICCLOUD_API_KEY}" \
  -H "Content-Type: application/json"

Public OpenAPI contract, v2.1.10

Loading OpenAPI contract

SDK downloads

Download an SDK

Hey API 0.99.0 · SDK 0.1.0 · API 2.1.10 · preview

Installation

unzip musiccloud-typescript-sdk-0.1.0.zip

Usage

import { MusicCloudClient } from '@musiccloud/sdk';

const client = new MusicCloudClient();
const share = await client.shares.retrieve(shortId);

Artist

Artist info

GET /api/v1/artist-info
Public endpoint

Aggregated artist info (top tracks, profile, events)

Returns commercial artist details in one stable object: up to 5 top tracks, an assembled profile or null, up to 5 upcoming events, and up to 5 related-artist track lookups. Every top-level key is included; unavailable lists are empty. When region is supplied, matching events are sorted first.

Parameters

name query

Compatibility artist display name to look up when artistEntityId is not available. Leading and trailing whitespace is ignored, and a trailing YouTube auto-channel suffix - Topic is removed before matching. Use the spelling returned in track or artist metadata when available.

artistEntityId query

Normalized musiccloud artist entity ID from an artistCredits[].artistEntityId field in a successful track or album response. When supplied, this exact entity selects the persisted canonical artist name, its isolated enrichment cache, and the upstream lookup. It takes precedence over both name and shortId. Unknown entity IDs return 404.

region query

Country preference for event ordering. Supply a two-letter ISO 3166-1 alpha-2 code such as NO; matching is case-insensitive. Only the first two characters are used. Matching events are placed first and each group is ordered by date.

Default: no country is prioritized and events remain in ascending date order.

shortId query

Optional musiccloud track share code. Take the last path segment of shortUrl from a successful track response from POST /api/v1/resolve or GET /api/v1/resolve. Without artistEntityId, a stored alternate artist can replace name for this lookup. With artistEntityId, this compatibility alias is ignored.

Default: the supplied name is used directly, with no persisted-resolution context.

refresh query

Set to profile to fetch profile metadata again before responding, even when the stored profile snapshot is younger than 183 days. This does not force a refresh of top tracks or events: those sections are fetched again only when their stored snapshots are at least 7 days and 24 hours old, respectively.

Default: profile metadata is fetched when no stored snapshot exists or its snapshot is at least 183 days old.

Responses

200

ArtistInfo containing up to 5 selected top tracks, a nullable profile, up to 5 upcoming events, and related-artist track lookups.

Content-Type: application/json Response Object: ArtistInfo
400

Missing or malformed artist identity query parameter.

Content-Type: application/json Response Object: ErrorResponse
404

The supplied normalized artist entity does not exist or has no usable stored name.

Content-Type: application/json Response Object: ErrorResponse
429

This client IP exceeded 10 requests in a rolling 60-second window.

Content-Type: application/json Response Object: ErrorResponse
500

Unexpected server error. Use errorId from the response when reporting the failure.

Content-Type: application/json Response Object: ErrorResponse

Artwork

Creative Commons genre artwork

GET /api/v1/cc/genre-artwork/{genreKey}
Public endpoint

Procedurally generated Creative-Commons genre artwork

Returns a 512×512 JPEG derived only from Creative Commons source artwork. A stable generated image is served with Cache-Control: public, max-age=31536000, immutable. If source artwork is temporarily unavailable, the endpoint still returns a fallback JPEG with Cache-Control: no-store, allowing a later request to retry generation. This route is subject only to the global limit of 300 requests in a rolling 60-second window per client IP.

Parameters

genreKey path Required

Genre name from CcGenreBrowseResponse.genres[].name. URL-encode it when inserting it into the path; the endpoint lowercases and normalizes whitespace before validation.

Responses

200

Generated, cached, or transient fallback Creative Commons genre artwork as raw JPEG bytes.

Content-Type: image/jpeg
400

The normalized genre key contains invalid characters.

Content-Type: application/json Response Object: ErrorResponse
429

Global rate limit exceeded. Retry after the interval provided by the Retry-After header.

Content-Type: application/json Response Object: ErrorResponse
500

Unexpected server error. Use errorId from the response when reporting the failure.

Content-Type: application/json Response Object: ErrorResponse

Genre artwork

GET /api/v1/genre-artwork/{genreKey}
Public endpoint

Procedurally generated genre artwork

Returns a 512×512 JPEG for a normalized genre. A stable generated image is served with Cache-Control: public, max-age=31536000, immutable. If source artwork is temporarily unavailable, the endpoint still returns a fallback JPEG with Cache-Control: no-store, allowing a later request to retry generation. This route is subject only to the global limit of 300 requests in a rolling 60-second window per client IP.

Parameters

genreKey path Required

Genre name from GenreBrowseResponse.genres[].name. URL-encode it when inserting it into the path; the endpoint lowercases and normalizes whitespace before validation.

Responses

200

Generated, cached, or transient fallback genre artwork as raw JPEG bytes.

Content-Type: image/jpeg
400

The normalized genre key contains invalid characters.

Content-Type: application/json Response Object: ErrorResponse
429

Global rate limit exceeded. Retry after the interval provided by the Retry-After header.

Content-Type: application/json Response Object: ErrorResponse
500

Unexpected server error. Use errorId from the response when reporting the failure.

Content-Type: application/json Response Object: ErrorResponse

Creative Commons

Creative Commons artist info

GET /api/v1/cc/artist-info
Public endpoint

Get Creative Commons artist details and related tracks

Returns CcArtistInfo for one Jamendo artist: up to 20 popular tracks in descending popularity order, a profile or null, up to 12 tracks by related artists, and an always-empty events array. Candidate values in topTracks[].deezerUrl and similarArtistTracks[].track.deezerUrl are opaque jamendo:<trackId> tokens, not URLs. Pass one unchanged as selectedCandidate to POST /api/v1/cc/resolve to persist and resolve that track.

Parameters

jamendoArtistId query Required

Numeric Jamendo artist ID. Read track.jamendoArtistId, album.tracks[].jamendoArtistId, or artist.jamendoId from a successful POST /api/v1/cc/resolve or GET /api/v1/share/{shortId} response.

artistName query Required

Display label for the artist identified by jamendoArtistId. Read it from track.artistName, album.artistName, or artist.name in the same response as the ID. The ID, not this name, controls which Jamendo artist, profile, and tracks are fetched; the supplied string is returned as artistName.

Responses

200

CcArtistInfo derived from the requested Jamendo artist.

Content-Type: application/json Response Object: CcArtistInfo
400

jamendoArtistId is not numeric, or artistName is missing or empty.

Content-Type: application/json Response Object: ErrorResponse
429

This client IP exceeded 10 requests in a rolling 60-second window.

Content-Type: application/json Response Object: ErrorResponse
500

Unexpected server error. Use errorId from the response when reporting the failure.

Content-Type: application/json Response Object: ErrorResponse

Creative Commons audio

GET /api/v1/cc/audio/{jamendoId}
Public endpoint

Stream a full Creative Commons track

Returns the selected full-track representation as raw audio bytes, not JSON. For ordinary browser playback, point an <audio> element directly at the endpoint:

<audio controls src="https://api.musiccloud.io/api/v1/cc/audio/123456?format=mp32"></audio>

For fetch, consume response.body as a byte stream or call response.blob(); do not call response.json(). A Blob is available only after the complete response has been buffered, so use streaming or a direct <audio> URL for long tracks.

Formats. format=mp31 selects MP3 at 96 kbps; format=mp32 selects MP3 at approximately 256 kbps; format=ogg selects Ogg Vorbis; and format=flac selects lossless FLAC. The default is mp32. The response Content-Type identifies the actual representation.

Seeking and resumable reads. Send a valid HTTP range such as Range: bytes=0-1048575 or Range: bytes=-1048576. A satisfiable range returns 206 and Content-Range; a complete representation returns 200. Accept-Ranges is always bytes. Content-Length and Cache-Control are included only when supplied for the selected representation.

Parameters

format query

Jamendo delivery format: mp31 (MP3 96 kbps), mp32 (MP3 about 256 kbps), ogg, or flac. Invalid values also fall back to mp32.

Default: mp32.

jamendoId path Required

Numeric Jamendo track ID. Read track.jamendoId, album.tracks[].jamendoId, or artist.topTracks[].jamendoId from a successful POST /api/v1/cc/resolve or GET /api/v1/share/{shortId} response.

range header

Optional HTTP byte range, for example bytes=0-1048575. Omit it for the complete stream.

Responses

200

Complete full raw audio stream when no byte range was requested.

Content-Type: audio/flac
Content-Type: audio/mpeg
Content-Type: audio/ogg
206

Requested raw-audio byte range. Content-Range identifies the delivered segment.

Content-Type: audio/flac
Content-Type: audio/mpeg
Content-Type: audio/ogg
400

jamendoId is not numeric or Range does not use a supported single-byte-range syntax.

Content-Type: application/json Response Object: ErrorResponse
404

No Creative Commons track exists for this jamendoId.

Content-Type: application/json Response Object: ErrorResponse
429

This client IP exceeded 10 requests in a rolling 60-second window.

Content-Type: application/json Response Object: ErrorResponse
500

Unexpected server error. Use errorId from the response when reporting the failure.

Content-Type: application/json Response Object: ErrorResponse
502

The upstream Jamendo audio stream is unavailable or returned no body.

Content-Type: application/json Response Object: ErrorResponse

Bandcamp availability

GET /api/v1/cc/bandcamp/{jamendoId}
Public endpoint

Whether a CC track is also available on Bandcamp

Returns bandcampUrl when the Jamendo track has a sufficiently reliable matching Bandcamp listing. Returns an empty object when the Jamendo ID is unknown or no safe match can be confirmed. Treat an omitted key as unavailable and do not construct a Bandcamp URL yourself.

Parameters

jamendoId path Required

Numeric Jamendo track ID. Read track.jamendoId, album.tracks[].jamendoId, or artist.topTracks[].jamendoId from a successful POST /api/v1/cc/resolve or GET /api/v1/share/{shortId} response.

Responses

400

jamendoId is not numeric.

Content-Type: application/json Response Object: ErrorResponse
429

This client IP exceeded 10 requests in a rolling 60-second window.

Content-Type: application/json Response Object: ErrorResponse
500

Unexpected server error. Use errorId from the response when reporting the failure.

Content-Type: application/json Response Object: ErrorResponse

Creative Commons download

GET /api/v1/cc/download/{jamendoId}
Public endpoint

Download a CC track as a correctly named audio file

Returns a complete Creative Commons track as a downloadable attachment. Content-Disposition provides an ASCII fallback and a UTF-8 filename following Artist_Album_NN_Title.ext; unavailable album and track-position segments are omitted. format=mp31 selects MP3 at 96 kbps, format=mp32 selects MP3 at approximately 256 kbps, format=ogg selects Ogg Vorbis, and format=flac selects lossless FLAC. The default is mp32. Check track.downloadAllowed before offering this action; the endpoint returns 403 when downloads are not permitted.

Parameters

format query

Jamendo delivery format: mp31 (MP3 96 kbps), mp32 (MP3 about 256 kbps), ogg, or flac. Invalid values also fall back to mp32.

Default: mp32.

jamendoId path Required

Numeric Jamendo track ID. Read track.jamendoId, album.tracks[].jamendoId, or artist.topTracks[].jamendoId from a successful POST /api/v1/cc/resolve or GET /api/v1/share/{shortId} response.

Responses

200

Complete Creative Commons audio file served as an attachment.

Content-Type: audio/flac
Content-Type: audio/mpeg
Content-Type: audio/ogg
400

jamendoId is not numeric.

Content-Type: application/json Response Object: ErrorResponse
403

The track's Creative Commons terms do not permit downloads.

Content-Type: application/json Response Object: ErrorResponse
404

No Creative Commons track exists for this jamendoId.

Content-Type: application/json Response Object: ErrorResponse
429

This client IP exceeded 10 requests in a rolling 60-second window.

Content-Type: application/json Response Object: ErrorResponse
500

Unexpected server error. Use errorId from the response when reporting the failure.

Content-Type: application/json Response Object: ErrorResponse
502

The upstream Jamendo audio file is unavailable or returned no body.

Content-Type: application/json Response Object: ErrorResponse

Link metadata

Resolve

Creative Commons resolve

POST /api/v1/cc/resolve
API key required

Resolve a Creative-Commons free-text or structured query (Jamendo)

Use query for Creative-Commons free text, a title:/artist:/album: structured search, or genre: discovery. Pasted streaming-service URLs are not accepted. A text search returns ResolveDisambiguation; choose one row and send its opaque candidates[].id back as selectedCandidate. A CC genre result already returns candidate IDs in results.*[].id; pass one unchanged as selectedCandidate to receive a persisted cc-track, cc-album, or cc-artist response.

Authentication

Send X-API-Key with a valid mc_live_… key.

Request body

application/json

Responses

400

The body does not contain exactly one usable query or selectedCandidate, the query syntax is invalid, or the candidate token has an unsupported format.

Content-Type: application/json Response Object: ErrorResponse
401

Missing, invalid, or revoked API key.

Content-Type: application/json Response Object: ErrorResponse
404

The selected candidate could not be resolved.

Content-Type: application/json Response Object: ErrorResponse
429

The issued API key exceeded its assigned rolling 60-second or rolling 24-hour quota. Inspect context and Retry-After before retrying.

Content-Type: application/json Response Object: ErrorResponse
500

Unexpected server error. Use errorId from the response when reporting the failure.

Content-Type: application/json Response Object: ErrorResponse

Quick resolve

GET /api/v1/resolve
Public endpoint

Resolve a music URL or query (unauthenticated, GET)

Unauthenticated one-request companion to POST /api/v1/resolve, suitable for command-line tools, shortcuts, and other clients that do not need an interactive candidate-selection round. Accepts:

  • Streaming-service URL (e.g. https://open.spotify.com/track/...)
  • Free-text query (e.g. bohemian rhapsody queen)
  • Structured search query — starts with title:, artist:, or album: and resolves tracks only. Use it when the caller knows individual fields and wants more precise adapter-side matching than plain free text.

Supported fields:

  • title: — track title. At least one of title or artist is required.
  • artist: — artist name. At least one of title or artist is required.
  • album: — optional album title. Refines a track match and cannot be used alone.
  • count: — optional integer from 1 to 10. Caps the disambiguation candidate list.

Syntax rules:

  • Field names are case-insensitive.
  • Fields are separated by commas. A missing comma before the next known field is tolerated, e.g. title: foo artist: bar.
  • Values may contain spaces. Commas are field separators and are not escaped.
  • Duplicate fields, empty values, unknown fields, count outside 110, and count without title or artist return 400.
  • genre:, tracks:, albums:, artists:, and vibe: are rejected here. Use the genre: query shape instead.

Examples:

  • title: The Killing Moon, artist: Echo & The Bunnymen
  • artist: Radiohead
  • title: Karma Police, artist: Radiohead, album: OK Computer, count: 5

GET has no selectedCandidate parameter. Ambiguous structured searches therefore return 400; use POST /api/v1/resolve when the caller must present candidates and submit a selection. A successful GET resolve is persisted just like a successful POST resolve.

A successful request persists the resolved track and returns either ResolveSuccess or its canonical share URL. Malformed input, ambiguous text, or text with no unambiguous match returns 400. A valid streaming-service URL whose item cannot be found returns 404.

genre: discovery queries are not supported because they return candidate lists. Send those queries to POST /api/v1/resolve.

Parameters

query query Required

Streaming-service URL, free-text query, or structured search query (e.g. title: Bohemian Rhapsody, artist: Queen).

format query

json returns the full response; text returns the short URL as plain text.

Default: json.

Responses

200

With format=json or no format, returns ResolveSuccess. With format=text, returns only the canonical share URL as UTF-8 plain text.

Content-Type: application/json Response Object: ResolveSuccess
Content-Type: text/plain
400

The query is missing or malformed, or a text search did not produce one unambiguous match.

Content-Type: application/json Response Object: ErrorResponse
404

The query is a valid streaming-service URL, but the referenced track could not be found.

Content-Type: application/json Response Object: ErrorResponse
408

Upstream service timed out.

Content-Type: application/json Response Object: ErrorResponse
429

This client IP exceeded 10 requests in a rolling 60-second window.

Content-Type: application/json Response Object: ErrorResponse
500

Unexpected server error. Use errorId from the response when reporting the failure.

Content-Type: application/json Response Object: ErrorResponse
503

Required upstream service is unavailable.

Content-Type: application/json Response Object: ErrorResponse

Resolve link

POST /api/v1/resolve
API key required

Resolve a music URL, free-text query, genre-discovery query, or structured search query

Accepts four query shapes. Pick the one that matches what the user knows:

1. Streaming-service URL — e.g. https://open.spotify.com/track/..., https://music.apple.com/.... Returns unified cross-service metadata. Use when the user already has a link.

2. Free-text query — any string that is not a URL and does not start with a structured prefix. Returns a resolved match or a disambiguation list (follow up with selectedCandidate to pick one). Use when the user only knows roughly what they want.

3. Genre-discovery query — starts with genre:. Two sub-modes:

  • genre: ? → browse grid of popular genres (no other fields allowed).
  • genre: <name>[|<name>...]<, modifier>* → discovery results. Modifiers: tracks/albums/artists (150 each, default 10 of each when none is specified), count (150, sets all three to the same value, mutually exclusive with per-type modifiers), vibe (hot for the highest-ranked results, mixed for a stratified sample across the ranked pool). | inside a value means OR.
  • Example: genre: jazz|r&b, tracks: 20, vibe: mixed.

4. Structured search query — starts with title:, artist:, or album: and resolves tracks only. Use it when the caller knows individual fields and wants more precise adapter-side matching than plain free text.

Supported fields:

  • title: — track title. At least one of title or artist is required.
  • artist: — artist name. At least one of title or artist is required.
  • album: — optional album title. Refines a track match and cannot be used alone.
  • count: — optional integer from 1 to 10. Caps the disambiguation candidate list.

Syntax rules:

  • Field names are case-insensitive.
  • Fields are separated by commas. A missing comma before the next known field is tolerated, e.g. title: foo artist: bar.
  • Values may contain spaces. Commas are field separators and are not escaped.
  • Duplicate fields, empty values, unknown fields, count outside 110, and count without title or artist return 400.
  • genre:, tracks:, albums:, artists:, and vibe: are rejected here. Use the genre: query shape instead.

Examples:

  • title: The Killing Moon, artist: Echo & The Bunnymen
  • artist: Radiohead
  • title: Karma Police, artist: Radiohead, album: OK Computer, count: 5

POST can return ResolveDisambiguation for structured searches. Send the chosen candidates[].id back as selectedCandidate to the same endpoint to complete and persist the resolve.

Authentication

Send X-API-Key with a valid mc_live_… key.

Request body

application/json

Responses

400

Invalid URL, invalid genre query, invalid structured search query, or malformed body.

Content-Type: application/json Response Object: ErrorResponse
401

Missing, invalid, or revoked API key.

Content-Type: application/json Response Object: ErrorResponse
404

URL is valid but the track/album/artist could not be found.

Content-Type: application/json Response Object: ErrorResponse
408

Upstream service timed out before a match could be confirmed.

Content-Type: application/json Response Object: ErrorResponse
429

The issued API key exceeded its assigned rolling 60-second or rolling 24-hour quota. Inspect context and Retry-After before retrying.

Content-Type: application/json Response Object: ErrorResponse
500

Unexpected server error. Use errorId from the response when reporting the failure.

Content-Type: application/json Response Object: ErrorResponse
503

A service needed to resolve this request is currently unavailable. Retry after a delay; if the response repeats, report its errorId.

Content-Type: application/json Response Object: ErrorResponse

Share

Share

GET /api/v1/share/{shortId}
Public endpoint

Fetch a previously-resolved share

Returns one of six exact share variants selected by type: commercial track, album, or artist, and Creative Commons cc-track, cc-album, or cc-artist. Commercial variants contain the matching entity plus links. cc-track contains only track, og, and shortUrl; cc-album and cc-artist additionally contain artistInfo. Creative Commons variants never contain links. Read type before accessing the variant-specific entity key.

Parameters

shortId path Required

Public musiccloud share code: take the last path segment of shortUrl from a successful POST /api/v1/resolve, GET /api/v1/resolve, or POST /api/v1/cc/resolve response.

Responses

200

SharePage, discriminated by type into the exact commercial or Creative-Commons resource shape.

Content-Type: application/json Response Object: SharePage
400

shortId failed validation (empty, too long, or contains disallowed characters).

Content-Type: application/json Response Object: ErrorResponse
404

No commercial or Creative-Commons track, album, or artist exists for this share code.

Content-Type: application/json Response Object: ErrorResponse
429

This client IP exceeded 10 requests in a rolling 60-second window.

Content-Type: application/json Response Object: ErrorResponse
500

Unexpected server error. Use errorId from the response when reporting the failure.

Content-Type: application/json Response Object: ErrorResponse

Refresh preview

GET /api/v1/share/{shortId}/preview
Public endpoint

Refresh the audio preview URL for a share

Returns a currently usable audio-preview URL for a commercial track share. The key previewUrl is always included: its value is a URL when one is available, or null when the track has no source identifier or no preview can be obtained. This endpoint does not accept album, artist, or Creative-Commons share codes.

Parameters

shortId path Required

Track share code: take the last path segment of shortUrl from a successful track response from POST /api/v1/resolve or GET /api/v1/resolve. Album, artist, and Creative Commons share codes are not accepted.

Responses

200

Fresh preview URL for the commercial track share, or null when no preview is available.

Content-Type: application/json Response Object: SharePreviewResponse
404

No commercial track exists for this share code.

Content-Type: application/json Response Object: ErrorResponse
429

This client IP exceeded 10 requests in a rolling 60-second window.

Content-Type: application/json Response Object: ErrorResponse
500

Unexpected server error. Use errorId from the response when reporting the failure.

Content-Type: application/json Response Object: ErrorResponse

Schemas

Album

AlbumResolveSuccess

AlbumSharePageResponse

Artist

ArtistCredit

ArtistEvent

ArtistInfo

ArtistProfile

ArtistResolveSuccess

ArtistSharePageResponse

ArtistTopTrack

CcAlbum

CcAlbumResolveSuccess

CcAlbumSharePageResponse

CcArtist

CcArtistInfo

CcArtistProfile

CcArtistResolveSuccess

CcArtistSharePageResponse

CcArtistTopTrack

CcBandcampAvailabilityResponse

CcGenreAlbumCandidate

CcGenreArtistCandidate

CcGenreBrowseResponse

CcGenreSearchResponse

CcGenreTile

CcGenreTrackCandidate

CcMusicInfo

CcResolveSuccess

CcSimilarArtistTrack

CcTrack

CcTrackResolveSuccess

CcTrackSharePageResponse

CcTrackStats

DisambiguationCandidate

ErrorResponse

GenreAlbumCandidate

GenreArtistCandidate

GenreBrowseResponse

GenreSearchResponse

GenreTile

GenreTrackCandidate

OgMeta

ResolveDisambiguation

ResolveSuccess

SharePage

SharePreviewResponse

SimilarArtistTrack

Track

TrackResolveSuccess

TrackSharePageResponse

UnifiedResolveSuccess

VinylLayout

VinylLayoutTrack

VinylSide

Search API reference

Search ready

Type to search the complete API reference.