Quick Start

Request

import {
  Supadata,
  VideoIds
} from '@supadata/js';

// Initialize the client
const supadata = new Supadata({
  apiKey: 'YOUR_API_KEY',
});

const playlistVideos: VideoIds = await supadata.youtube.playlist.videos({
  id: 'https://www.youtube.com/playlist?list=PLlaN88a7y2_plecYoJxvRFTLHVbIVAOoc', // can be url or playlist id
  limit: 10,
});

Response

{
  "videoIds": ["dQw4w9WgXcQ", "xvFZjo5PgG0"],
  "shortIds": ["xvFZjo5PgG0", "dQw4w9WgXcQ"],
  "liveIds": ["dQw4w9WgXcQ", "xvFZjo5PgG0"]
}

Specification

Endpoint

GET https://api.supadata.ai/v1/youtube/playlist/videos Each request requires an x-api-key header with your API key available after signing up. Get your API key here.

Query Parameters

ParameterTypeRequiredDescription
idstringYesYouTube playlist URL or ID. See Supported YouTube URL Formats.
limitnumberNoMaximum number of video IDs to return. Default: 100. Max: 5000

Response Format

{
  "videoIds": string[],  // List of vertical YouTube video IDs
  "shortIds": string[],  // List of Shorts IDs
  "liveIds": string[]   // List of live video IDs
}

Error Codes

The API returns HTTP status codes and error codes. See this page for more details.

Supported YouTube Identifiers

The universal id parameter supports various YouTube URL and ID formats. See this page for more details.

Working with Playlist Videos

After retrieving the list of video IDs, you can:
  1. Get metadata for each video using the Video Metadata endpoint
  2. Get transcripts for each video using the Transcript endpoint
For large playlists, consider using the limit parameter to control the number of results returned.

Pricing

  • 1 playlist videos request = 1 credit