Skip to Content

Playlist

A playlist with its owner and video count.

GET
/v1/youtube/playlist

Authorization

apiKey
headerAuthorizationBearer <token>

An API key from the dashboard: Authorization: Bearer sapi_….

Query Parameters

url?string

The playlist's link (https://www.youtube.com/playlist?list=PL…).

id?string

The playlist's id, instead of url.

maxAge?integer

How old a cached answer may be, in seconds; 0 always fetches. Default and most: the endpoint's cache lifetime.

Formatint64
Range0 <= value

Response Body

The answer.

application/json
  1. response

One item, as every single-item endpoint answers: { "data": … }.

data*

A playlist, or a podcast's show.

Example Request
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    }  }}