Logo

Docs

Songs

Song Models

Song resource and music file shapes.

Song

interface Song extends Resource {
  type: "song";
  attributes: {
    name: string;
    files: {
      preferred: MusicFile;
      alternatives?: MusicFile[];
    };
    albumName?: string;
    artistName?: string;
    isrc?: string;
    artworkUrl?: string;
    trackNumber?: number;
    discNumber?: number;
    genres?: string[];
    releaseDate?: string;
    durationMs?: number;
    lyrics?: Lyrics;
  };
  relationships?: {
    albums?: List<Album>;
    artists?: List<Artist>;
  };
}

albumName and artistName are display fallbacks. Prefer relationships when the client needs structured album or artist data.

MusicFile

interface MusicFile {
  id: string;
  lossless: boolean;
  mimeType: string;
  sizeBytes: number;
  durationMs: number;
  streamUrl?: string;
  downloadUrl?: string;
  codec?: string;
  bitrateKbps?: number;
  sampleRateHz?: number;
  channels?: number;
}

If streamUrl or downloadUrl is missing, clients can use the default file endpoints.

Lyrics

Lyrics are part of song attributes and are controlled by lang when localization is available.

interface Lyrics {
  lang: string;
  text: string;
  ttml?: string;
}

On this page