Docs incorrect or hard to follow?

Tweet me

so I can make things better! 😊

Soundcloud Wrapper

Playlist

API for interacting with the playlist API endpoint.

Example

Tweak example to fit your tech stack and use case.
likes-controller.ts
import SoundCloud from "soundcloud-wrapper"
 
const sc = new SoundCloud(
  process.env.CLIENT_ID,
  process.env.CLIENT_SECRET,
  process.env.REDIRECT_URI
  process.env.PKCE_CODE_VERIFIER
)
 
// get auth token stored in db
// check the auth flow guide if you need to generate a token
const token = await Token.find({userId: 123456789})
const playlistId = 123456789
 
const playlist = await sc.playlist.getPlaylist(token, playlistId)
return res.status(200).json(playlist)

getPlaylist

Gets a specific playlist.

playlist-controller.ts
// method: GET
const playlist = await sc.playlist.getPlaylist(token, playlistId)
PropTypeDefault
token
string
-
playlistId
number
-

getPlaylistTracks

Gets the tracks of a specific playlist.

playlist-controller.ts
// method: GET
const playlist = await sc.playlist.getPlaylistTracks(token, playlistId)
PropTypeDefault
token
string
-
playlistId
number
-

getPlaylistReposters

Returns the reposters of a specific playlist.

playlist-controller.ts
// method: GET
const playlist = await sc.playlist.getPlaylistReposters(token, playlistId)
PropTypeDefault
token
string
-
playlistId
number
-

createPlaylist

Creates a playlist.

playlist-controller.ts
// method: POST
const playlist = await sc.playlist.createPlaylist(token, playlistData)
PropTypeDefault
token
string
-
playlistData
object
-
playlistData.title
string
-
playlistData.description
string
-
playlistData.sharing
string
-
playlistData.tracks
array
-

deletePlaylist

Deletes a specific playlist.

playlist-controller.ts
// method: DELETE
const playlist = await sc.playlist.deletePlaylist(token, playlistId)
PropTypeDefault
token
string
-
playlistId
number
-

More Info

For more info on endpoints see the official Soundcloud API docs.

On this page