$npx -y skills add ZeroPointRepo/youtube-skills --skill youtube-playlistUse when a YouTube playlist is involved: pasted playlist links or IDs, requests to list playlist videos, browse playlist contents, or work through a playlist for transcripts or research. Also use when the user wants all videos from a series, course, or collection. Not for creatin
| 1 | # YouTube Playlist |
| 2 | |
| 3 | Browse playlists and fetch transcripts via [TranscriptAPI.com](https://transcriptapi.com). |
| 4 | |
| 5 | ## Setup |
| 6 | |
| 7 | If `$TRANSCRIPT_API_KEY` is not set, read [references/auth-setup.md](references/auth-setup.md) and follow the instructions there to get and store the key. |
| 8 | |
| 9 | ## Required Headers |
| 10 | |
| 11 | Every request needs two headers: |
| 12 | |
| 13 | - **Authorization:** `Bearer $TRANSCRIPT_API_KEY` |
| 14 | - **User-Agent:** your agent's name and version if known (e.g. `HermesAgent/0.11.0`, `ClaudeCode/1.0`). Version is optional — agent name alone is fine. Do not omit this header or send a bare default — Cloudflare will return a 403 (error code 1010) and block the request. |
| 15 | |
| 16 | ## API Reference |
| 17 | |
| 18 | Full OpenAPI spec: [transcriptapi.com/openapi.json](https://transcriptapi.com/openapi.json) — consult this for the latest parameters and schemas. |
| 19 | |
| 20 | ## GET /api/v2/youtube/playlist/videos — 1 credit/page |
| 21 | |
| 22 | Paginated playlist video listing (100 per page). Accepts `playlist` — a YouTube playlist URL or playlist ID. |
| 23 | |
| 24 | ```bash |
| 25 | # First page |
| 26 | curl -s "https://transcriptapi.com/api/v2/youtube/playlist/videos?playlist=PL_PLAYLIST_ID" \ |
| 27 | -H "Authorization: Bearer $TRANSCRIPT_API_KEY" \ |
| 28 | -H "User-Agent: YourAgent/1.0" |
| 29 | |
| 30 | # Next pages |
| 31 | curl -s "https://transcriptapi.com/api/v2/youtube/playlist/videos?continuation=TOKEN" \ |
| 32 | -H "Authorization: Bearer $TRANSCRIPT_API_KEY" \ |
| 33 | -H "User-Agent: YourAgent/1.0" |
| 34 | ``` |
| 35 | |
| 36 | | Param | Required | Validation | |
| 37 | | -------------- | ----------- | ---------------------------------------------------- | |
| 38 | | `playlist` | conditional | Playlist URL or ID (`PL`/`UU`/`LL`/`FL`/`OL` prefix) | |
| 39 | | `continuation` | conditional | non-empty string | |
| 40 | |
| 41 | Provide exactly one of `playlist` or `continuation`, not both. |
| 42 | |
| 43 | **Accepted playlist ID prefixes:** |
| 44 | |
| 45 | - `PL` — user-created playlists |
| 46 | - `UU` — channel uploads playlist |
| 47 | - `LL` — liked videos |
| 48 | - `FL` — favorites |
| 49 | - `OL` — other system playlists |
| 50 | |
| 51 | **Response:** |
| 52 | |
| 53 | ```json |
| 54 | { |
| 55 | "results": [ |
| 56 | { |
| 57 | "videoId": "abc123xyz00", |
| 58 | "title": "Playlist Video Title", |
| 59 | "channelId": "UCuAXFkgsw1L7xaCfnd5JJOw", |
| 60 | "channelTitle": "Channel Name", |
| 61 | "channelHandle": "@handle", |
| 62 | "lengthText": "10:05", |
| 63 | "viewCountText": "1.5M views", |
| 64 | "thumbnails": [{ "url": "...", "width": 120, "height": 90 }], |
| 65 | "index": "0" |
| 66 | } |
| 67 | ], |
| 68 | "playlist_info": { |
| 69 | "title": "Best Science Talks", |
| 70 | "numVideos": "47", |
| 71 | "description": "Top science presentations", |
| 72 | "ownerName": "TED", |
| 73 | "viewCount": "5000000" |
| 74 | }, |
| 75 | "continuation_token": "4qmFsgKlARIYVVV1...", |
| 76 | "has_more": true |
| 77 | } |
| 78 | ``` |
| 79 | |
| 80 | **Pagination flow:** |
| 81 | |
| 82 | 1. First request: `?playlist=PLxxx` — returns first 100 videos + `continuation_token` |
| 83 | 2. Next request: `?continuation=TOKEN` — returns next 100 + new token |
| 84 | 3. Repeat until `has_more: false` or `continuation_token: null` |
| 85 | |
| 86 | ## Workflow: Playlist → Transcripts |
| 87 | |
| 88 | ```bash |
| 89 | # 1. List playlist videos |
| 90 | curl -s "https://transcriptapi.com/api/v2/youtube/playlist/videos?playlist=PL_PLAYLIST_ID" \ |
| 91 | -H "Authorization: Bearer $TRANSCRIPT_API_KEY" \ |
| 92 | -H "User-Agent: YourAgent/1.0" |
| 93 | |
| 94 | # 2. Get transcript from a video in the playlist |
| 95 | curl -s "https://transcriptapi.com/api/v2/youtube/transcript\ |
| 96 | ?video_url=VIDEO_ID&format=text&include_timestamp=true&send_metadata=true" \ |
| 97 | -H "Authorization: Bearer $TRANSCRIPT_API_KEY" \ |
| 98 | -H "User-Agent: YourAgent/1.0" |
| 99 | ``` |
| 100 | |
| 101 | ## Extract playlist ID from URL |
| 102 | |
| 103 | From `https://www.youtube.com/playlist?list=PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf`, the playlist ID is `PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf`. You can also pass the full URL directly to the `playlist` parameter. |
| 104 | |
| 105 | ## Errors |
| 106 | |
| 107 | | Code | Meaning | Action | |
| 108 | | -------- | ----------------------- | ------------------------------------------------ | |
| 109 | | 400 | Both or neither params | Provide exactly one of playlist or continuation | |
| 110 | | 402 | No credits | transcriptapi.c |