Docs incorrect or hard to follow?

Tweet me

so I can make things better! 😊

Soundcloud Wrapper

Search

API for interacting with the search 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 query = "track name"
 
const search = await sc.search.tracks(token, query)
return res.status(200).json(search)

tracks

Searches for tracks related to the provided query and returns the data

search-controller.ts
// method: GET
const search = await sc.search.tracks(token, query)
PropTypeDefault
token
string
-
query
string
-

playlists

Searches for playlists related to the provided query and returns the data

search-controller.ts
// method: GET
const search = await sc.search.playlists(token, query)
PropTypeDefault
token
string
-
query
string
-

users

Searches for users related to the provided query and returns the data

search-controller.ts
// method: GET
const search = await sc.search.users(token, query)
PropTypeDefault
token
string
-
query
string
-

More Info

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

On this page