| name | youtube-data |
| description | YouTube Data API via youtube-data-cli: search channels/videos, fetch comments/playlists, inspect video metadata, and call raw YouTube Data API v3 endpoints. Use when the user mentions YouTube Data API, channel stats, video search, comments, playlists, or competitor YouTube research. |
| category | social-media |
youtube-data-cli
Use youtube-data-cli for YouTube Data API v3 access.
When To Use This Skill
Use this skill when you need to:
- Search YouTube channels or videos.
- Inspect channel statistics and metadata.
- Fetch video metadata, statistics, and publish dates.
- Read top-level YouTube comments.
- List playlists and playlist items.
- Call a YouTube Data API endpoint that the high-level commands do not expose yet.
Setup
If missing:
bun --version || curl -fsSL https://bun.sh/install | bash
npx api2cli install youtube-data-cli
Authenticate with a YouTube Data API key:
youtube-data-cli auth set "YOUR_YOUTUBE_API_KEY"
youtube-data-cli auth test --json
Token path: ~/.config/tokens/youtube-data-cli.txt.
Working Rules
- Always pass
--json in agent workflows.
- Use high-level resources first:
channels, videos, comments, playlists.
- Use
api get for documented endpoints not covered by shortcuts.
- For large fetches, paginate with
--page-token when the command supports it.
Commands
youtube-data-cli --help
youtube-data-cli channels --help
youtube-data-cli videos --help
youtube-data-cli comments --help
youtube-data-cli playlists --help
youtube-data-cli api --help
Common examples:
youtube-data-cli channels search --q "ai coding" --max-results 10 --json
youtube-data-cli channels get --id CHANNEL_ID --json
youtube-data-cli videos list --channel-id CHANNEL_ID --max-results 10 --json
youtube-data-cli videos get --id VIDEO_ID --json
youtube-data-cli comments list --video-id VIDEO_ID --order relevance --max-results 20 --json
youtube-data-cli playlists list --channel-id CHANNEL_ID --max-results 20 --json
youtube-data-cli playlists items --id PLAYLIST_ID --max-results 20 --json
youtube-data-cli api get --path /search --param part=snippet --param type=video --param q="ai coding" --json
Output Format
--json returns:
{ "ok": true, "data": { "example": true }, "meta": { "total": 1 } }
Errors return:
{ "ok": false, "error": { "message": "...", "status": 400 } }