canonical: https://jentic.com/apis/googleapis.com/youtube-data-api

# Google YouTube Data API v3

Access and manage YouTube video content, channels, playlists, comments, live streams, and captions programmatically. Supports video search across YouTube's catalog of over 800 million videos, channel analytics retrieval, playlist curation, comment moderation, and live broadcast management. Enables both read-only access to public data via API keys and full account management via OAuth 2.0 scopes including upload, rating, and subscription operations.

## For AI agents

Search YouTube videos, retrieve channel and playlist data, manage comments and captions, and control live broadcasts. Supports 82 endpoints covering video upload, search, rating, subscription management, and live chat moderation.

## Scope

Does not handle video transcoding, ad revenue reporting, YouTube Studio analytics, or content ID claims - use for video metadata, search, and channel management only.

## Capabilities

- Search YouTube's video catalog by keyword, topic, location, or channel with customizable filters and pagination
- Upload videos with metadata, thumbnails, captions, and configurable privacy settings
- Retrieve detailed channel statistics including subscriber counts, view totals, and content metadata
- Moderate comment threads with spam detection, approval queues, and batch status updates
- Schedule and manage live broadcasts with stream binding, cuepoints, and state transitions
- Curate playlists by adding, reordering, and removing items with position control
- Monitor live chat messages and enforce moderation through bans and moderator assignments

## Use cases

### AI Agent Video Research and Discovery

AI agents search YouTube's video catalog to find relevant content for research, competitive analysis, or content recommendations. Through Jentic, an agent can query the YouTube search endpoint by keyword, filter by upload date and duration, and retrieve video metadata including view counts, like ratios, and descriptions - all without navigating OAuth flows manually. Integration through Jentic takes under an hour compared to 2-3 days for direct API setup with quota management.

Example prompt: Search YouTube for videos about 'machine learning tutorials' uploaded in the last month, filter for videos longer than 10 minutes, and return the top 5 results with titles, view counts, and channel names

### Channel Analytics and Performance Monitoring

Track YouTube channel growth metrics including subscriber counts, total views, video counts, and content metadata across multiple channels. The YouTube Data API provides channel statistics through the channels.list endpoint with configurable part parameters to retrieve only the data needed. Agents can monitor competitor channels, track influencer metrics, or build dashboards aggregating data from dozens of channels in a single session.

Example prompt: Retrieve channel statistics for channel ID 'UC_x5XG1OV2P6uZZ5FSM9Ttw' including subscriber count, total view count, video count, and channel description

### Automated Playlist Curation

Build and maintain YouTube playlists programmatically by searching for videos matching criteria and adding them to curated collections. The API supports creating playlists, inserting items at specific positions, reordering entries, and removing outdated content. Useful for content aggregation platforms, educational course builders, and automated content feeds that need to stay current with new uploads.

Example prompt: Create a new private playlist titled 'AI Research Papers', then search for the 10 most recent videos tagged 'arxiv paper review' and add them to the playlist in order of view count

### Comment Moderation and Community Management

Moderate YouTube video comments at scale by listing comment threads, marking spam, setting moderation status, and replying to viewer questions. The API exposes comment threads with nested replies, supports batch moderation status updates (heldForReview, published, rejected), and allows automated spam flagging. Channels with high comment volumes can process hundreds of comments per API call with pagination.

Example prompt: List all comments on video ID 'dQw4w9WgXcQ' from the last 24 hours, identify comments containing URLs, and set their moderation status to 'heldForReview'

### Live Stream Management and Chat Monitoring

Configure and control YouTube live broadcasts including scheduling streams, binding them to live stream resources, inserting cuepoints for ad breaks, and transitioning broadcast states from testing to live to complete. The live chat endpoints enable real-time message retrieval, moderator assignment, and viewer ban management during active broadcasts. Supports both manual and automated stream lifecycle control.

Example prompt: Create a live broadcast scheduled for tomorrow at 14:00 UTC with title 'Weekly Q&A', bind it to an existing stream key, then monitor the live chat and ban any user sending more than 5 messages per minute

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /youtube/v3/search | Search for videos, channels, and playlists |
| GET | /youtube/v3/videos | Retrieve video details, statistics, and status |
| POST | /youtube/v3/videos | Upload a new video resource |
| GET | /youtube/v3/channels | Retrieve channel metadata and statistics |
| GET | /youtube/v3/playlists | List playlists for a channel or by ID |
| POST | /youtube/v3/playlistItems | Add a video to a playlist |
| GET | /youtube/v3/commentThreads | List top-level comment threads on a video |
| POST | /youtube/v3/liveBroadcasts | Create a new live broadcast event |

## Key resources

