Logo

Docs

Songs

Song Models

The song resource types used across the OpenMusic API.

BaseSong

Minimal song resource shape used for view=minimal and nested relationships.

interface BaseSong extends ResourceBase {
  type: "songs";
  meta: {
    omm_id: string | null;
  };
  instance: {
    duration_in_ms: number;
    files: File[];
    has_lyrics: boolean;
  };
  relationships?: {
    albums?: (Album | BaseAlbum)[];
    artists?: (Artist | BaseArtist)[];
    lyrics?: Lyrics;
  };
}

Song

Full song resource returned when attributes are requested; extends BaseSong.

interface Song extends BaseSong {
  attributes: SongAttributes;
}

File

Represents one playable/downloadable media file variant for a song.

interface File {
  download_url: string;
  lossless: boolean;
  mime_type: string;
  codec: string | null;
  bitrate: number | null;
  stream_url: string | null;
}

download_url is required. stream_url may be null if the server does not support streaming.

SongAttributes

Full metadata fields attached to Song.

artist_name and album_name are fallback display fields for cases where artist/album relationships are unavailable. They should also be populated by implementations that do expose those relationships, whenever the values are available.

interface SongAttributes {
  name: string;
  album_name: string | null;
  artist_name: string | null;
  isrc: string | null;
  artwork_url: string | null;
  track_number: number | null;
  disc_number: number | null;
  genres: string[];
  release_date: string | null;
}

Lyrics

Lyrics payload returned when lyrics are included or fetched directly.

interface Lyrics {
  text: string;
  language: string | null;
}

On this page