Guide
YouTube Playlist Scraper for Node.js
Fetch playlist information and iterate through video items with pagination.
1
Fetch the playlist
Call getPlaylistItems with a playlist ID.
2
Choose a page size
Use the optional limit from 10 to 100, defaulting to 50.
3
Iterate
Process videos and call nextPage() until it returns null.
js
import { getPlaylistItems } from "ytsearch.js";
const result = await getPlaylistItems("PLBCF2DAC6FFB574DE", {
limit: 50,
});
console.log(result.playlist);
console.log(result.videos);