Get full playlist

Fetch complete playlist with all videos, stats, and total duration.

GET
/api/playlist/{id}

Path Parameters

id*string

Playlist ID or URL

Response Body

application/json

application/json

import { Router } from 'express'import { client } from '../lib.js'const router = Router()router.get('/playlist/:id', async (req, res) => {  const { id } = req.params  const playlist = await client!.playlist(id)  res.json(playlist)})export const routes = router
{
  "id": "string",
  "title": "string",
  "description": "string",
  "thumbnails": {
    "default": {
      "url": "string",
      "width": 0,
      "height": 0
    },
    "medium": {
      "url": "string",
      "width": 0,
      "height": 0
    },
    "high": {
      "url": "string",
      "width": 0,
      "height": 0
    },
    "standard": {
      "url": "string",
      "width": 0,
      "height": 0
    },
    "maxres": {
      "url": "string",
      "width": 0,
      "height": 0
    }
  },
  "videoCount": 0,
  "totalDuration": 0,
  "totalDurationFmt": "string",
  "videos": [
    {
      "id": "string",
      "title": "string",
      "description": "string",
      "channelTitle": "string",
      "publishedAt": "string",
      "duration": 0,
      "durationFmt": "string",
      "views": 0,
      "viewsFmt": "string",
      "likes": 0,
      "likesFmt": "string",
      "thumbnails": {
        "default": {
          "url": "string",
          "width": 0,
          "height": 0
        },
        "medium": {
          "url": "string",
          "width": 0,
          "height": 0
        },
        "high": {
          "url": "string",
          "width": 0,
          "height": 0
        },
        "standard": {
          "url": "string",
          "width": 0,
          "height": 0
        },
        "maxres": {
          "url": "string",
          "width": 0,
          "height": 0
        }
      }
    }
  ]
}
{
  "error": {
    "code": 0,
    "message": "string",
    "details": [
      "string"
    ]
  }
}