Resources
Resource Models
Song, album, and artist model shapes.
Song
interface Song extends Resource {
type: "song";
attributes: {
name: string;
albumName?: string;
artistNames: string[];
isrc?: string;
artworkUrl?: string;
trackNumber?: number;
discNumber?: number;
genres?: string[];
releaseDate?: string;
durationMs?: number;
};
relationships: {
albums: List<Album>;
artists: List<Artist>;
};
}albumName is the name of the first album. Albums in relationships.albums have no relationships.
Album
interface Album extends Resource {
type: "album";
attributes: {
name: string;
trackCount: number;
artistNames: string[];
artworkUrl?: string;
upc?: string;
label?: string;
genres?: string[];
releaseDate?: string;
};
relationships?: {
artists: List<Artist>;
};
}relationships is present except when the album is nested in a song's relationships.
Artist
interface Artist extends Resource {
type: "artist";
attributes: {
name: string;
artworkUrl?: string;
genres?: string[];
};
}