https://videomentions.com/api/v1/channel-playlists?id=${CHANNEL_ID}&continuation=${CONTINUATION}
This endpoint can be used for fetching a YouTube channel’s playlists.
id
- string. YouTube channel ID.continuation
- string. (optional) Continuation string to get the next page of results.items
- array. Array of objects representing the channel’s playlists.
id
- string. Playlist ID.title
- string. Playlist title.thumbnails
- array. Playlist thumbnails.
url
- string. Thumbnail URL.width
- integer. Thumbnail width in pixels.height
- integer. Thumbnail height in pixels.url
- string. Playlist URL.videoCount
- integer. Number of videos in the playlist.continuation
- string|null. Continuation string to be included in subsequent requests for paginated data. This value is null
when no more pages remain.{ "items": [], "continuation": null }
response will be sent.items
array typically includes about 30 records, but the number of records per page can vary slightly.id
or continuation
parameter is provided, a 400 Bad Request
error response will be returned.Below is an example request for getting the playlists belonging to the YouTube channel with an ID of UCddiUEpeqJcYeBxX1IVBKvQ
.
curl -X GET
-H "API-Key: your-api-key"
-H "API-Secret: your-api-secret"
https://videomentions.com/api/v1/channel-playlists?id=UCddiUEpeqJcYeBxX1IVBKvQ
{
"items": [
{
"id": "PL39u5ZEfYDEM83SgbGafPSqPk9UPhJjNF",
"title": "Decoder = The Verge",
"thumbnails": [
{
"url": "https://i.ytimg.com/vi/NIR1Yfvy2vQ/hqdefault.jpg?sqp=-oaymwEXCOADEI4CSFryq4qpAwkIARUAAIhCGAE=&rs=AOn4CLDhqJuNZdzyv_nw87Tc3hCnOpvXPg",
"width": 480,
"height": 270
}
],
"url": "https://www.youtube.com/playlist?list=PL39u5ZEfYDEM83SgbGafPSqPk9UPhJjNF",
"videoCount": 2
},
{
"id": "PL39u5ZEfYDEOC6P2KWHfF7ETE4fTzndu9",
"title": "Apple WWDC 2023 - The Verge",
"thumbnails": [
{
"url": "https://i.ytimg.com/vi/ZifujZQqQMo/hqdefault.jpg?sqp=-oaymwEXCOADEI4CSFryq4qpAwkIARUAAIhCGAE=&rs=AOn4CLA6Aufna7j8dw75vwi7TvoVVr92Fg",
"width": 480,
"height": 270
}
],
"url": "https://www.youtube.com/playlist?list=PL39u5ZEfYDEOC6P2KWHfF7ETE4fTzndu9",
"videoCount": 2
}
// etc.
],
"continuation": "4qmFsgLCARIYVUNkZGlVRXBlcUpjWWVCeFgxSVZCS3ZRGnRFZ2x3YkdGNWJHbHpkSE1ZQXlBQU1BRTRBZW9EUEVOblRrUlJhbEZUU2tKSmFWVkZkM3BQV0ZVeFYydFdiVmRWVWtaVU1GSnRaVVZzYmxsc09VdFJNblJ6VW1wS1ZWcFhaR1pWYmxJelUzbG5PQSUzRCUzRJoCL2Jyb3dzZS1mZWVkVUNkZGlVRXBlcUpjWWVCeFgxSVZCS3ZRcGxheWxpc3RzMTA0"
}
Below is an example showing how to get paginated results in JavaScript/TypeScript.
Notice that the continuation
string from page 1 is provided as a parameter to get page 2. This process can be repeated to get pages 3, 4, etc. When no more pages remain, the value of continuation
will be null
.
const channelId = 'UCddiUEpeqJcYeBxX1IVBKvQ';
// Fetch page 1
const pageOneResponse = await fetch(
`https://videomentions.com/api/v1/channel-playlists?id=${channelId}`,
{
headers: {
'API-Key': 'your-api-key',
'API-Secret': 'your-api-secret',
},
}
);
const pageOneData = await pageOneResponse.json();
console.log('Page 1 results:', pageOneData.items);
// Verify that a next page exists
const haveNextPage = pageOneData.continuation !== null;
if (!haveNextPage) {
// Don't attempt to fetch the next page if no more pages remain
return;
}
// Fetch page 2
const pageTwoResponse = await fetch(
`https://videomentions.com/api/v1/channel-playlists?id=${channelId}&continuation=${pageOneData.continuation}`,
{
headers: {
'API-Key': 'your-api-key',
'API-Secret': 'your-api-secret',
},
}
);
const pageTwoData = await pageTwoResponse.json();
console.log('Page 2 results:', pageTwoData.items);