Everything an AI agent can do with the YouTube API.

A reference guide for building AI agents: every method, how to authenticate, and the permissions each one needs.

Endpoints23
API versionv3
Last updated23 June 2026
Orientation

How the YouTube Data API works.

The YouTube API is how an app or AI agent works with a YouTube channel: searching for videos, reading channel and video statistics, uploading and updating videos, managing playlists, and posting or moderating comments. Access comes through an API key for public reads, or an OAuth 2.0 access token whose scopes decide what the caller can read or change, and a token is limited to the channel of the account that granted it. Use is metered in quota units rather than request count, so reads are cheap while searches and writes cost far more.

23Endpoints
8Capability groups
9Read
14Write
4Permissions
Authentication
The Data API accepts two credentials. An API key authenticates the application and can read public data only. An OAuth 2.0 access token acts on behalf of a Google account that owns a YouTube channel and is required for any private read and every write. A Google account with no linked YouTube channel is rejected with youtubeSignupRequired, and service accounts are not supported.
Permissions
OAuth scopes set what a token can do. youtube.readonly views account data without changes; youtube manages most of an account, including videos, playlists, and subscriptions; youtube.upload uploads videos and sets thumbnails; youtube.force-ssl is the broadest, covering everything youtube does plus reading and writing comments and captions over HTTPS. The full scope URL takes the form https://www.googleapis.com/auth/. Partner-only scopes youtubepartner and youtubepartner-channel-audit exist for content owners.
Quota model
Use is metered in quota units, not request count, against a default of 10,000 units per day. A read of a list costs about 1 unit, a write costs about 50 units, and a search costs 100 units, so a handful of searches or writes can spend what thousands of reads would. search.list and video uploads each have their own separate daily cap of 100 calls. Exceeding the allowance returns 403 quotaExceeded until the midnight Pacific reset.
Data model
The API is resource-oriented JSON over HTTPS at https://www.googleapis.com/youtube/v3. Core resources are videos, channels, playlists, playlistItems, search, comments and commentThreads, subscriptions, captions, and thumbnails. The part parameter selects which sections of a resource, such as snippet, contentDetails, statistics, or status, a response includes, and it also affects quota and response size. The API has no webhooks; new-upload notifications come through a separate PubSubHubbub feed.
Connect & authenticate

Connection & authentication methods.

How an app or AI agent connects to YouTube determines what it can reach. Most reads of public data need only an API key, while anything tied to a channel or any write needs an OAuth 2.0 access token, and the scopes on that token set the boundary.

Ways to connect

REST API (Data API v3)

The YouTube Data API v3 answers at https://www.googleapis.com/youtube/v3. Public reads can use a simple API key, while channel-bound reads and all writes require an OAuth 2.0 access token.

Best forConnecting an app or AI agent to YouTube.
Governed byThe API key or OAuth access token and the scopes it carries.
Docs ↗

PubSubHubbub push feeds

The Data API has no webhooks. To learn of new uploads, an app subscribes to a channel's Atom feed through Google's PubSubHubbub hub, which posts a notification when that channel publishes or updates a video.

Best forBeing notified of new uploads on a channel without polling.
Governed byA per-channel feed subscription, separate from the API key or OAuth token.
Docs ↗

Google API client libraries

Google publishes official client libraries for the Data API in languages such as Python, JavaScript, Java, Go, and .NET, which handle authentication, request signing, and pagination.

Best forBuilding an integration in a supported language.
Governed byThe API key or OAuth access token and the scopes it carries.
Docs ↗
Authentication

API key

An API key authenticates the application, not a user, and can read public data such as public videos, channels, and playlists. It cannot touch anything that belongs to a specific user or make any write.

TokenAPI key
Best forReading public data
Docs ↗

OAuth 2.0 user authorization

OAuth 2.0 grants an access token on behalf of a Google account that owns a YouTube channel, with the scopes the user approves. It is required for any private read and every write, and a Google account with no linked channel is rejected.

