Get playlist
getPlaylist(id, query?, options?): Playlist
GET
https://api.ytapi.dev/v1/playlists/{id}
1 Credit
Returns the playlist's details and its first page of videos (up to 100). For the next page, call the same endpoint with cursor set to the next_cursor you got; repeat until has_more is false. Each page costs 1 credit. Pages after the first carry the videos only, not the playlist details.
Security
API Key
All requests require a valid API key from the developer dashboard.
Headers: Authorization: Bearer YOUR_API_KEYorX-API-Key: YOUR_API_KEY
See Authentication for headers and rate limits.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
idpath | string | Yes | Playlist ID ( |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
cursorquery | string | No |
|
Response (HTTP 200)
{
"playlist_id": string, // Canonical playlist ID (PL...)
"title": string, // Playlist title
"video_count": number, // Total videos in the playlist
"view_count_text": string, // Formatted view count (e.g. "25,616 views")
"author": string, // Owner channel name
"thumbnails": [ // Artwork at one or more sizes
{
"url": string,
"width": number,
"height": number
}
],
"videos": [ // This page of videos
{
"video_id": string, // 11-character video ID
"title": string, // Video title
"index": number, // Position within the playlist (1-based)
"length_seconds": number, // Duration in seconds
"length_text": string, // Duration text (e.g. "3:00:00")
"author": string // Video creator name
}
],
"has_more": boolean, // Whether another page is available
"next_cursor": string | null // Opaque cursor for the next page, or null
}