This connects Claude to the YouTube Data API v3 for searching videos, pulling channel stats, and grabbing video details like view counts and comments. You get 15 different curl examples covering everything from trending videos to playlist items to comment threads. The API runs on a 10,000 units per day quota where searches cost 100 units, so you'll want to cache responses if you're doing anything heavy. Works well when users share YouTube links or ask about channel metrics. The troubleshooting section includes a zero doctor command to verify your API key is configured correctly.
npx -y skills add vm0-ai/vm0-skills --skill youtube --agent claude-codeInstalls into .claude/skills of the current project.
If requests fail, run zero doctor check-connector --env-name YOUTUBE_TOKEN or zero doctor check-connector --url "https://youtube.googleapis.com/youtube/v3/videoCategories?part=snippet®ionCode=US" --method GET
Base URL: https://youtube.googleapis.com/youtube/v3
Use Authorization: Bearer $YOUTUBE_TOKEN for all requests.
curl -s "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=kubernetes+tutorial&type=video&maxResults=5" --header "Authorization: Bearer $YOUTUBE_TOKEN" | jq '.items[] | {videoId: .id.videoId, title: .snippet.title, channel: .snippet.channelTitle}'
Search for videos uploaded this year, ordered by view count:
curl -s "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=react+hooks&type=video&order=viewCount&publishedAfter=2024-01-01T00:00:00Z&maxResults=10" --header "Authorization: Bearer $YOUTUBE_TOKEN" | jq '.items[] | {videoId: .id.videoId, title: .snippet.title}'
Replace <your-video-id> with an actual video ID:
curl -s "https://youtube.googleapis.com/youtube/v3/videos?part=snippet,statistics,contentDetails&id=<your-video-id>" --header "Authorization: Bearer $YOUTUBE_TOKEN" | jq '.items[0] | {title: .snippet.title, views: .statistics.viewCount, likes: .statistics.likeCount, duration: .contentDetails.duration}'
Replace <your-video-id-1>, <your-video-id-2>, <your-video-id-3> with actual video IDs:
curl -s "https://youtube.googleapis.com/youtube/v3/videos?part=snippet,statistics&id=<your-video-id-1>,<your-video-id-2>,<your-video-id-3>" --header "Authorization: Bearer $YOUTUBE_TOKEN" | jq '.items[] | {id: .id, title: .snippet.title, views: .statistics.viewCount}'
curl -s "https://youtube.googleapis.com/youtube/v3/videos?part=snippet,statistics&chart=mostPopular®ionCode=US&maxResults=10" --header "Authorization: Bearer $YOUTUBE_TOKEN" | jq '.items[] | {title: .snippet.title, channel: .snippet.channelTitle, views: .statistics.viewCount}'
Replace <your-channel-id> with an actual channel ID:
curl -s "https://youtube.googleapis.com/youtube/v3/channels?part=snippet,statistics&id=<your-channel-id>" --header "Authorization: Bearer $YOUTUBE_TOKEN" | jq '.items[0] | {title: .snippet.title, subscribers: .statistics.subscriberCount, videos: .statistics.videoCount}'
curl -s "https://youtube.googleapis.com/youtube/v3/channels?part=snippet,statistics&forHandle=@GoogleDevelopers" --header "Authorization: Bearer $YOUTUBE_TOKEN" | jq '.items[0] | {id: .id, title: .snippet.title, subscribers: .statistics.subscriberCount}'
curl -s "https://youtube.googleapis.com/youtube/v3/channels?part=snippet,statistics&forUsername=GoogleDevelopers" --header "Authorization: Bearer $YOUTUBE_TOKEN" | jq '.items[0] | {id: .id, title: .snippet.title, description: .snippet.description}'
Replace <your-playlist-id> with an actual playlist ID:
curl -s "https://youtube.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId=<your-playlist-id>&maxResults=20" --header "Authorization: Bearer $YOUTUBE_TOKEN" | jq '.items[] | {position: .snippet.position, title: .snippet.title, videoId: .snippet.resourceId.videoId}'
First get the channel's uploads playlist ID, then list videos. Replace <your-channel-id> with an actual channel ID:
curl -s "https://youtube.googleapis.com/youtube/v3/channels?part=contentDetails&id=<your-channel-id>" --header "Authorization: Bearer $YOUTUBE_TOKEN" | jq -r '.items[0].contentDetails.relatedPlaylists.uploads'
Replace <your-video-id> with an actual video ID:
curl -s "https://youtube.googleapis.com/youtube/v3/commentThreads?part=snippet&videoId=<your-video-id>&maxResults=20&order=relevance" --header "Authorization: Bearer $YOUTUBE_TOKEN" | jq '.items[] | {author: .snippet.topLevelComment.snippet.authorDisplayName, text: .snippet.topLevelComment.snippet.textDisplay, likes: .snippet.topLevelComment.snippet.likeCount}'
Replace <your-video-id> with an actual video ID:
curl -s "https://youtube.googleapis.com/youtube/v3/commentThreads?part=snippet&videoId=<your-video-id>&searchTerms=great+video&maxResults=10" --header "Authorization: Bearer $YOUTUBE_TOKEN" | jq '.items[] | {author: .snippet.topLevelComment.snippet.authorDisplayName, text: .snippet.topLevelComment.snippet.textDisplay}'
curl -s "https://youtube.googleapis.com/youtube/v3/videoCategories?part=snippet®ionCode=US" --header "Authorization: Bearer $YOUTUBE_TOKEN" | jq '.items[] | {id: .id, title: .snippet.title}'
curl -s "https://youtube.googleapis.com/youtube/v3/search?part=snippet&type=video&videoCategoryId=28&maxResults=10" --header "Authorization: Bearer $YOUTUBE_TOKEN" | jq '.items[] | {videoId: .id.videoId, title: .snippet.title}'
Note: Category 28 = Science & Technology
Replace <your-channel-id> with an actual channel ID:
curl -s "https://youtube.googleapis.com/youtube/v3/playlists?part=snippet&channelId=<your-channel-id>&maxResults=20" --header "Authorization: Bearer $YOUTUBE_TOKEN" | jq '.items[] | {id: .id, title: .snippet.title, description: .snippet.description}'
| ID | Category |
|---|---|
| 1 | Film & Animation |
| 10 | Music |
| 17 | Sports |
| 20 | Gaming |
| 22 | People & Blogs |
| 24 | Entertainment |
| 25 | News & Politics |
| 26 | Howto & Style |
| 27 | Education |
| 28 | Science & Technology |
snippet - Title, description, thumbnails, channelstatistics - Views, likes, comments countcontentDetails - Duration, definition, captionstatus - Upload status, privacy, licenseplayer - Embeddable playersnippet - Title, description, thumbnailsstatistics - Subscribers, videos, viewscontentDetails - Related playlists (uploads, likes)brandingSettings - Channel customizationUse nextPageToken from response to get more results. Replace <your-next-page-token> with the actual token from the previous response:
curl -s "https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=python&type=video&maxResults=50&pageToken=<your-next-page-token>" --header "Authorization: Bearer $YOUTUBE_TOKEN" | jq '.items[] | {title: .snippet.title}'
curl --get --data-urlencode for arbitrary search textyoutube.com/watch?v=VIDEO_ID or youtu.be/VIDEO_IDjuliusbrussee/caveman
mattpocock/skills
shadcn/improve
obra/superpowers
forrestchang/andrej-karpathy-skills
vercel-labs/skills