SpotifyApiSpotify LogoJS

Track src/structures/Track.ts#L116

Spotify api's track object.


Properties:

album artists availableMarkets discNumber duration explicit externalID externalURL id isLocal isPlayable linkedFrom name popularity previewURL restrictions trackNumber type uri

Methods:

makeCodeImage

constructor(data, client) src/structures/Track.ts#L116

No documentation found.

NameTypeDescription
dataSimplifiedTrack | TrackThe raw data received from the api.
clientClientThe spotify client.

.album src/structures/Track.ts#L97
OPTIONAL

Type:

Album

The album on which the track appears.

.artists src/structures/Track.ts#L17

Type:

Artist[]

The artists who performed the track. Each artist object includes a link in href to more detailed information about the artist.

.availableMarkets src/structures/Track.ts#L22

Type:

string[]

A list of the countries in which the track can be played.

.discNumber src/structures/Track.ts#L27

Type:

number

The disc number (usually 1 unless the album consists of more than one disc).

.duration src/structures/Track.ts#L32

Type:

number

The track length in milliseconds.

.explicit src/structures/Track.ts#L37

Type:

boolean

Whether or not the track has explicit lyrics ( true = yes it does; false = no it does not OR unknown).

.externalID src/structures/Track.ts#L102
OPTIONAL

Type:

ExternalID

Known external IDs for the track.

.externalURL src/structures/Track.ts#L42

Type:

ExternalUrl

External URLs for this track.

.id src/structures/Track.ts#L47

Type:

string

The Spotify ID for the track.

.isLocal src/structures/Track.ts#L52

Type:

boolean

Whether or not the track is from a local file.

.isPlayable src/structures/Track.ts#L57
OPTIONAL

Type:

boolean

Part of the response when Track Relinking is applied. If true , the track is playable in the given market. Otherwise false.

.linkedFrom src/structures/Track.ts#L62
OPTIONAL

Type:

LinkedTrack

Part of the response when Track Relinking is applied and is only part of the response if the track linking, in fact, exists.

.name src/structures/Track.ts#L67

Type:

string

The name of the track.

.popularity src/structures/Track.ts#L107
OPTIONAL

Type:

number

The popularity of the track. The value will be between 0 and 100, with 100 being the most popular. \

.previewURL src/structures/Track.ts#L72

Type:

string

A URL to a 30 second preview (MP3 format) of the track.

.restrictions src/structures/Track.ts#L77

Type:

Restriction[]

Included in the response when a content restriction is applied.

.trackNumber src/structures/Track.ts#L82

Type:

number

The number of the track. If an album has several discs, the track number is the number on the specified disc.

.type src/structures/Track.ts#L87

Type:

SpotifyType

The object type: “track”.

.uri src/structures/Track.ts#L92

Type:

string

The Spotify URI for the track.

.makeCodeImage(color) src/structures/Track.ts#L153

Returns a code image url from the spotify uri.

Returns:

string

Parameters:

NameTypeDescription
colorstringThe color code in hex.