← Main docs page

Get playlist

https://videomentions.com/api/v1/playlist?id=${PLAYLIST_ID}&continuation=${CONTINUATION}

This endpoint can be used for fetching a playlist’s data, including which videos belong to it.

Parameters

Response

Notes

If an invalid playlist ID is provided, a 404 Not Found error will be returned.

If an invalid continuation string is provided, a 400 Bad Request error response will be returned.

Example: Basic usage

Below is an example request for getting the playlist with an ID of PL39u5ZEfYDEPSiW7UWnVcbkxdh_Dul9iD.

curl -X GET 
-H "API-Key: your-api-key" 
-H "API-Secret: your-api-secret" 
https://videomentions.com/api/v1/playlist?id=PL39u5ZEfYDEO5PaNRWyqloGY6zzJ1fjBa

Response

{
	"info": {
		"id": "PL39u5ZEfYDEO5PaNRWyqloGY6zzJ1fjBa",
		"title": "The Vergecast",
		"description": "Hosted by Nilay Patel, David Pierce, and Alex Cranz, Vergecast is the only podcast you need to make sense of the week in tech news. The weekly show gives an irreverent and informative look at what's happening right now (and next) in the world of technology and gadgets.",
		"thumbnails": [
			{
				"url": "https://i.ytimg.com/vi/ZZqQYKWMsI4/hqdefault.jpg?sqp=-oaymwEXCNACELwBSFryq4qpAwkIARUAAIhCGAE=&rs=AOn4CLCD1KhyXQ6hc46VhQMsnrm8pxN57g",
				"width": 336,
				"height": 188
			},
			{
				"url": "https://i.ytimg.com/vi/ZZqQYKWMsI4/hqdefault.jpg?sqp=-oaymwEXCPYBEIoBSFryq4qpAwkIARUAAIhCGAE=&rs=AOn4CLApqLUc1IPwYKnTTFLdZSuL51Y9MQ",
				"width": 246,
				"height": 138
			},
			{
				"url": "https://i.ytimg.com/vi/ZZqQYKWMsI4/hqdefault.jpg?sqp=-oaymwEWCMQBEG5IWvKriqkDCQgBFQAAiEIYAQ==&rs=AOn4CLAcprpnKO5kxmn_dPupcTMxl3J1wA",
				"width": 196,
				"height": 110
			},
			{
				"url": "https://i.ytimg.com/vi/ZZqQYKWMsI4/hqdefault.jpg?sqp=-oaymwEWCKgBEF5IWvKriqkDCQgBFQAAiEIYAQ==&rs=AOn4CLBQbizZJLVvQBfMXKsqN_OD7EjA7w",
				"width": 168,
				"height": 94
			}
		],
		"channelId": "UCddiUEpeqJcYeBxX1IVBKvQ",
		"channelTitle": "by The Verge",
		"totalItems": 108,
		"views": 6338,
		"lastUpdated": "Updated 2 days ago",
		"url": "https://www.youtube.com/playlist?list=PL39u5ZEfYDEO5PaNRWyqloGY6zzJ1fjBa"
	},
	"items": [
		{
			"index": 1,
			"id": "ZZqQYKWMsI4",
			"title": "Amazon and Microsoft's AI parades | The Vergecast",
			"thumbnails": [
				{
					"url": "https://i.ytimg.com/vi/ZZqQYKWMsI4/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLClCKXDGAKwFkLKGh050qBBGWXhLw",
					"width": 336,
					"height": 188
				},
				{
					"url": "https://i.ytimg.com/vi/ZZqQYKWMsI4/hqdefault.jpg?sqp=-oaymwEcCPYBEIoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLAFV32PVnUL3iZEf_CIj1htGp-RTA",
					"width": 246,
					"height": 138
				},
				{
					"url": "https://i.ytimg.com/vi/ZZqQYKWMsI4/hqdefault.jpg?sqp=-oaymwEbCMQBEG5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLAaOoIzLwFIjrZ4AObBAbU1hUBZIA",
					"width": 196,
					"height": 110
				},
				{
					"url": "https://i.ytimg.com/vi/ZZqQYKWMsI4/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLCqwHyxxz1l8b6wFkoS5ADhXBPlKw",
					"width": 168,
					"height": 94
				}
			],
			"channelId": "UCVHdvAX5-R8y5l9xp6nroBQ",
			"channelTitle": "The Vergecast",
			"viewsText": "5.9K views",
			"publishedText": "2 days ago",
			"duration": 4372
		},
		{
			"index": 2,
			"id": "J9AWWWmqjQA",
			"title": "iPhone and watches and wallpapers, oh my | The Vergecast",
			"thumbnails": [
				{
					"url": "https://i.ytimg.com/vi/J9AWWWmqjQA/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLCo-RMihmnqvZrAOkkri2nFUMiOYA",
					"width": 336,
					"height": 188
				},
				{
					"url": "https://i.ytimg.com/vi/J9AWWWmqjQA/hqdefault.jpg?sqp=-oaymwEcCPYBEIoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLAPGWFsgF4w7u6JiwHZYVAoxji0bw",
					"width": 246,
					"height": 138
				},
				{
					"url": "https://i.ytimg.com/vi/J9AWWWmqjQA/hqdefault.jpg?sqp=-oaymwEbCMQBEG5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLBFkBNOGylQtaVztzj8Y1u9ctR6Mg",
					"width": 196,
					"height": 110
				},
				{
					"url": "https://i.ytimg.com/vi/J9AWWWmqjQA/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLBNIenntzsDGA6yNVu0lPR-tEBpkw",
					"width": 168,
					"height": 94
				}
			],
			"channelId": "UCVHdvAX5-R8y5l9xp6nroBQ",
			"channelTitle": "The Vergecast",
			"viewsText": "3.6K views",
			"publishedText": "4 days ago",
			"duration": 5799
		}
		// etc.
	],
	"continuation": "4qmFsgKJARIkVkxQTDM5dTVaRWZZREVPNVBhTlJXeXFsb0dZNnp6SjFmakJhGjxDQUY2S1ZCVU9rTkhVV2xGUkVFMVRVUmpOVTVyUlROT1ZWRjRUbFJOTlUxNlNXOUJWRVJhY2t4aGIwSm6aAiJQTDM5dTVaRWZZREVPNVBhTlJXeXFsb0dZNnp6SjFmakJh"
}

Example: Pagination

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.

Also note that info is available on page 1, but not on subsequent pages.

const playlistId = 'PL39u5ZEfYDEO5PaNRWyqloGY6zzJ1fjBa';

// Fetch page 1
const pageOneResponse = await fetch(`https://videomentions.com/api/v1/playlist?id=${playlistId}`, {
	headers: {
		'API-Key': 'your-api-key',
		'API-Secret': 'your-api-secret',
	},
});
const pageOneData = await pageOneResponse.json();
console.log('Playlist info:', pageOneData.info); // Only available on page 1.
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/playlist?id=${playlistId}&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);