TokenOAuth 2.0 access token
Best forActing on a user's channel, reading private data, and any write
Docs ↗
Capability map

What an AI agent can do in YouTube.

The YouTube Data API is split into resources an agent can act on, such as videos, channels, playlists, comments, subscriptions, and captions. Each resource has its own methods and its own scope, and some grant access to far more than others.

Endpoint reference

Every YouTube Data API method.

Filter by method, access, or permission, or search any path. Select a row for version detail, rate limits, the related webhook event, and the source.

MethodEndpointWhat it doesAccessPermissionVersion
Search across videos, channels, and playlists by keyword, and filter by date, region, type, and more.1

Searching public content needs only an API key; no OAuth scope is required unless filtering by the caller's own resources. When a token is used, the read-only scope is https://www.googleapis.com/auth/youtube.readonly. This is the costliest read at 100 quota units per call.

Acts onsearch result
Permission (capability)youtube.readonly
VersionAvailable since the API’s base version
Webhook eventNone
Rate limit100 quota units

Videos

List video details and statistics, upload a video, update its metadata, rate it, read the caller's rating, and delete it.6

Reading public videos needs only an API key; the rating and fileDetails parts need the token owner's authorization. Read-only scope: https://www.googleapis.com/auth/youtube.readonly.

Acts onvideo
Permission (capability)youtube.readonly
VersionAvailable since the API’s base version
Webhook eventNone
Rate limit1 quota unit

Needs the upload scope https://www.googleapis.com/auth/youtube.upload (or the broader youtube or youtube.force-ssl). Uploads draw on a separate daily allowance of 100 calls rather than the shared 10,000-unit pool; each upload counts as roughly 1 unit against that bucket.

Acts onvideo
Permission (capability)youtube.upload
VersionAvailable since the API’s base version
Webhook eventNone
Rate limit1 quota unit (100 uploads per day)

Needs the manage scope https://www.googleapis.com/auth/youtube (or youtube.force-ssl). Any unset writable property in the request is reset, so the full object should be sent.

Acts onvideo
Permission (capability)youtube
VersionAvailable since the API’s base version
Webhook eventNone
Rate limit50 quota units

Needs the manage scope https://www.googleapis.com/auth/youtube (or youtube.force-ssl). Acts as the authenticated user.

Acts onvideo rating
Permission (capability)youtube
VersionAvailable since the API’s base version
Webhook eventNone
Rate limit50 quota units

Needs the caller's authorization. Read-only scope: https://www.googleapis.com/auth/youtube.readonly.

Acts onvideo rating
Permission (capability)youtube.readonly
VersionAvailable since the API’s base version
Webhook eventNone
Rate limit1 quota unit

Needs the manage scope https://www.googleapis.com/auth/youtube (or youtube.force-ssl). The deletion is permanent.

Acts onvideo
Permission (capability)youtube
VersionAvailable since the API’s base version
Webhook eventNone
Rate limit50 quota units

Channels

Read a channel's details and statistics, and update its branding and settings.2

Reading public channels needs only an API key; the mine parameter and private parts need authorization. The forHandle parameter, added January 2024, looks a channel up by its handle. Read-only scope: https://www.googleapis.com/auth/youtube.readonly.

Acts onchannel
Permission (capability)youtube.readonly
VersionAvailable since the API’s base version
Webhook eventNone
Rate limit1 quota unit

Needs the manage scope https://www.googleapis.com/auth/youtube (or youtubepartner). Only a subset of channel properties can be set this way.

Acts onchannel
Permission (capability)youtube
VersionAvailable since the API’s base version
Webhook eventNone
Rate limit50 quota units

Playlists

List, create, update, and delete playlists on a channel.4

Reading public playlists needs only an API key; the mine parameter needs authorization. Read-only scope: https://www.googleapis.com/auth/youtube.readonly.

