Skip to Content

Playlist Posts

A playlist's videos in order, 100 a page.

GET
/v1/youtube/playlist/posts

Authorization

apiKey
headerAuthorizationBearer <token>

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

Query Parameters

url?string

The playlist's link.

id?string

The playlist's id, instead of url.

cursor?string

nextCursor of the previous page.

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

A page of a list, as every list endpoint answers: { "data": [...], "pagination": … }.

data*array<>
pagination*
Example Request
import { SocialAPI } from "@socialapihq/sdk";const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });const { data, pagination } = await client.youtube.playlistPosts({ id: "PLXm3b2ZSqTsc" });
Example Response
{  "data": [    {      "id": "skdOVaiRq1c",      "url": "https://www.youtube.com/watch?v=skdOVaiRq1c",      "text": null,      "createdAt": null,      "author": {        "id": "UCXuqSBlHAE6Xw-yeJA0Tunw",        "username": "LinusTechTips",        "displayName": "Linus Tech Tips",        "avatarUrl": null,        "verified": false,        "url": "https://www.youtube.com/@LinusTechTips"      },      "stats": {        "views": 1300000,        "likes": null,        "comments": null,        "shares": null,        "saves": null,        "engagementRate": null      },      "media": [        {          "kind": "video",          "url": null,          "thumbnailUrl": "https://i.ytimg.com/vi/skdOVaiRq1c/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLD53p9Eutt1Tbk_OfZSNQYUG77X5g",          "width": null,          "height": null,          "durationSeconds": 938        }      ],      "hashtags": [],      "mentions": [],      "ext": {        "kind": "video",        "title": "Don’t Break Into my Grandparents House",        "durationSeconds": 938,        "publishedText": "7 days ago",        "category": null,        "keywords": [],        "chapters": [],        "music": [],        "liveNow": false,        "unlisted": false,        "familySafe": null,        "membersOnly": false,        "channelSubscribers": null      }    }  ],  "pagination": {    "nextCursor": null,    "hasMore": false  }}