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

    Function getTracks

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

      Parameters

      • token: string

        OAuth access token

      • ids: (string | number)[]

        Array of track IDs (numeric or string URNs)

      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.

      import { getTracks } from 'soundcloud-api-ts';

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