Acts onplaylist
Permission (capability)youtube.readonly
VersionAvailable since the API’s base version
Webhook eventNone
Rate limit1 quota unit

Needs the manage scope https://www.googleapis.com/auth/youtube (or youtube.force-ssl, or youtubepartner).

Acts onplaylist
Permission (capability)youtube
VersionAvailable since the API’s base version
Webhook eventNone
Rate limit50 quota units

Needs the manage scope https://www.googleapis.com/auth/youtube (or youtube.force-ssl, or youtubepartner). Any unset writable property is reset.

Acts onplaylist
Permission (capability)youtube
VersionAvailable since the API’s base version
Webhook eventNone
Rate limit50 quota units

Needs the manage scope https://www.googleapis.com/auth/youtube (or youtube.force-ssl, or youtubepartner).

Acts onplaylist
Permission (capability)youtube
VersionAvailable since the API’s base version
Webhook eventNone
Rate limit50 quota units

Playlist items

List the videos in a playlist, add a video to one, and update or remove an entry.2

Reading items in a public playlist needs only an API key. Read-only scope: https://www.googleapis.com/auth/youtube.readonly.

Acts onplaylist item
Permission (capability)youtube.readonly
VersionAvailable since the API’s base version
Webhook eventNone
Rate limit1 quota unit

Needs the manage scope https://www.googleapis.com/auth/youtube (or youtube.force-ssl, or youtubepartner).

Acts onplaylist item
Permission (capability)youtube
VersionAvailable since the API’s base version
Webhook eventNone
Rate limit50 quota units

Comments

List comment threads on a video, read replies, post a top-level comment or a reply, update one, and set its moderation status.3

Public comment threads can be read with an API key. When a token is used, the force-ssl scope is https://www.googleapis.com/auth/youtube.force-ssl.

Acts oncomment thread
Permission (capability)youtube.force-ssl
VersionAvailable since the API’s base version
Webhook eventNone
Rate limit1 quota unit

Needs the force-ssl scope https://www.googleapis.com/auth/youtube.force-ssl, which is the only scope that grants comment writes. To start a new top-level comment thread, use commentThreads.insert instead.

Acts oncomment
Permission (capability)youtube.force-ssl
VersionAvailable since the API’s base version
Webhook eventNone
Rate limit50 quota units

Needs the force-ssl scope https://www.googleapis.com/auth/youtube.force-ssl. The caller must own the video or channel the comments are on.

Acts oncomment
Permission (capability)youtube.force-ssl
VersionAvailable since the API’s base version
Webhook eventNone
Rate limit50 quota units

Subscriptions

List a channel's subscriptions, subscribe to a channel, and unsubscribe.2

Needs the caller's authorization to read their own subscriptions. Read-only scope: https://www.googleapis.com/auth/youtube.readonly.

Acts onsubscription
Permission (capability)youtube.readonly
VersionAvailable since the API’s base version
Webhook eventNone
Rate limit1 quota unit

Needs the manage scope https://www.googleapis.com/auth/youtube (or youtube.force-ssl, or youtubepartner).

Acts onsubscription
Permission (capability)youtube
VersionAvailable since the API’s base version
Webhook eventNone
Rate limit50 quota units

Captions & thumbnails

List and upload caption tracks for a video, and set a custom thumbnail.3

Needs the force-ssl scope https://www.googleapis.com/auth/youtube.force-ssl (or youtubepartner), and the caller must own the video. Listing captions costs 50 units, more than a typical read.

Acts oncaption
Permission (capability)youtube.force-ssl
VersionAvailable since the API’s base version
Webhook eventNone
Rate limit50 quota units

Needs the force-ssl scope https://www.googleapis.com/auth/youtube.force-ssl (or youtubepartner). Since March 2024 the sync parameter is deprecated, so caption files must carry their own timing.

Acts oncaption
Permission (capability)youtube.force-ssl
VersionAvailable since the API’s base version
Webhook eventNone
Rate limit400 quota units

