YouTube API
Public-data YouTube endpoints (Web surface).
Public-data YouTube endpoints (Web surface).
When To Use This API
The YouTube API is for agent workflows that need public, platform-native data without writing a custom collector for every task. Use it when a prompt needs evidence from live social records, when a Skill needs repeatable enrichment, or when product code needs the same contract an agent discovered through MCP.
This section lists 19 live YouTube operations from the canonical OpenAPI spec. Each operation page documents the route, method, parameters, response envelope, pagination behavior when available, and the error vocabulary shared across UnifAPI.
- Search videos, fetch channel and video metadata, browse related videos, and inspect trending content.
- Support creator research, channel benchmarking, and topic discovery agents with live YouTube records.
- Resolve public channel identifiers into canonical data that can be joined with other social sources.
Agent Contract Notes
Agents usually discover these endpoints with the hosted UnifAPI MCP server, inspect the operation schema, then call only the records needed for the current task. Developers can call the same endpoints over HTTP with an API key, which makes the path from exploratory agent run to production integration direct.
Every successful response uses a stable envelope with a request id, data payload, optional pagination cursor, and billing metadata. Errors use the same closed vocabulary across platforms, so retry logic, user-facing explanations, and cost reporting can stay consistent even when a workflow spans multiple public-data sources.
When you are choosing an operation, start from the public identifier the user already has: a profile username, post id, channel id, subreddit name, search term, or URL-derived slug. Prefer the narrowest endpoint that answers the question, then expand only when the agent needs more evidence. This keeps record usage predictable, makes citations easier to explain, and avoids turning a focused research task into an expensive crawl.
Operations
Channels
GET /youtube/channels/{channel_id}/community— List a YouTube channel's community posts — Return a YouTube channel's community-tab posts, by itsUC…channel ID, as a cursor-paginated list — text, like and reply counts, and attachment kind.GET /youtube/channels/{channel_id}/playlists— List playlists created by a YouTube channel — Return the playlists a YouTube channel has published, by itsUC…channel ID, as a cursor-paginated list.GET /youtube/channels/{channel_id}— Get a YouTube channel by id — Return a YouTube channel's profile by itsUC…channel ID, including title, handle, description, subscriber count, banner art, topic keywords, and external links.GET /youtube/channels/{channel_id}/search— Search within a YouTube channel — Search a single YouTube channel's videos by keyword, by itsUC…channel ID, as a cursor-paginated list.GET /youtube/channels/{channel_id}/shorts— List Shorts uploaded by a YouTube channel — Return the Shorts uploaded by a YouTube channel, by itsUC…channel ID, as a cursor-paginated list.GET /youtube/channels/{channel_id}/videos— List videos uploaded by a YouTube channel — Return the videos uploaded by a YouTube channel, by itsUC…channel ID, as a cursor-paginated list.
Hashtags
GET /youtube/hashtags/{tag}/videos— List videos for a YouTube hashtag — Return the videos YouTube surfaces for a hashtag, by tag (with or without a leading#), as a cursor-paginated list.
Playlists
GET /youtube/playlists/{playlist_id}— Get a YouTube playlist by id — Return a YouTube playlist's details by itsPL…playlist ID — title, description, owner channel, video and view counts, and last-updated time.GET /youtube/playlists/{playlist_id}/videos— List videos in a YouTube playlist — Return the videos in a YouTube playlist, by itsPL…playlist ID, as a cursor-paginated list in playlist order.
Resolve
GET /youtube/resolve/channel-id— Resolve a YouTube channel URL to its UC… channel id — Resolve any YouTube channel URL form (@handle,/c/, or/channel/) into its canonicalUC…channel ID.
Search
GET /youtube/search/channels— Search YouTube channels by keyword — Search YouTube channels by keyword, returning matching channels with handle, description, and subscriber count.GET /youtube/search/playlists— Search YouTube playlists by keyword — Search YouTube playlists by keyword, returning matching playlists with owner channel and video count.GET /youtube/search— Search YouTube videos by keyword — Search YouTube videos by keyword, with optional sort, upload-date, duration, region, and language filters.
Trends
GET /youtube/trending— Browse YouTube's trending videos — Return YouTube's country-aware trending videos, optionally scoped to a section (now, music, gaming, or movies).
Videos
GET /youtube/videos/{video_id}/captions— List a YouTube video's caption tracks — Return the caption/subtitle tracks available for a YouTube video, by video ID — language, a timed-text url per track, and the languages YouTube can auto-translate into.GET /youtube/videos/{video_id}/comments— List comments on a YouTube video — Return the comments on a YouTube video, by video ID, as a cursor-paginated list — author, text, like and reply counts.GET /youtube/videos/{video_id}/related— List YouTube videos related to a given video — Return the videos YouTube recommends as related to a given video, by video ID.GET /youtube/videos/{video_id}— Get a YouTube video by id — Return a single YouTube video's details by its video ID — title, description, channel, duration, category, publish time, and view and like counts.GET /youtube/videos/{video_id}/transcript— Get a YouTube video's transcript — Return the transcript text for a YouTube video, by video ID, as ordered timestamped segments plus a concatenated plain-text field.