Skip to main content

Tracks


getTrack​

getTrack(params)​

Get a track by id.

Create an object with the following fields and pass it as the first argument, as shown in the example above.

NameTypeDescriptionRequired?
trackIdstringThe ID of the trackRequired

getBulkTracks​

getBulkTracks(params)​

Get a list of tracks using their IDs or permalinks.

Create an object with the following fields and pass it as the first argument, as shown in the example above.

NameTypeDescriptionRequired?
idstring[]An array of IDs of tracksOptional
permalinkstring[]An array of permalinks of tracksOptional

getTrendingTracks​

getTrendingTracks(params)​

Get the top 100 trending (most popular) tracks on Audius.

Optionally create an object with the following fields and pass it as the first argument.

NameTypeDescriptionRequired?
genreGenre (can be imported from @audius/sdk)If provided, the top 100 trending tracks of the genre will be returnedOptional
timeGetTrendingTracksTimeEnum (can be imported from @audius/sdk)A time range for which to return the trending tracks. Default value is GetTrendingTracksTimeEnum.AllTimeOptional

getUndergroundTrendingTracks​

getUndergroundTrendingTracks(params)​

Get the top 100 trending underground tracks on Audius.

Optionally create an object with the following fields and pass it as the first argument.

NameTypeDescriptionRequired?
limitnumberIf provided, will return only the given number of tracks. Default is 100Optional
offsetnumberAn offset to apply to the list of results. Default value is 0Optional

searchTracks​

searchTracks(params)​

Search for tracks.

Create an object with the following fields and pass it as the first argument, as shown in the example above.

NameTypeDescriptionRequired?
querystringThe query to search forRequired

streamTrack​

streamTrack(params)​

Get the url of the track's streamable mp3 file.

Create an object with the following fields and pass it as the first argument, as shown in the example above.

NameTypeDescriptionRequired?
trackIdstringThe ID of the trackRequired

uploadTrack​

uploadTrack(params, advancedOptions?)​

Upload a track.

Create an object with the following fields and pass it as the first argument, as shown in the example above.

NameTypeDescriptionRequired?
coverArtFileFileA file that will be used as the cover art for the trackOptional
metadataUploadTrackMetadataAn object containing the details of the trackRequired
onProgress(progress: number) => voidA function that will be called with progress events as the files uploadOptional
trackFileFileThe audio file of the trackRequired
userIdstringThe ID of the userRequired

advancedOptions​

You can pass an optional advancedOptions object as the second argument.


updateTrack​

updateTrack(params, advancedOptions?)​

Update a track. If cover art or any metadata fields are not provided, their values will be kept the same as before.

Create an object with the following fields and pass it as the first argument, as shown in the example above.

NameTypeDescriptionRequired?
trackIdstringThe ID of the trackRequired
userIdstringThe ID of the userRequired
coverArtFileFileA file that will be used as the cover art for the trackOptional
metadataPartial<UploadTrackMetadata>An object containing the details of the trackRequired
onProgress(progress: number) => voidA function that will be called with progress events as the image file uploadsOptional

advancedOptions​

You can pass an optional advancedOptions object as the second argument.


deleteTrack​

deleteTrack(params, advancedOptions?)​

Delete a track

Create an object with the following fields and pass it as the first argument, as shown in the example above.

NameTypeDescriptionRequired?
trackIdstringThe ID of the trackRequired
userIdstringThe ID of the userRequired

advancedOptions​

You can pass an optional advancedOptions object as the second argument.


favoriteTrack​

favoriteTrack(params, advancedOptions?)​

Favorite a track

Create an object with the following fields and pass it as the first argument, as shown in the example above.

NameTypeDescriptionRequired?
trackIdstringThe ID of the trackRequired
userIdstringThe ID of the userRequired
metadatasee code block belowSet isSaveOfRepost to true if you are favoriting a reposted track.Optional
favoriteTrack metadata payload
{
isSaveOfRepost: boolean
}

advancedOptions​

You can pass an optional advancedOptions object as the second argument.


unfavoriteTrack​

unfavoriteTrack(params, advancedOptions?)​

Unfavorite a track

Create an object with the following fields and pass it as the first argument, as shown in the example above.

NameTypeDescriptionRequired?
trackIdstringThe ID of the trackRequired
userIdstringThe ID of the userRequired

advancedOptions​

You can pass an optional advancedOptions object as the second argument.


repostTrack​

repostTrack(params, advancedOptions?)​

Repost a track

Create an object with the following fields and pass it as the first argument, as shown in the example above.

NameTypeDescriptionRequired?
trackIdstringThe ID of the trackRequired
userIdstringThe ID of the userRequired
metadatasee code block belowSet isRepostOfRepost to true if you are reposting a reposted track.Optional
repostTrack metadata payload
{
isRepostOfRepost: boolean
}

advancedOptions​

You can pass an optional advancedOptions object as the second argument.


unrepostTrack​

unrepostTrack(params, advancedOptions?)​

Unrepost a track

Create an object with the following fields and pass it as the first argument, as shown in the example above.

NameTypeDescriptionRequired?
trackIdstringThe ID of the trackRequired
userIdstringThe ID of the userRequired

advancedOptions​

You can pass an optional advancedOptions object as the second argument.