YouTube Data API
List items in a YouTube playlist
Use playlistItems.list to retrieve a playlist’s videos and continue through nextPageToken. The generated client exposes the same request with a typed resource response.
Documentation reviewed · 2 methods with sources
Ways to do it
- API: GET /youtube/v3/playlistItems?part=snippet&playlistId=...
- SDK: youtube.playlistItems.list({ part, playlistId })
API
GET /youtube/v3/playlistItems?part=snippet&playlistId=...
List playlist item resources for a playlist ID and request the fields needed for each item.
Read source: YouTube playlistItems.list reference- Requirements
- A project with the YouTube Data API enabled, a playlist ID, and an API key for public data or OAuth access to a private playlist.
- Limitations
- The default page size is five items and the maximum is 50. Each request costs one quota unit.
Example shell
curl --fail "https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId=$PLAYLIST_ID&maxResults=50&key=$YOUTUBE_API_KEY"SDK
youtube.playlistItems.list({ part, playlistId })
Call the generated Google API client and read playlist item data from the typed response.
Read source: Pinned YouTube Node.js client method- Requirements
- The googleapis Node.js client with a configured API key or OAuth credential and a playlist ID.
- Limitations
- Follow nextPageToken for another page. Private playlists require authorization by a user who can access them.
Example text
const { data } = await youtube.playlistItems.list({ part: ['snippet'], playlistId, maxResults: 50 });