- **Videos** — Upload, update, rate, search, and delete video resources with metadata, thumbnails, and captions
- **Channels** — Retrieve channel details, statistics, branding settings, and update channel metadata
- **Playlists** — Create, update, and delete playlists; manage playlist items with position ordering
- **Comments** — List, insert, update, and moderate comments and comment threads on videos
- **Search** — Query YouTube's index for videos, channels, and playlists with filters
- **Live Broadcasts** — Schedule, configure, bind, transition, and manage live broadcast events
- **Live Streams** — Create and manage live stream resources with CDN and encoding settings
- **Captions** — Upload, download, update, and delete video caption tracks
- **Subscriptions** — List, create, and delete channel subscriptions for authenticated users

## Why Jentic

- **Setup:** Wiring the YouTube Data API by hand means setting up OAuth 2.0 across scopes like youtube.readonly, youtube.upload, and youtube.force-ssl, refreshing tokens, and matching resource calls against the youtube.googleapis.com host. Through Jentic you install once, import the YouTube Data API from the API Directory, store the OAuth credential once, and your agent calls it.
- **Permission scoping:** The YouTube Data API carries its target resource ids in the request body and query, so you limit the agent to the operations it needs, such as searching videos or listing channels. You choose the operations it may call, so video uploads or playlist writes are not included unless you add them.
- **Credential handling:** Your YouTube OAuth credential is stored once, encrypted, by your own Jentic One instance and injected at execution time. Its client secret and refresh token never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'search YouTube videos by keyword' or 'list a channel's playlists', and Jentic returns the matching search or videos operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Vimeo API** — Professional video hosting platform with advanced privacy controls and customizable players
- **Twitch API** — Live streaming platform focused on gaming and interactive real-time content
- **Google Analytics API** — Web analytics that can correlate YouTube traffic with website conversions
- **Mux Video API** — Video infrastructure for custom players, transcoding, and delivery analytics

## FAQ

### What authentication does the YouTube Data API v3 use?

The YouTube Data API v3 uses OAuth 2.0 with both implicit and authorization code flows. Public data (video search, channel info) can be accessed with an API key, but write operations (upload, comment, subscribe) require OAuth 2.0 tokens with specific scopes like youtube, youtube.force-ssl, or youtube.upload. Through Jentic, OAuth tokens are stored in your Jentic One instance and agents receive scoped access without handling token refresh directly.

### Can I search for videos and filter by duration and upload date using the YouTube Data API?

Yes. The GET /youtube/v3/search endpoint accepts parameters including q (search query), publishedAfter, publishedBefore, videoDuration (short, medium, long), type (video, channel, playlist), order (date, rating, viewCount, relevance), and regionCode. You can combine these to find, for example, all long-form videos about a topic uploaded in the last week sorted by view count.

### What are the rate limits for the YouTube Data API v3?

The YouTube Data API v3 uses a quota system rather than simple rate limits. Each project receives 10,000 quota units per day by default. Different operations cost different amounts: a search.list call costs 100 units, a video.list costs 1 unit, and a video.insert (upload) costs 1,600 units. You can request higher quotas through the Google Cloud Console audit process.

### How do I upload a video to YouTube through Jentic?

Search Jentic for 'upload a video to youtube' to discover the youtube.videos.insert operation. The POST /youtube/v3/videos endpoint accepts multipart requests with video file data and a JSON body specifying snippet (title, description, tags, categoryId), status (privacyStatus, publishAt), and recordingDetails. Through Jentic, the agent loads the operation schema, constructs the request with required OAuth youtube.upload scope, and executes without manual auth configuration.

### Can I moderate comments in bulk with the YouTube Data API v3?

Yes. Use POST /youtube/v3/comments/setModerationStatus with the id parameter (comma-separated comment IDs) and moderationStatus set to published, heldForReview, or rejected. The banAuthor parameter optionally bans the commenter from future comments on your channel. Combine with GET /youtube/v3/commentThreads to retrieve comments for review, filtering by moderationStatus to find held comments.

### How do I manage live broadcasts and live chat via the YouTube Data API?

Create a broadcast with POST /youtube/v3/liveBroadcasts specifying the scheduled start time and privacy. Bind it to a stream with POST /youtube/v3/liveBroadcasts/bind. Transition states using POST /youtube/v3/liveBroadcasts/transition (testing, live, complete). Monitor chat via GET /youtube/v3/liveChat/messages with the liveChatId from the broadcast resource, and moderate with POST /youtube/v3/liveChat/bans.

### Is the YouTube Data API v3 free to use?

The YouTube Data API v3 is free within the default quota of 10,000 units per day per Google Cloud project. There are no per-request charges. For applications requiring higher throughput, you can apply for a quota extension through the YouTube API Services audit process, which involves demonstrating compliance with YouTube's Terms of Service and API policies.

### Can I limit what my agent is allowed to do with the YouTube Data API?

Yes. Because Jentic One is self-hosted, you set the rules that decide which YouTube operations and OAuth credentials your agent may use. You can allow read-only calls such as search.list and channels.list while withholding write operations like videos.insert (upload) and playlistItems.insert, since the API carries its target resource ids in the request body and query. The agent can only call the operations you have explicitly granted, so uploads, playlist writes, and comment moderation stay off limits unless you add them.
