Skip to main content

Tracks

Methods

getBulkTracks

getBulkTracks(requestParameters?): Promise<Track[]>

Gets a list of tracks using their IDs or permalinks

Example:


const tracks = await audiusSdk.tracks.getBulkTracks();

Parameters

NameType
requestParametersGetBulkTracksRequest

Returns

Promise<Track[]>

Inherited from

GeneratedTracksApi.getBulkTracks


getTrack

getTrack(requestParameters): Promise<Track>

Gets a track by ID

Example:


const track = await audiusSdk.tracks.getTrack({
trackId: "D7KyD",
});

Parameters

NameType
requestParametersGetTrackRequest

Returns

Promise<Track>

Inherited from

GeneratedTracksApi.getTrack


getTrendingTracks

getTrendingTracks(requestParameters?): Promise<Track[]>

Gets the top 100 trending (most popular) tracks on Audius

Example:


const tracks = await audiusSdk.tracks.getTrendingTracks();

Parameters

NameType
requestParametersGetTrendingTracksRequest

Returns

Promise<Track[]>

Inherited from

GeneratedTracksApi.getTrendingTracks


searchTracks

searchTracks(requestParameters): Promise<Track[]>

Search for a track or tracks

Example:


const searchResult = await audiusSdk.tracks.searchTracks({
query: "skrillex",
});

Parameters

NameType
requestParametersSearchTracksRequest

Returns

Promise<Track[]>

Inherited from

GeneratedTracksApi.searchTracks


streamTrack

streamTrack(requestParameters): Promise<string>

Get the url of the track's streamable mp3 file

Example:


const url = await audiusSdk.tracks.streamTrack({
trackId: "PjdWN",
});
const audio = new Audio(url);
audio.play();

Parameters

NameType
requestParametersStreamTrackRequest

Returns

Promise<string>