100 free credits. No credit card required. Get a key

YouTube playlist API

A YouTube playlist and its videos, 100 a page, as Data API youtube#playlistItems, with the playlist’s title, owner and counts on the first page.

GET /v1/youtube/playlists/{id}Beta1 credit per callRefunded on failure
import os, requests

res = requests.get(
    "https://api.groundsocial.dev/v1/youtube/playlists/PLFgquLnL59alCl_2TQvOiD5Vgm1hCaGSI",
    headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()
Response
200 · 1 credit
{
"kind": "youtube#playlistItemListResponse",
"playlist": {
"kind": "youtube#playlist",
"id": "PLFgquLnL59alCl_2TQvOiD5Vgm1hCaGSI",
"snippet": {
"title": "Popular Music Videos",
"channelId": "UC-9-kyTW8ZkZNDHQJ6FgpwQ",
"channelTitle": "Music",
"thumbnails": {
"high": {
"url": "https://i.ytimg.com/vi/fOT0BUpITw8/hqdefault.jpg?sqp=-oaymwEXCNACELwBSFryq4qpAwkIARUAAIhCGAE=&rs=AOn4CLDjsUIQ80ddZ3EkanN…"
}
}
},
"contentDetails": {
"itemCount": 182
},
"statistics": {
"viewCount": "1045679119"
}
},
"items": [
{
"kind": "youtube#playlistItem",
"id": "fOT0BUpITw8",
"snippet": {
"playlistId": "PLFgquLnL59alCl_2TQvOiD5Vgm1hCaGSI",
"position": 0,
"title": "BELLAKEO (Video Oficial) - Peso Pluma, Anitta",
"thumbnails": {
"default": {
"url": "https://i.ytimg.com/vi/fOT0BUpITw8/default.jpg",
"width": 120,
"height": 90
},
"medium": {
"url": "https://i.ytimg.com/vi/fOT0BUpITw8/mqdefault.jpg",
"width": 320,
"height": 180
},
"high": {
"url": "https://i.ytimg.com/vi/fOT0BUpITw8/hqdefault.jpg",
"width": 480,
"height": 360
},
"standard": {
"url": "https://i.ytimg.com/vi/fOT0BUpITw8/sddefault.jpg",
"width": 640,
"height": 480
}
},
"resourceId": {
"kind": "youtube#video",
"videoId": "fOT0BUpITw8"
},
"videoOwnerChannelId": "UCzrM_068Odho89mTRrrxqbA",
"videoOwnerChannelTitle": "Peso Pluma"
},
"contentDetails": {
"videoId": "fOT0BUpITw8",
"duration": "PT3M55S",
"durationSeconds": 235
},
"statistics": {
"viewCount": "781000000"
}
},
{
"kind": "youtube#playlistItem",
"id": "NFvDHYMzj9U",
"snippet": {
"playlistId": "PLFgquLnL59alCl_2TQvOiD5Vgm1hCaGSI",
"position": 1,
"title": "Arcángel - FN8 ( Video Lyric )",
"thumbnails": {
"default": {
"url": "https://i.ytimg.com/vi/NFvDHYMzj9U/default.jpg",
"width": 120,
"height": 90
},
"medium": {
"url": "https://i.ytimg.com/vi/NFvDHYMzj9U/mqdefault.jpg",
"width": 320,
"height": 180
},
"high": {
"url": "https://i.ytimg.com/vi/NFvDHYMzj9U/hqdefault.jpg",
"width": 480,
"height": 360
},
"standard": {
"url": "https://i.ytimg.com/vi/NFvDHYMzj9U/sddefault.jpg",
"width": 640,
"height": 480
}
},
"resourceId": {
"kind": "youtube#video",
"videoId": "NFvDHYMzj9U"
},
"videoOwnerChannelId": "UCu4bj03KW4CwAsYtHSwMEsQ",
"videoOwnerChannelTitle": "Arcangel"
},
"contentDetails": {
"videoId": "NFvDHYMzj9U",
"duration": "PT10M50S",
"durationSeconds": 650
},
"statistics": {
"viewCount": "32000000"
}
},
"… 1 more"
],
"pageInfo": {
"resultsPerPage": 6,
"totalResults": 182
}
}

Parameters

NameTypeDescription
idpath · requiredstringA playlist id (PL…, UU…, OLAK5uy_…) or any URL with list=.
detailsquery"0" | "1" | "true" | "false"One of 0, 1, true, false.
afterquerystringThe previous page’s nextPageToken. Tokens last 6 hours.
Response fields

200 with a YouTubePlaylistItemList, in the shape of YouTube Data API v3 resources.

FieldTypeDescription
kind"youtube#playlistItemListResponse"
playlistobject
itemsYouTubePlaylistItem[]
nextPageTokenstringPass as after for the next page. Absent on the last page. Lasts 6 hours.
pageInfoobject
Status codes
StatusMeaning
200A page of the playlist.
400Invalid input. Nothing was charged.
401Missing or invalid API key.
402Not enough credits, a spend cap was reached, or payment is required.
403The target is private, or the account is suspended.
404The video, channel, playlist or post does not exist, was removed, or has nothing there.
429Too many requests. Wait for Retry-After seconds.
503YouTube is temporarily unavailable. Retryable; nothing was charged.

Every error has code, message, hint and retryable. All error codes

Questions

Private playlists?

403 target_private, never charged.

YouTube is a trademark of Google LLC. We are not affiliated with or endorsed by Google or YouTube.