Needs the upload scope https://www.googleapis.com/auth/youtube.upload (or youtube, youtube.force-ssl, or youtubepartner). Custom thumbnails require the channel to be verified.

Acts onthumbnail
Permission (capability)youtube.upload
VersionAvailable since the API’s base version
Webhook eventNone
Rate limit50 quota units
No endpoints match those filters.
Webhooks

Webhook events.

The YouTube Data API has no webhooks. To be notified when a channel uploads a new video, an app or AI agent subscribes to that channel's feed through PubSubHubbub, a separate push service, rather than polling the API.

EventWhat it signalsTriggered by
No events match that search.
Rate limits & pagination

Rate limits, pagination & request size.

YouTube limits use by quota units rather than by request count. Every call spends units from a daily allowance, with reads costing little and writes and searches costing far more, so the model rewards reading and rations writing.

Request rate

YouTube governs the Data API by quota units, not by a simple request count. Every project starts with a default allowance of 10,000 units per day, shared across most endpoints and reset at midnight Pacific time. The cost depends on the method: a read that retrieves a list of resources such as videos, channels, or playlists usually costs 1 unit, a write that creates, updates, or deletes a resource usually costs 50 units, and a search costs 100 units. Some methods cost more, such as listing or uploading captions. Two methods sit in their own daily buckets rather than the shared pool: search.list is capped at 100 calls per day and video uploads at 100 per day. Each endpoint's cost is shown on its row. The error code quotaExceeded signals the allowance is spent, and a higher quota can be requested from Google.

Pagination

List methods return a fixed page of results with a nextPageToken (and where relevant a prevPageToken) in the response. The next page is fetched by passing that token back in the pageToken parameter, repeating until no token is returned. The maxResults parameter sets the page size, accepting 0 to 50 for most methods, with a default of 5. Result paging cannot jump to an arbitrary offset.

Request size

Requests and responses are JSON. The part parameter controls which sections of a resource are returned, and trimming it lowers the response size. Media uploads such as videos and captions are sent as separate multipart or resumable uploads, with the maximum video file size set by the channel's upload limits rather than the API.

Errors

Status codes & error handling.

The status codes an agent should handle, and what to do about each.

StatusCodeMeaningWhat to do
400badRequestThe request is malformed: an invalid parameter value, a missing required parameter, or two parameters that cannot be combined. Specific reasons include missingRequiredParameter and incompatibleParameters.Read the reason in the error body, correct the named parameter, and resend.
401authorizationRequiredThe request uses a parameter that needs authorization, such as mine, but no valid OAuth credentials were sent. A related youtubeSignupRequired means the Google account has no linked YouTube channel.Send a valid OAuth 2.0 access token for an account that owns a YouTube channel.
403forbiddenThe request is authenticated but not permitted: the token lacks the scope the method needs, or the caller does not own the resource it is acting on.Grant the missing scope, or act only on resources the authenticated channel owns.
403quotaExceededThe daily quota allowance has been spent. Because writes and searches cost far more than reads, a project can hit this with relatively few calls.Wait for the daily reset at midnight Pacific time, cut quota use, or request a higher quota allowance.
404notFoundThe video, channel, playlist, or other resource named in the request does not exist or cannot be seen by the caller.Confirm the id is correct and that the resource is public or owned by the authenticated user.
429tooManyRequestsToo many requests were sent in a short window, separate from the daily quota. An example is uploadRateLimitExceeded when uploads or thumbnail sets come too fast.Back off and retry after a delay, spreading requests out over time.
Versioning & freshness

Version history.

The YouTube Data API is on version 3. There is no dated version string to pin, so the API is continuously updated and notable changes ship through the revision history.

Version history

What changed, and when

Latest versionv3
v3Current version
YouTube Data API v3 (current)

Version 3 is the current YouTube Data API. It is not pinned by a dated version string; instead it is continuously updated, and notable changes ship through the dated revision history. The entries below are the most recent notable changes, newest first.

