GET /v1/youtube/playlist
YouTube playlist API: list a playlist's videos by playlist ID
Returns a playlist's videos in playlist order, each with its id, title, views, channel and thumbnail. Send playlist_id as a PL…, UU… or OL… id or a playlist URL; max_pages=1 answers one page at once, and other values start a job you poll.
- Price
- $0.0005 per 100 results
- Billing
- $0.0005/100
- Batch
- Yes, through /v1/batch
- Failed calls
- Not charged
Example request
curl 'https://api.virev.ai/v1/youtube/playlist?playlist_id=PLFgquLnL59alCl_2TQvOiD5Vgm1hCaGSI&max_pages=1' \
-H "Authorization: Bearer $VIREV_API_KEY"import os
import requests
response = requests.request(
"GET",
"https://api.virev.ai/v1/youtube/playlist",
params={
"playlist_id": "PLFgquLnL59alCl_2TQvOiD5Vgm1hCaGSI",
"max_pages": "1",
},
headers={"Authorization": f"Bearer {os.environ['VIREV_API_KEY']}"},
timeout=60,
)
response.raise_for_status()
print(response.json())Parameters
| Name | In | Type | Description |
|---|---|---|---|
playlist_id required | query | string | A playlist id (PL…, UU…, OL…), or a youtube.com playlist URL. |
since | query | string | Not accepted on this operation: its items carry no timestamp, so since returns 400 before billing. |
max_pages | query | integer | Maximum pages to fetch. -1 walks until exhaustion or since with no page cap, and must be written. Omitted, since alone bounds the walk; with neither, the job stops after 10 pages. Any positive integer is accepted. 1 returns one page synchronously with HTTP 200; any other value creates a durable job with HTTP 202. |
cursor | query | string | Opaque next_cursor from an earlier answer of this operation, also with get_raw=true. A native YouTube cursor from a raw page answers 400. Result download cursors belong to the results route. |
cached | query | auto | cache_only | live | auto (default) serves a read saved within the last 24 hours for these exact arguments, otherwise fetches. cache_only never contacts YouTube (404 not_cached when nothing is saved, whatever its age). live always fetches. Anything else is a 400. cache_only reads one saved page per request: omit max_pages or pass 1, and continue with next_cursor. |
get_raw | query | boolean | true returns the upstream JSON exactly as YouTube answered it instead of the normalized Page[Post]. |
Idempotency-Key | header | string | Reuse this key with the same inputs to recover a lost job submission. A different input with the same key returns 409. |
Example response
The example response of the API reference, with lists cut to their first 3 items and long text shortened.
{
"data": {
"items": [
{
"id": "Df5Y-2ndQyU",
"shortcode": null,
"taken_at": null,
"kind": "video",
"product_type": "video",
"caption": null,
"hashtags": [],
"mentions": [],
"accessibility_caption": null,
"likes": null,
"comments": null,
"views": 5200000,
"counts_hidden": null,
"comments_disabled": null,
"is_pinned": null,
"is_paid_partnership": null,
"owner": {
"id": "UCX6OQ3DkcsbYNE6H8uQQuVA",
"username": "MrBeast",
"full_name": null,
"is_verified": null,
"is_private": null,
"avatar_url": null,
"latest_story_at": null,
"extra": {}
},
"coauthors": [],
"sponsors": [],
"tagged": [],
"location": null,
"audio": null,
"thumbnail_url": "https://i.ytimg.com/vi/Df5Y-2ndQyU/hqdefault.jpg?sqp=-oaymwE2CNACELwBSFXyq4qpAygIARUAAIhCGAFwAcABBvABAfgBtgiAAoAPigIMCAAQARg7ID4ofzAP&rs=AOn4CLCIdtbVJRIKyQDVKkPeRFktuYvdUA",
"video_duration": 33,
"media": [],
"media_urls": [],
"extra": {
"title": "Read My Book, You Could Win $1,000,000",
"url": "https://www.youtube.com/watch?v=Df5Y-2ndQyU",
"published_text": "3 days ago"
}
},
{
"id": "egvLKQe6I4I",
"shortcode": null,
"taken_at": null,
"kind": "video",
"product_type": "video",
"caption": null,
"hashtags": [],
"mentions": [],
"accessibility_caption": null,
"likes": null,
"comments": null,
"views": 75000000,
"counts_hidden": null,
"comments_disabled": null,
"is_pinned": null,
"is_paid_partnership": null,
"owner": {
"id": "UCX6OQ3DkcsbYNE6H8uQQuVA",
"username": "MrBeast",
"full_name": null,
"is_verified": null,
"is_private": null,
"avatar_url": null,
"latest_story_at": null,
"extra": {}
},
"coauthors": [],
"sponsors": [],
"tagged": [],
"location": null,
"audio": null,
"thumbnail_url": "https://i.ytimg.com/vi/egvLKQe6I4I/hqdefault.jpg?sqp=-oaymwE2CNACELwBSFXyq4qpAygIARUAAIhCGAFwAcABBvABAfgBtgiAAoAPigIMCAAQARhlIGEoMTAP&rs=AOn4CLA9iDvyVUcn7G_cYtMaSOrVZMyRLQ",
"video_duration": 51,
"media": [],
"media_urls": [],
"extra": {
"title": "Don't Pop the Balloon",
"url": "https://www.youtube.com/watch?v=egvLKQe6I4I",
"published_text": "10 days ago"
}
}
],
"pages": [
{
"cursor": null,
"fetched_at": "2026-07-21T15:11:14.935040+00:00",
"count": 2
}
],
"next_cursor": "eyJjb250aW51YXRpb24iOiI0cW1Gc2dKdEVocFdURlZWV0RaUFVUTkVhMk56WWxsT1JUWklPSFZSVVhWV1FSbzBRMEZHTmtoc1FsVlBhMDVJVlZkc1JsSlZNSGRVVlZaU1pXeEtjVnA2Ums1bGJGcEhWRmh3VmsxVk9VVlVVU1V6UkNVelJKb0NHRlZWV0RaUFVUTkVhMk56WWxsT1JUWklPSFZSVVhWV1FRJTNEJTNEIiwi…",
"has_more": true,
"stop_reason": "pages",
"coverage": {
"since": null,
"oldest_at": null,
"since_reached": false
}
},
"meta": {
"source": "db",
"fetched_at": "2026-07-21T15:11:14.935040+00:00",
"cost": "$0.0005",
"balance": "$3.0860",
"request_id": "req_cdfa39bc7523a0a29285590dc5089471"
}
}How it works
A playlist's videos in playlist order. With max_pages=1, returns Page[Post] under data; with get_raw=true returns the upstream JSON.
The default request creates a durable job (202). Use max_pages=1 for one synchronous Page response (200). Poll status_url, then read results_url with its opaque cursor. Acquisition stops at the first of since, max_pages, or exhaustion. Jobs continue after disconnects. Result responses are bounded to 3 MiB; this does not limit the crawl. Supply Idempotency-Key to recover a lost submission response; reuse it with the same inputs. YouTube sets every page’s size, so there is no page_size.
A field YouTube does not carry is null, a list it does not carry is [], and YouTube-only facts sit under extra. Unknown, unsupported, and repeated query parameters return 400 before acquisition or billing.
Billing: $0.0005 per 100 unique returned items (one native page), rounded up to a minimum of one billing unit; a get_raw=true page bills one unit. Jobs settle once after successful completion. Submission, polling and repeat downloads are free.
Errors
| Status | When |
|---|---|
400 | The request parameters are invalid. |
401 | Missing, malformed, or revoked API key. |
402 | Balance is too low for this request. |
404 | cached=cache_only found nothing saved for these arguments (not_cached; call again with cached=auto to fetch it), or the YouTube account or item does not exist (not_found). You are not charged. |
429 | Over the per-minute limit. The limit belongs to your organization and all its API keys share it: 100 requests per minute unless an increase was granted. Wait for the Retry-After seconds, then retry. On a live read, code rate_limited means the platform itself rate-limited this read; retry after the Retry-After seconds. You are not charged. |
502 | The upstream fetch failed. You are not charged. |
503 | Billing could not be confirmed, so no upstream data was returned. |
504 | The upstream request timed out. You are not charged. |