GET
/
youtube
/
playlist
/
videos
import { Supadata } from '@supadata/js';

const supadata = new Supadata({
apiKey: 'YOUR_API_KEY',
});
const videos = await supadata.youtube.playlist.videos({
id: 'https://www.youtube.com/playlist?list=PLlaN88a7y2_plecYoJxvRFTLHVbIVAOoc', // can be id or url
limit: 20, // Optional: limit the number of videos to fetch
});
console.log(`Found ${videos.videoIds.length} videos`);
{
  "videoIds": [
    "dQw4w9WgXcQ",
    "xvFZjo5PgG0"
  ],
  "shortIds": [
    "dQw4w9WgXcQ",
    "xvFZjo5PgG0"
  ],
  "liveIds": [
    "dQw4w9WgXcQ",
    "xvFZjo5PgG0"
  ]
}

Authorizations

x-api-key
string
header
required

Query Parameters

id
string
required

YouTube playlist URL or ID. See supported URL formats.

Examples:

"https://www.youtube.com/playlist?list=PLlaN88a7y2_plecYoJxvRFTLHVbIVAOoc"

"PLlaN88a7y2_plecYoJxvRFTLHVbIVAOoc"

limit
number
default:100

Maximum number of video IDs to return

Required range: 1 <= x <= 5000
Example:

10

Response

200
application/json

Successfully fetched playlist video IDs

The response is of type object.