What changed
  • The API stays on v3, with new methods and behavior changes shipped through the dated revision history rather than a new version number.
2026-06-03Feature update
videos.batchGetStats added

A new videos.batchGetStats method retrieves video statistics from a dedicated daily quota bucket, separate from the shared 10,000-unit pool.

2026-06-01Feature update
Granular quota buckets

search.list and videos.insert moved to their own separate daily quota buckets as part of a more granular quota model, rather than drawing on the shared pool.

2025-12-04Feature update
Video upload quota cost reduced

The quota cost of a video upload through videos.insert was reduced substantially, making programmatic uploads far cheaper against the daily allowance.

2024-04-30Requires migration
Channel discussions discontinued

Channel discussions were discontinued, ending the activities.insert method for that use.

2024-03-13Feature update
Caption sync parameter deprecated

The sync parameter for captions.insert and captions.update was deprecated, so uploaded caption files must now carry their own timing information.

2024-01-31Feature update
forHandle parameter on channels.list

A forHandle parameter was added to channels.list, letting a channel be looked up by its YouTube handle.

An integration tracks changes through the dated revision history rather than pinning a version.

YouTube Data API revision history ↗
Questions

YouTube Data API, answered.

Do I need OAuth, or is an API key enough?+
It depends on what the call touches. An API key is enough to read public data, such as listing public videos, looking up a channel, or running a search. Anything tied to a specific user, like the mine parameter, a private read, or any write such as uploading a video or posting a comment, requires an OAuth 2.0 access token from a Google account that owns a YouTube channel.
How does the quota work, and why did I run out so fast?+
The Data API charges quota units, not requests, against a default of 10,000 units per day. A list read costs about 1 unit, but a write costs about 50 and a search costs 100, so a few hundred searches or a couple of hundred writes can exhaust the day's allowance while millions of simple reads would fit. The part parameter does not change a method's base cost. A higher quota can be requested from Google, and the allowance resets at midnight Pacific time.
Why does search cost so much more than a normal read?+
A search.list call costs 100 quota units, against 1 unit for a typical list read, because it scans across YouTube rather than fetching known resources by id. Where a video id is already known, listing it directly with videos.list costs 1 unit, so searches are best reserved for genuine discovery and cached where possible.
Can I get notified when a channel uploads a new video?+
Yes, but not through the API itself, which has no webhooks. YouTube supports PubSubHubbub, a push protocol where an application subscribes to a channel's feed and Google's hub posts a notification when that channel publishes or updates a video. This avoids repeatedly polling search or the channel's uploads playlist, which would spend quota.
What is the difference between the youtube and youtube.force-ssl scopes?+
Both manage an account, but youtube.force-ssl reaches further. The youtube scope covers managing videos, playlists, and subscriptions. youtube.force-ssl covers everything youtube does and, in addition, reading and writing comments and captions, with all calls required over HTTPS. Posting or moderating comments and uploading captions therefore need force-ssl rather than the plain youtube scope.
Does the API have versions I should pin?+
The current API is version 3, and there is no dated version string to pin as with some other APIs. It is continuously updated, and notable changes, such as deprecations and new methods, are published in the revision history with their dates. An integration tracks that history rather than selecting a version per request.
Related

More social API guides for agents

What is Bollard AI?

Control what every AI agent can do in YouTube.

Bollard AI sits between a team's AI agents and YouTube. Grant each agent exactly the access it needs, read or write, action by action, and every call is checked and logged.

  • Set read, write, or full access per agent, never a shared YouTube key.
  • Denied by default, so an agent reaches only what has been explicitly allowed.
  • Every call recorded in plain English: who, what, where, and the decision.
YouTube
Channel Agent
Read videos and channel stats ResourceOffReadFull use
Reply to comments ActionOffReadFull use
Upload or delete videos ActionOffReadFull use
Per-agent access, set in Bollard AI, not in YouTube