Docs incorrect or hard to follow?

Tweet me

so I can make things better! 😊

Soundcloud Wrapper

Likes

API for liking and unliking tracks and playlists.

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 trackId = 987654321
 
const like = await sc.likes.likeTrack(token, trackId)
return res.status(200).json(like)

likeTrack

Likes a track.

likes-controller.ts
// method: POST
const like = await sc.likes.likeTrack(token, trackId)

Params

PropTypeDefault
token
string
-
trackId
number
-

unlikeTrack

Unlikes a track.

likes-controller.ts
// method: DELETE
const like = await sc.likes.unlikeTrack(token, trackId)
PropTypeDefault
token
string
-
trackId
number
-

likePlaylist

Likes a playlist.

likes-controller.ts
// method: POST
const like = await sc.likes.likePlaylist(token, playlistId)
PropTypeDefault
token
string
-
playlistId
number
-

unlikePlaylist

Unlikes a playlist.

likes-controller.ts
// method: DELETE
const like = await sc.likes.unlikePlaylist(token, trackId)
PropTypeDefault
token
string
-
playlistId
number
-

More Info

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

On this page