soundcloud-api-ts - v1.13.4
    Preparing search index...

    Track namespace — fetch, update, delete tracks and their metadata.

    Index

    Constructors

    Methods

    • Fetch multiple tracks by their IDs in a single request.

      Parameters

      • ids: (string | number)[]

        Array of track IDs (numeric or string URNs)

      • Optionaloptions: TokenOption

        Optional token override

      Returns Promise<SoundCloudTrack[]>

      Array of track objects (may be shorter than ids if some tracks are unavailable)

      When the API returns an error

      When more than 200 IDs are provided

      SoundCloud's API likely caps at ~200 IDs per request. Passing more than 200 IDs will throw immediately without making a network request.

      const tracks = await sc.tracks.getTracks([123456, 234567, 345678]);
      tracks.forEach(t => console.log(t.title));