TrackManager src/managers/Track.ts#L18
A manager to perform actions which belongs to the spotify track web api.
Properties:
clientMethods:
get getAudioAnalysis getAudioFeatures getMultiple getMultipleAudioFeatures searchconstructor(client) src/managers/Track.ts#L18
No documentation found.
Name | Type | Description |
---|---|---|
client | Client | The spotify api client. |
.get(id, market, force) src/managers/Track.ts#L50
Get an track's information.
const track = await client.tracks.get('id');
Returns:
Parameters:
Name | Type | Description |
---|---|---|
id | string | The spotify track id. |
market | string | Only tracks that are available in that market will be returned. |
force | boolean | When true, will directly fetch else will search for the cache first! |
.getAudioAnalysis(id) src/managers/Track.ts#L99
Get the audio analysis of the track. Returned type [AudioAnalysis] is not a camelcase object and not documented.
const audioAnalysis = await client.tracks.getAudioAnalysis('id');
Returns:
Parameters:
Name | Type | Description |
---|---|---|
id | string | The spotify playlist id. |
.getAudioFeatures(id) src/managers/Track.ts#L75
Get the audio features of the track. Returned type [AudioFeatures] is not a camelcased object.
const audioFeatures = await client.tracks.getAudioFeatures('id');
Returns:
Parameters:
Name | Type | Description |
---|---|---|
id | string | The spotify track id. |
.getMultiple(ids, market) src/managers/Track.ts#L63
Get the information of multiple spotify tracks in one fetch.
const tracks = await client.tracks.getMultiple(['id1', 'id2']);
Returns:
Parameters:
Name | Type | Description |
---|---|---|
ids | string[] | An array of spotify ids. |
market | string | Only tracks that are available in that market will be returned. |
.getMultipleAudioFeatures(ids) src/managers/Track.ts#L86
Get audio features of multiple tracks. Returned type [AudioFeatures[]] is not a camelcased object.
const audioFeatures = await client.tracks.getMultipleAudioFeatures('id1', 'is2');
Returns:
Parameters:
Name | Type | Description |
---|---|---|
ids | string[] | The array of spotify ids. |
.search(query, options) src/managers/Track.ts#L27
Search for spotify tracks with query.
const results = await client.tracks.search('some search');
Returns:
Parameters:
Name | Type | Description |
---|---|---|
query | string | The query to search. |
options | SearchOptions | Some search options to make the search more efficient. |