YouTube API
The YouTube Data API v3 lets you incorporate YouTube functionality into your applications — video uploads, metadata management, search, playlist management, and channel analytics.
API Overview
v3 · 2026The YouTube Data API v3 is part of Google's API ecosystem and provides programmatic access to YouTube's core platform functionality. Developers can search videos, upload content, manage playlists, retrieve channel data, and access video statistics through a RESTful interface secured with OAuth 2.0.
API Features
| Feature | Description | Endpoint | Status |
|---|---|---|---|
| Video Upload | Upload videos via resumable upload protocol | videos.insert | Available |
| Video Search | Search across all YouTube content with filters | search.list | Available |
| Video Metadata | Read/update title, description, tags, category | videos.list/update | Available |
| Channel Info | Retrieve channel stats, branding, playlists | channels.list | Available |
| Playlist CRUD | Create, read, update, delete playlists and items | playlists.* | Available |
| Comments | List, insert, update, delete comments and replies | commentThreads.* | Available |
| Thumbnails | Upload custom thumbnails for videos | thumbnails.set | Available |
| Captions | Upload and manage caption/subtitle tracks | captions.* | Available |
| Live Streaming | Manage live broadcasts and stream objects | liveBroadcasts.* | Advanced |
API Limits & Quotas
Updated June 20262026 Quota Update (June 2026): videos.insert and search.list are now in separate dedicated quota buckets and no longer consume from the general 10,000-unit daily pool. Older documentation showing 1,600 units per upload is now obsolete.
| Quota Type | Default Limit | Reset | Scope |
|---|---|---|---|
| General Daily Quota | 10,000 units / day | Midnight Pacific Time | All endpoints except search & insert |
| Video Uploads (videos.insert) | 100 calls / day | Midnight Pacific Time | Dedicated bucket since June 2026 |
| Search (search.list) | 100 calls / day | Midnight Pacific Time | Dedicated bucket since June 2026 |
| Failed Requests | At least 1 unit | Per request | Invalid or error responses still consume quota |
Cost per Operation (General Pool)
| Operation Type | Cost (units) | Example Endpoints |
|---|---|---|
| Read | 1 | videos.list, channels.list |
| Write / Update | 50 | videos.update, playlists.insert |
| Delete | 50 | videos.delete |
| Thumbnail Upload | 50 | thumbnails.set |
| Caption Upload | 400 | captions.insert |
Quota is scoped at the Google Cloud project level. Multiple API keys within the same project share one pool. Monitor usage at Google Cloud Console → APIs & Services → Quotas.
Media Requirements
Video Upload Specifications
| Parameter | Requirement | Notes |
|---|---|---|
| Supported Formats | MP4, MOV, AVI, FLV, 3GPP, MPEG4, WEBM, WMV, M4V | MP4 H.264 recommended |
| Max File Size | 256 GB | Use resumable upload for files >5 MB |
| Max Duration | 12 hours (verified account), 15 min (unverified) | Account verification required for longer uploads |
| Video Codec | H.264, H.265, VP9, AV1 | H.264 recommended for maximum compatibility |
| Audio Codec | AAC-LC, HE-AAC, MP3, Vorbis, Opus, PCM | AAC-LC at 128 kbps+ recommended |
| Resolution | 1080p (1920×1080) or 4K (3840×2160) recommended | Minimum 426×240 |
| Aspect Ratio | 16:9 (preferred), 4:3 auto-letterboxed | 16:9 is the standard YouTube player ratio |
| Frame Rate | 24, 25, 30, 48, 50, 60 fps | Preserved as uploaded |
Thumbnail Specifications
| Parameter | Requirement |
|---|---|
| Formats | JPG, PNG, GIF, BMP, WebP |
| Max File Size | 2 MB |
| Recommended Resolution | 1280×720 (720p minimum) |
| Aspect Ratio | 16:9 |
Authentication & Access
Service Accounts Not Supported for Uploads: Video uploads require the channel owner to explicitly authorize via the OAuth consent flow. Service accounts cannot upload to a user's channel.
| Requirement | Details |
|---|---|
| Auth Method | OAuth 2.0 |
| Developer Account | Google Account + Google Cloud Project with YouTube Data API v3 enabled |
| API Key | Required for read-only public data (no user context needed) |
| OAuth Credentials | Client ID + Client Secret for user-authenticated write operations |
| Audit Requirement | Mandatory for uploading public/unlisted videos (applies to projects created after July 28, 2020) |
| AI Content Flag | status.containsSyntheticMedia must be true for AI-generated content |
Required OAuth Scopes
Quick Start Guide
Create a Google Cloud Project
Go to console.developers.google.com, create a new project, and enable the YouTube Data API v3 from the API Library.
Create OAuth 2.0 Credentials
In APIs & Services → Credentials, create an OAuth 2.0 Client ID. Download the JSON credentials file for your application type (Web, Desktop, or Mobile).
Authorize the User & Get Access Token
GET https://accounts.google.com/o/oauth2/auth ?client_id=YOUR_CLIENT_ID &redirect_uri=YOUR_REDIRECT_URI &response_type=code &scope=https://www.googleapis.com/auth/youtube.upload &access_type=offline
Initialize Resumable Video Upload
POST https://www.googleapis.com/upload/youtube/v3/videos
?uploadType=resumable&part=snippet,status
Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json
{
"snippet": {
"title": "My Video Title",
"description": "Video description here",
"categoryId": "22"
},
"status": {
"privacyStatus": "public",
"selfDeclaredMadeForKids": false,
"containsSyntheticMedia": false
}
}The response Location header contains the upload URI. Stream video bytes to that URI to complete the upload.
Retrieve Video Info
GET https://www.googleapis.com/youtube/v3/videos ?id=VIDEO_ID&part=snippet,statistics &key=YOUR_API_KEY
Common Errors & Solutions
| Error Code | Meaning | Common Cause | Solution |
|---|---|---|---|
| 403 quotaExceeded | Daily quota exceeded | All units in the general, search, or upload bucket are consumed | Wait for midnight PT reset or apply for quota increase via the audit form |
| 401 unauthorized | Invalid credentials | Expired or revoked access token | Use the refresh token to obtain a new access token |
| 403 forbidden | Insufficient permissions | Missing required OAuth scope | Re-authorize the user requesting the correct scopes |
| 404 notFound | Resource not found | Video or channel ID is incorrect or deleted | Verify the resource ID exists before requesting |
| 400 badRequest | Invalid request body | Missing required metadata fields | Ensure all required fields (title, categoryId, privacyStatus) are provided |
| 503 backendError | Server-side error | YouTube servers temporarily unavailable | Implement exponential backoff and retry |
Best Practices
Cache Static Data
Cache video titles, descriptions and channel info locally. Only re-fetch dynamic data (e.g. view counts) when necessary to preserve daily quota.
Batch ID Requests
Pass up to 50 comma-separated IDs in one videos.list call instead of 50 individual requests to conserve quota.
Minimize search.list Use
Use videos.list (1 unit) for known IDs instead of the limited 100-call/day search bucket.
Use Resumable Uploads
Always use the resumable upload protocol for video files. It handles network interruptions and supports files up to 256 GB.
Secure Token Storage
Never hardcode OAuth tokens. Use encrypted secrets management. Access tokens expire in 1 hour — always use refresh tokens to renew.
AI Content Disclosure
Set status.containsSyntheticMedia = true for AI-generated or manipulated content. Required by YouTube policy since 2025.