YouTube channel playlists API
A channel’s playlists with video counts, in the channel’s order, newest or last updated first.
GET /v1/youtube/channels/{channel}/playlistsBeta1 credit per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/youtube/channels/@mkbhd/playlists",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()Response
200 · 1 credit{ "kind": "youtube#playlistListResponse", "items": [ { "kind": "youtube#playlist", "id": "PLBsP89CPrMeMV1oP42Zn2DrWpnFoSaufA", "snippet": { "title": "Retro Tech", "channelId": "UCBJycsmduvYEL83R_U4JriQ", "channelTitle": "Marques Brownlee", "thumbnails": { "high": { "url": "https://i9.ytimg.com/s_p/PLBsP89CPrMeMV1oP42Zn2DrWpnFoSaufA/landscape_maxresdefault.jpg?sqp=CPzCmNgGir7X7AMICI_G--4FEAE=…", "width": 2560, "height": 1440 } } }, "contentDetails": { "itemCount": 6 } }, { "kind": "youtube#playlist", "id": "PLBsP89CPrMeP1Xi1zQX87mq3mhkvFHWZ4", "snippet": { "title": "Retro Tech", "channelId": "UCBJycsmduvYEL83R_U4JriQ", "channelTitle": "Marques Brownlee", "thumbnails": { "high": { "url": "https://i.ytimg.com/vi/Oy8zSYKkczI/hqdefault.jpg?sqp=-oaymwEXCOADEI4CSFryq4qpAwkIARUAAIhCGAE=&rs=AOn4CLCg6EpaTY_KSrK57S-…", "width": 480, "height": 270 } } }, "contentDetails": { "itemCount": 1 } }, "… 1 more" ], "pageInfo": { "resultsPerPage": 4 }}Parameters
| Name | Type | Description |
|---|---|---|
channelpath · required | string | A channel id (UC…), a handle with or without the @, or any channel URL (/@handle, /channel/UC…, /c/name, /user/name). Example: @MrBeast. |
sortquery | "default" | "newest" | "last_video_added" | default, newest or last_video_added. One of default, newest, last_video_added. |
afterquery | string | The previous page’s nextPageToken. Tokens last 6 hours. |
Response fields
200 with a YouTubePlaylistList, in the shape of YouTube Data API v3 resources.
| Field | Type | Description |
|---|---|---|
kind | "youtube#playlistListResponse" | |
items | YouTubePlaylist[] | |
nextPageToken | string | Pass as after for the next page. Absent on the last page. Lasts 6 hours. |
pageInfo | object |
Status codes
| Status | Meaning |
|---|---|
200 | A page of playlists. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | The video, channel, playlist or post does not exist, was removed, or has nothing there. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | YouTube is temporarily unavailable. Retryable; nothing was charged. |
Every error has code, message, hint and retryable. All error codes
Questions
Podcasts?
They have their own endpoint.
YouTube is a trademark of Google LLC. We are not affiliated with or endorsed by Google or YouTube.