Home / Platforms / YouTube
YouTube Data API v3 Stable

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 · 2026

The 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.

Content Management
Upload, update, and delete videos. Set privacy, thumbnails, metadata, and AI-generated content flags.
Search & Discovery
Search videos, channels, and playlists with advanced filters. Retrieve trending and recommended content.
Analytics Data
Retrieve view counts, likes, comments, and engagement metrics for channels and videos.
Playlist Management
Create, modify, and delete playlists. Manage playlist items programmatically.

API Features

FeatureDescriptionEndpointStatus
Video UploadUpload videos via resumable upload protocolvideos.insertAvailable
Video SearchSearch across all YouTube content with filterssearch.listAvailable
Video MetadataRead/update title, description, tags, categoryvideos.list/updateAvailable
Channel InfoRetrieve channel stats, branding, playlistschannels.listAvailable
Playlist CRUDCreate, read, update, delete playlists and itemsplaylists.*Available
CommentsList, insert, update, delete comments and repliescommentThreads.*Available
ThumbnailsUpload custom thumbnails for videosthumbnails.setAvailable
CaptionsUpload and manage caption/subtitle trackscaptions.*Available
Live StreamingManage live broadcasts and stream objectsliveBroadcasts.*Advanced

API Limits & Quotas

Updated June 2026

2026 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 TypeDefault LimitResetScope
General Daily Quota10,000 units / dayMidnight Pacific TimeAll endpoints except search & insert
Video Uploads (videos.insert)100 calls / dayMidnight Pacific TimeDedicated bucket since June 2026
Search (search.list)100 calls / dayMidnight Pacific TimeDedicated bucket since June 2026
Failed RequestsAt least 1 unitPer requestInvalid or error responses still consume quota

Cost per Operation (General Pool)

Operation TypeCost (units)Example Endpoints
Read1videos.list, channels.list
Write / Update50videos.update, playlists.insert
Delete50videos.delete
Thumbnail Upload50thumbnails.set
Caption Upload400captions.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

ParameterRequirementNotes
Supported FormatsMP4, MOV, AVI, FLV, 3GPP, MPEG4, WEBM, WMV, M4VMP4 H.264 recommended
Max File Size256 GBUse resumable upload for files >5 MB
Max Duration12 hours (verified account), 15 min (unverified)Account verification required for longer uploads
Video CodecH.264, H.265, VP9, AV1H.264 recommended for maximum compatibility
Audio CodecAAC-LC, HE-AAC, MP3, Vorbis, Opus, PCMAAC-LC at 128 kbps+ recommended
Resolution1080p (1920×1080) or 4K (3840×2160) recommendedMinimum 426×240
Aspect Ratio16:9 (preferred), 4:3 auto-letterboxed16:9 is the standard YouTube player ratio
Frame Rate24, 25, 30, 48, 50, 60 fpsPreserved as uploaded

Thumbnail Specifications

ParameterRequirement
FormatsJPG, PNG, GIF, BMP, WebP
Max File Size2 MB
Recommended Resolution1280×720 (720p minimum)
Aspect Ratio16: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.

RequirementDetails
Auth MethodOAuth 2.0
Developer AccountGoogle Account + Google Cloud Project with YouTube Data API v3 enabled
API KeyRequired for read-only public data (no user context needed)
OAuth CredentialsClient ID + Client Secret for user-authenticated write operations
Audit RequirementMandatory for uploading public/unlisted videos (applies to projects created after July 28, 2020)
AI Content Flagstatus.containsSyntheticMedia must be true for AI-generated content

Required OAuth Scopes

https://www.googleapis.com/auth/youtube https://www.googleapis.com/auth/youtube.upload https://www.googleapis.com/auth/youtube.readonly https://www.googleapis.com/auth/youtubepartner https://www.googleapis.com/auth/youtube.force-ssl

Quick Start Guide

1

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.

2

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).

3

Authorize the User & Get Access Token

HTTP GET
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
4

Initialize Resumable Video Upload

HTTP POST
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.

5

Retrieve Video Info

HTTP GET
GET https://www.googleapis.com/youtube/v3/videos
  ?id=VIDEO_ID&part=snippet,statistics
  &key=YOUR_API_KEY

Common Errors & Solutions

Error CodeMeaningCommon CauseSolution
403 quotaExceededDaily quota exceededAll units in the general, search, or upload bucket are consumedWait for midnight PT reset or apply for quota increase via the audit form
401 unauthorizedInvalid credentialsExpired or revoked access tokenUse the refresh token to obtain a new access token
403 forbiddenInsufficient permissionsMissing required OAuth scopeRe-authorize the user requesting the correct scopes
404 notFoundResource not foundVideo or channel ID is incorrect or deletedVerify the resource ID exists before requesting
400 badRequestInvalid request bodyMissing required metadata fieldsEnsure all required fields (title, categoryId, privacyStatus) are provided
503 backendErrorServer-side errorYouTube servers temporarily unavailableImplement 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.