getPlaylist
getPlaylist(
params)
Get a playlist by id.
Example:
const { data: playlist } = await audiusSdk.playlists.getPlaylist({
playlistId: 'D7KyD',
})
console.log(playlist)Params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
playlistId | string | The ID of the playlist | Required |
Returns
Returns a Promise containing an object with a data field. data contains a
PlaylistResponse object.
getBulkPlaylists
getBulkPlaylists(
params)
Get a list of playlists by ID, UPC, or permalink.
Example:
const { data: playlists } = await audiusSdk.playlists.getBulkPlaylists({
id: ['D7KyD', '68yPZb'],
})
console.log(playlists)Params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
id | string[] | An array of playlist IDs | Optional |
permalink | string[] | An array of permalinks of playlists | Optional |
upc | string[] | An array of UPC codes | Optional |
userId | string | The ID of the user making the request | Optional |
Returns
Returns a Promise containing an object with a data field. data is an array of
PlaylistResponse objects.
getPlaylistTracks
getPlaylistTracks(
params)
Get the tracks in a playlist.
Example:
const { data: tracks } = await audiusSdk.playlists.getPlaylistTracks({
playlistId: 'D7KyD',
})
console.log(tracks)Params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
playlistId | string | The ID of the playlist | Required |
Returns
The return type is the same as getBulkTracks
getTrendingPlaylists
getTrendingPlaylists(
params?)
Get the top trending playlists on Audius.
Example:
const { data: playlists } = await audiusSdk.playlists.getTrendingPlaylists()
console.log(playlists)Params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
time | GetTrendingPlaylistsTimeEnum | The time period for trending playlists. Default: 'week' | Optional |
Returns
Returns a Promise containing an object with a data field. data is an array of
PlaylistResponse objects.
searchPlaylists
searchPlaylists(
params)
Search for playlists.
Example:
const { data: playlists } = await audiusSdk.playlists.searchPlaylists({
query: 'skrillex',
})
console.log(playlists)Params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
query | string | The query to search for | Required |
Returns
Returns a Promise containing an object with a data field. data is an array of
PlaylistResponse objects.
createPlaylist
createPlaylist(
params,requestInit?)
Create a new playlist.
To upload a cover image, use the Uploads API. Upload your image first to
obtain a CID, then pass it as playlistImageSizesMultihash in the metadata object.
Example:
// Optional: Upload a cover image first
const { start: startImageUpload } = audiusSdk.uploads.createImageUpload({
file: coverImageFile,
})
const coverArtCid = await startImageUpload()
const { data } = await audiusSdk.playlists.createPlaylist({
userId: '7eP5n',
metadata: {
playlistName: 'Summer Vibes 2024',
description: 'The best summer tracks',
playlistContents: [
{ trackId: 'ePR5Ll', timestamp: Math.round(Date.now() / 1000) },
{ trackId: 'GManBz', timestamp: Math.round(Date.now() / 1000) },
],
playlistImageSizesMultihash: coverArtCid,
},
})
console.log('New playlist ID:', data.playlistId)Params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
userId | string | The ID of the user | Required |
metadata | CreatePlaylistRequestBody | The playlist metadata | Required |
See CreatePlaylistRequestBody for all available metadata fields.
You can pass an optional
RequestInit object as the second
argument to customize the underlying fetch request (e.g. set custom headers, abort signal, etc.).
Returns
Returns a Promise resolving to an object with the following fields:
{
playlistId?: string
transactionHash?: string
}updatePlaylist
updatePlaylist(
params,requestInit?)
Update an existing playlist's metadata. If any metadata fields are not provided, their values will
be kept the same as before. To replace cover art, upload a new image via the
Uploads API and pass the new CID in metadata.
Example:
// Optional: Upload a new cover image
const { start: startImageUpload } = audiusSdk.uploads.createImageUpload({
file: newCoverImageFile,
})
const coverArtCid = await startImageUpload()
const { data } = await audiusSdk.playlists.updatePlaylist({
playlistId: 'D7KyD',
userId: '7eP5n',
metadata: {
playlistName: 'Summer Vibes 2024 (Updated)',
description: 'Updated playlist description',
playlistContents: [
{ trackId: 'ePR5Ll', timestamp: Math.round(Date.now() / 1000) },
{ trackId: 'GManBz', timestamp: Math.round(Date.now() / 1000) },
{ trackId: 'KWJm0x', timestamp: Math.round(Date.now() / 1000) },
],
playlistImageSizesMultihash: coverArtCid,
},
})
console.log('Updated playlist:', data)Params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
playlistId | string | The ID of the playlist | Required |
userId | string | The ID of the user | Required |
metadata | UpdatePlaylistRequestBody | The playlist metadata to update | Required |
All fields are optional — only include the fields you want to change. See
UpdatePlaylistRequestBody for all available fields.
You can pass an optional
RequestInit object as the second
argument to customize the underlying fetch request (e.g. set custom headers, abort signal, etc.).
Returns
Returns a Promise resolving to an object with the following fields:
{
transactionHash?: string
}deletePlaylist
deletePlaylist(
params,requestInit?)
Delete a playlist.
Example:
await audiusSdk.playlists.deletePlaylist({
playlistId: 'D7KyD',
userId: '7eP5n',
})Params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
playlistId | string | The ID of the playlist | Required |
userId | string | The ID of the user | Required |
You can pass an optional
RequestInit object as the second
argument to customize the underlying fetch request (e.g. set custom headers, abort signal, etc.).
Returns
Returns a Promise resolving to an object with the following fields:
{
transactionHash?: string
}favoritePlaylist
favoritePlaylist(
params,requestInit?)
Favorite a playlist.
Example:
await audiusSdk.playlists.favoritePlaylist({
playlistId: 'D7KyD',
userId: '7eP5n',
})Params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
playlistId | string | The ID of the playlist | Required |
userId | string | The ID of the user | Required |
You can pass an optional
RequestInit object as the second
argument to customize the underlying fetch request (e.g. set custom headers, abort signal, etc.).
Returns
Returns a Promise resolving to an object with the following fields:
{
transactionHash?: string
}unfavoritePlaylist
unfavoritePlaylist(
params,requestInit?)
Unfavorite a playlist.
Example:
await audiusSdk.playlists.unfavoritePlaylist({
playlistId: 'D7KyD',
userId: '7eP5n',
})Params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
playlistId | string | The ID of the playlist | Required |
userId | string | The ID of the user | Required |
You can pass an optional
RequestInit object as the second
argument to customize the underlying fetch request (e.g. set custom headers, abort signal, etc.).
Returns
Returns a Promise resolving to an object with the following fields:
{
transactionHash?: string
}repostPlaylist
repostPlaylist(
params,requestInit?)
Repost a playlist.
Example:
await audiusSdk.playlists.repostPlaylist({
playlistId: 'D7KyD',
userId: '7eP5n',
})Params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
playlistId | string | The ID of the playlist | Required |
userId | string | The ID of the user | Required |
You can pass an optional
RequestInit object as the second
argument to customize the underlying fetch request (e.g. set custom headers, abort signal, etc.).
Returns
Returns a Promise resolving to an object with the following fields:
{
transactionHash?: string
}unrepostPlaylist
unrepostPlaylist(
params,requestInit?)
Unrepost a playlist.
Example:
await audiusSdk.playlists.unrepostPlaylist({
playlistId: 'D7KyD',
userId: '7eP5n',
})Params
Create an object with the following fields and pass it as the first argument, as shown in the example above.
| Name | Type | Description | Required? |
|---|---|---|---|
playlistId | string | The ID of the playlist | Required |
userId | string | The ID of the user | Required |
You can pass an optional
RequestInit object as the second
argument to customize the underlying fetch request (e.g. set custom headers, abort signal, etc.).
Returns
Returns a Promise resolving to an object with the following fields:
{
transactionHash?: string
}Type Reference
PlaylistResponse
| Field | Type | Description |
|---|---|---|
artwork | object | Artwork images (see below) |
artwork._1000x1000 | string | URL of 1000x1000 artwork |
artwork._150x150 | string | URL of 150x150 artwork |
artwork._480x480 | string | URL of 480x480 artwork |
coverArtSizes | string | CID of the cover art sizes |
description | string | Playlist description |
favoriteCount | number | Number of favorites |
id | string | Playlist ID |
isAlbum | boolean | Whether this is an album |
isImageAutogenerated | boolean | Whether the cover art is auto-generated |
isPrivate | boolean | Whether the playlist is private |
permalink | string | Permalink URL |
playlistContents | object[] | Array of track entries (trackId, timestamp, metadataTimestamp) |
playlistName | string | Name of the playlist |
repostCount | number | Number of reposts |
totalPlayCount | number | Total play count |
user | object | The playlist owner (see User) |
GetTrendingPlaylistsTimeEnum
| Value | String | Description |
|---|---|---|
Week | 'week' | Past week (default) |
Month | 'month' | Past month |
Year | 'year' | Past year |
AllTime | 'allTime' | All time |
CreatePlaylistRequestBody
| Field | Type | Required | Description |
|---|---|---|---|
playlistName | string | Yes | The name of the playlist |
playlistId | string | No | Optional playlist ID (auto-generated if not provided) |
playlistImageSizesMultihash | string | No | CID of the cover art image (from Uploads API) |
description | string | No | The playlist description |
isAlbum | boolean | No | Whether this is an album |
isPrivate | boolean | No | Whether the playlist is private |
genre | Genre | No | Playlist/album genre |
mood | Mood | No | Playlist/album mood |
tags | string | No | Comma-separated tags |
license | string | No | License type |
upc | string | No | Universal Product Code (for albums) |
releaseDate | Date | No | Release date |
playlistContents | PlaylistAddedTimestamp[] | No | Array of tracks to include in the playlist |
isStreamGated | boolean | No | Whether streaming is behind an access gate |
isScheduledRelease | boolean | No | Whether this is a scheduled release |
streamConditions | AccessGate | No | Conditions for stream access gating |
ddexApp | string | No | DDEX application identifier |
ddexReleaseIds | object | No | DDEX release identifiers |
artists | DdexResourceContributor[] | No | DDEX resource contributors / artists |
copyrightLine | object | No | Copyright line |
producerCopyrightLine | object | No | Producer copyright line |
parentalWarningType | string | No | Parental warning type |
isImageAutogenerated | boolean | No | Whether the image is autogenerated |
UpdatePlaylistRequestBody
All fields are optional — only include the fields you want to change.
| Field | Type | Required | Description |
|---|---|---|---|
playlistName | string | No | The name of the playlist |
playlistImageSizesMultihash | string | No | CID of the cover art image (from Uploads API) |
description | string | No | The playlist description |
isAlbum | boolean | No | Whether this is an album |
isPrivate | boolean | No | Whether the playlist is private |
genre | Genre | No | Playlist/album genre |
mood | Mood | No | Playlist/album mood |
tags | string | No | Comma-separated tags |
license | string | No | License type |
upc | string | No | Universal Product Code (for albums) |
releaseDate | Date | No | Release date |
playlistContents | PlaylistAddedTimestamp[] | No | Array of tracks in the playlist (replaces all) |
isStreamGated | boolean | No | Whether streaming is behind an access gate |
isScheduledRelease | boolean | No | Whether this is a scheduled release |
streamConditions | AccessGate | No | Conditions for stream access gating |
ddexApp | string | No | DDEX application identifier |
ddexReleaseIds | object | No | DDEX release identifiers |
artists | DdexResourceContributor[] | No | DDEX resource contributors / artists |
copyrightLine | object | No | Copyright line |
producerCopyrightLine | object | No | Producer copyright line |
parentalWarningType | string | No | Parental warning type |
isImageAutogenerated | boolean | No | Whether the image is autogenerated |
PlaylistAddedTimestamp
Represents a track entry within a playlist.
| Field | Type | Required | Description |
|---|---|---|---|
trackId | string | Yes | The ID of the track |
timestamp | number | Yes | Timestamp when the track was added (seconds) |
metadataTimestamp | number | No | Optional metadata timestamp (seconds) |