Playlist
A playlist with its owner and video count.
GET
apiKeyheader
AuthorizationBearer <token>An API key from the dashboard: Authorization: Bearer sapi_….
url?stringThe playlist's link (https://www.youtube.com/playlist?list=PL…).
id?stringThe playlist's id, instead of url.
maxAge?integerHow old a cached answer may be, in seconds; 0 always fetches. Default and most: the endpoint's cache lifetime.
Format
int64Range
0 <= valueThe answer.
application/json- response
One item, as every single-item endpoint answers: { "data": … }.
data*A playlist, or a podcast's show.
import { SocialAPI } from "@socialapihq/sdk";const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });const { data } = await client.youtube.playlist({ id: "PLXm3b2ZSqTsc" });Example Response
{ "data": { "id": "PLXm3b2ZSqTsc", "name": "Home Security", "url": "https://www.youtube.com/playlist?list=PLXm3b2ZSqTsc", "coverUrl": "https://i.ytimg.com/vi/skdOVaiRq1c/hqdefault.jpg?sqp=-oaymwEXCNACELwBSFryq4qpAwkIARUAAIhCGAE=&rs=AOn4CLDL9YSkvZ65Ldue0eBW4rVi5tA79A", "posts": 1, "ext": { "description": "Videos about cameras, NVRs, and other home security products", "views": 70, "owner": { "id": "UCXuqSBlHAE6Xw-yeJA0Tunw", "username": "LinusTechTips", "displayName": null, "avatarUrl": "https://yt3.ggpht.com/gnvYLhXy8FAlPXZ2RTrkrgj-5kyt0vdE2FUGVOiKGdEZIa-wN5A-7nwZBlWJLzUMmoh1NWAU=s48-c-k-c0x00ffffff-no-rj", "verified": false, "url": "https://www.youtube.com/@LinusTechTips" }, "updatedText": null, "podcast": false } }}