YouTube API endpoint
Returns a YouTube playlist by playlist id or full playlist URL: title, URL, owning channel, video count and thumbnail, plus its videos with position, title, video id, duration, channel and view count. Pass the returned `continuation_token` to page through longer playlists.
/youtube/playlist/{id}Returns playlist metadata, video items, and an optional continuation_token for pagination.
Path parameter:
id: playlist ID or a full YouTube playlist URLQuery parameters:
continuation_token: fetch the next page from a previous response| Field | Filled in, of 16 checked | Values in the sample |
|---|---|---|
| type | 16 | |
| position | 16 | 1 to 16, median 8 |
| title | 16 | |
| url | 16 | youtube.com |
| thumbnail | 16 | i.ytimg.com |
| video_id | 16 | |
| channel_title | 16 | |
| channel_id | 16 | |
| duration | 16 | |
| duration_seconds | 16 | 267 to 1,036, median 659 |
| published_text | 16 | |
| short_view_count | 16 |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| id (path) | string | Yes | YouTube playlist ID or full playlist URL | PL-szjqIBRvM_aWOj-uXCVm28l-ZZFa4D2 | |
| continuation_token | string | No | Pagination token returned by a previous request | ||
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/youtube/playlist/PL-szjqIBRvM_aWOj-uXCVm28l-ZZFa4D2" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 200,
"msg": "OK",
"data": {
"playlist_id": "PL1234567890abcdef",
"title": "OpenAI Podcast",
"url": "https://www.youtube.com/playlist?list=PL1234567890abcdef",
"channel_title": "OpenAI",
"channel_id": "UCXZCJLdBC09xxGZ6gcdrc6A",
"video_count": "12 videos",
"items": [
{
"type": "video",
"position": 1,
"title": "Episode 1",
"video_id": "abc123xyz89",
"duration": "12:34"
}
],
"continuation_token": "NEXT_TOKEN"
}
}Request schema
No body schema
Response schema
#/definitions/youtube.playlistResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| code | integer | No | 200 | |||
| data | youtube.PlaylistResponse | No | ||||
| data.channel_id | string | No | UCXZCJLdBC09xxGZ6gcdrc6A | YouTube channel ID of the playlist owner. | ||
| data.channel_title | string | No | OpenAI | Name of the channel that owns the playlist. | ||
| data.continuation_token | string | No | NEXT_TOKEN | Token to pass in the next request to get the following page. Omitted on the last page. | ||
| data.items | array | No | Videos in the playlist, in playlist order. | |||
| data.items[].badges | array | No | HD,CC | Badge labels shown on the video, such as `HD` or `CC`. | ||
| data.items[].channel_id | string | No | UCXZCJLdBC09xxGZ6gcdrc6A | YouTube channel ID, starting with `UC`. | ||
| data.items[].channel_thumbnail | string | No | https://yt3.ggpht.com/example=s68-c-k-c0x00ffffff-no-rj | URL of the publishing channel's avatar image. | ||
| data.items[].channel_title | string | No | OpenAI | Name of the channel that published the video or playlist. | ||
| data.items[].description_snippet | string | No | A concise walkthrough of GPT features. | Short excerpt of the video or channel description shown in the results. | ||
| data.items[].duration | string | No | 12:34 | Video length as YouTube displays it, such as `12:34`. | ||
| data.items[].duration_seconds | integer | No | 754 | Video length in seconds. | ||
| data.items[].handle | string | No | @OpenAI | Channel handle, starting with `@`. Set for channel results. | ||
| data.items[].is_live | boolean | No | Whether the video is a live stream. | |||
| data.items[].is_short | boolean | No | Whether the video is a YouTube Short. | |||
| data.items[].is_verified | boolean | No | Whether the channel carries a verified badge. | |||
| data.items[].playlist_id | string | No | PL1234567890abcdef | YouTube playlist ID. Set for playlist results. | ||
| data.items[].position | integer | No | 1 | Position of the item on this page of results, starting at 1. | ||
| data.items[].published_text | string | No | 2 days ago | Upload time as YouTube displays it, such as `2 days ago`. | ||
| data.items[].short_view_count | string | No | 123K views | Abbreviated view count as YouTube displays it, such as `123K views`. | ||
| data.items[].subscriber_count | string | No | 1.93M subscribers | Subscriber count as YouTube displays it, such as `1.93M subscribers`. | ||
| data.items[].thumbnail | string | No | https://i.ytimg.com/vi/abc123/hq720.jpg | URL of the item's thumbnail image. | ||
| data.items[].title | string | No | ChatGPT Explained | Video or playlist title, or channel name. | ||
| data.items[].type | string | No | video | Kind of result: `video`, `channel` or `playlist`. | ||
| data.items[].url | string | No | https://www.youtube.com/watch?v=abc123 | Link to the video, channel or playlist on YouTube. | ||
| data.items[].video_count | string | No | 9 lessons | Number of videos as YouTube displays it, such as `12 videos`. Set for channel and playlist results. | ||
| data.items[].video_id | string | No | abc123xyz89 | YouTube video ID. Set for video results. | ||
| data.items[].view_count | string | No | 123,456 views | View count as YouTube displays it, such as `123,456 views`. | ||
| data.playlist_id | string | No | PL1234567890abcdef | YouTube playlist ID. | ||
| data.thumbnail | string | No | https://i.ytimg.com/vi/abc123xyz89/hqdefault.jpg | URL of the playlist's thumbnail image. | ||
| data.title | string | No | OpenAI Podcast | Playlist title as shown on YouTube. | ||
| data.url | string | No | https://www.youtube.com/playlist?list=PL1234567890abcdef | Link to the playlist on YouTube. | ||
| data.video_count | string | No | 12 videos | Number of videos in the playlist as YouTube displays it, such as `12 videos`. | ||
| msg | string | No | OK |
| Status | Description | Schema |
|---|---|---|
| 400 | Missing or invalid parameters | #/definitions/app.Response |
| 429 | Rate limit exceeded | #/definitions/app.Response |
| 500 | Internal server error | #/definitions/app.Response |
Use environment variables for secrets and keep Crawlora API keys server-side.
curl -X GET "https://api.crawlora.net/api/v1/youtube/playlist/PL-szjqIBRvM_aWOj-uXCVm28l-ZZFa4D2" \
-H "x-api-key: $CRAWLORA_API_KEY"