$npx -y skills add ZeroPointRepo/youtube-skills --skill youtube-searchUse when the user wants to find YouTube content on any topic: searching for videos or channels, finding creators who cover a subject, discovering tutorials, talks, or expert discussions, or looking up a channel by name or handle. Also use proactively when the user wants to resear
| 1 | # YouTube Search |
| 2 | |
| 3 | Search YouTube 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/search — 1 credit |
| 21 | |
| 22 | Search YouTube globally for videos or channels. |
| 23 | |
| 24 | ```bash |
| 25 | curl -s "https://transcriptapi.com/api/v2/youtube/search?q=QUERY&type=video&limit=20" \ |
| 26 | -H "Authorization: Bearer $TRANSCRIPT_API_KEY" \ |
| 27 | -H "User-Agent: YourAgent/1.0" |
| 28 | ``` |
| 29 | |
| 30 | | Param | Required | Default | Validation | |
| 31 | | ------- | -------- | ------- | --------------------- | |
| 32 | | `q` | yes | — | 1-200 chars (trimmed) | |
| 33 | | `type` | no | `video` | `video` or `channel` | |
| 34 | | `limit` | no | `20` | 1-50 | |
| 35 | |
| 36 | **Video search response:** |
| 37 | |
| 38 | ```json |
| 39 | { |
| 40 | "results": [ |
| 41 | { |
| 42 | "type": "video", |
| 43 | "videoId": "dQw4w9WgXcQ", |
| 44 | "title": "Rick Astley - Never Gonna Give You Up", |
| 45 | "channelId": "UCuAXFkgsw1L7xaCfnd5JJOw", |
| 46 | "channelTitle": "Rick Astley", |
| 47 | "channelHandle": "@RickAstley", |
| 48 | "channelVerified": true, |
| 49 | "lengthText": "3:33", |
| 50 | "viewCountText": "1.5B views", |
| 51 | "publishedTimeText": "14 years ago", |
| 52 | "hasCaptions": true, |
| 53 | "thumbnails": [{ "url": "...", "width": 120, "height": 90 }] |
| 54 | } |
| 55 | ], |
| 56 | "result_count": 20 |
| 57 | } |
| 58 | ``` |
| 59 | |
| 60 | **Channel search response** (`type=channel`): |
| 61 | |
| 62 | ```json |
| 63 | { |
| 64 | "results": [{ |
| 65 | "type": "channel", |
| 66 | "channelId": "UCuAXFkgsw1L7xaCfnd5JJOw", |
| 67 | "title": "Rick Astley", |
| 68 | "handle": "@RickAstley", |
| 69 | "url": "https://www.youtube.com/@RickAstley", |
| 70 | "description": "Official channel...", |
| 71 | "subscriberCount": "4.2M subscribers", |
| 72 | "verified": true, |
| 73 | "rssUrl": "https://www.youtube.com/feeds/videos.xml?channel_id=UC...", |
| 74 | "thumbnails": [...] |
| 75 | }], |
| 76 | "result_count": 5 |
| 77 | } |
| 78 | ``` |
| 79 | |
| 80 | ## GET /api/v2/youtube/channel/search — 1 credit |
| 81 | |
| 82 | Search videos within a specific channel. Accepts `channel` — an `@handle`, channel URL, or `UC...` ID. |
| 83 | |
| 84 | ```bash |
| 85 | curl -s "https://transcriptapi.com/api/v2/youtube/channel/search\ |
| 86 | ?channel=@TED&q=climate+change&limit=30" \ |
| 87 | -H "Authorization: Bearer $TRANSCRIPT_API_KEY" \ |
| 88 | -H "User-Agent: YourAgent/1.0" |
| 89 | ``` |
| 90 | |
| 91 | | Param | Required | Validation | |
| 92 | | --------- | -------- | ----------------------------------------- | |
| 93 | | `channel` | yes | `@handle`, channel URL, or `UC...` ID | |
| 94 | | `q` | yes | 1-200 chars | |
| 95 | | `limit` | no | 1-50 (default 30) | |
| 96 | |
| 97 | Returns up to ~30 results (YouTube limit). Same video response shape as global search. |
| 98 | |
| 99 | ## GET /api/v2/youtube/channel/resolve — FREE |
| 100 | |
| 101 | Convert @handle to channel ID: |
| 102 | |
| 103 | ```bash |
| 104 | curl -s "https://transcriptapi.com/api/v2/youtube/channel/resolve?input=@TED" \ |
| 105 | -H "Authorization: Bearer $TRANSCRIPT_API_KEY" \ |
| 106 | -H "User-Agent: YourAgent/1.0" |
| 107 | ``` |
| 108 | |
| 109 | ## Workflow: Search → Transcript |
| 110 | |
| 111 | ```bash |
| 112 | # 1. Search for videos |
| 113 | curl -s "https://transcriptapi.com/api/v2/youtube/search\ |
| 114 | ?q=python+web+scraping&type=video&limit=5" \ |
| 115 | -H "Authorization: Bearer $TRANSCRIPT_API_KEY" \ |
| 116 | -H "User-Agent: YourAgent/1.0" |
| 117 | |
| 118 | # 2. Get transcript from result |
| 119 | curl -s "https://transcriptapi.com/api/v2/youtube/transcript\ |
| 120 | ?video_url=VIDEO_ID&format=text&include_timestamp=true&send_metadata=tr |