YouTube API Scopes - Complete Reference

Comprehensive list of all YouTube API OAuth 2.0 scopes with usage guidelines

Table of Contents

YouTube Data API v3 Scopes

Basic Scopes

Scope Description Access Level
https://www.googleapis.com/auth/youtube Manage your YouTube account - full read/write access Full access
https://www.googleapis.com/auth/youtube.readonly View your YouTube account - read-only access Read-only
https://www.googleapis.com/auth/youtube.upload Upload YouTube videos - upload-only access Upload only

Channel-Specific Scopes

Scope Description Access Level
https://www.googleapis.com/auth/youtube.channel-memberships.creator Manage YouTube channel memberships Creator access

Partner Scopes

Scope Description Access Level
https://www.googleapis.com/auth/youtubepartner View and manage your assets and associated content on YouTube Partner access
https://www.googleapis.com/auth/youtubepartner-channel-audit View private information of your YouTube content Audit access

YouTube Analytics API Scopes

Scope Description Access Level
https://www.googleapis.com/auth/yt-analytics.readonly View YouTube Analytics reports for your YouTube content Read-only
https://www.googleapis.com/auth/yt-analytics-monetary.readonly View monetary reports for your YouTube content Financial read-only

YouTube Reporting API Scopes

Scope Description Access Level
https://www.googleapis.com/auth/youtube.readonly View YouTube reporting data Read-only
https://www.googleapis.com/auth/yt-analytics.readonly View YouTube Analytics reports Read-only

YouTube Live Streaming API Scopes

Scope Description Access Level
https://www.googleapis.com/auth/youtube Manage YouTube live streams Full access
https://www.googleapis.com/auth/youtube.readonly View YouTube live stream information Read-only
https://www.googleapis.com/auth/youtube.upload Upload YouTube live stream content Upload access

Scope Usage Guidelines

Choosing the Right Scope

Principle of Least Privilege: Always request the minimum scope required for your application

Common Scope Combinations

Basic Video Upload

https://www.googleapis.com/auth/youtube.upload

Channel Management

https://www.googleapis.com/auth/youtube

Analytics Dashboard

https://www.googleapis.com/auth/yt-analytics.readonly https://www.googleapis.com/auth/youtube.readonly

Content Creator App

https://www.googleapis.com/auth/youtube https://www.googleapis.com/auth/youtubepartner

Best Practices

Scope Request Best Practices

  1. Incremental Authorization: Request additional scopes as needed rather than all at once
  2. Scope Explanation: Provide clear explanations to users about why each scope is needed
  3. Error Handling: Handle scope-related errors gracefully
  4. Token Management: Store and refresh tokens securely

Security Considerations

Security Warning: Never hardcode scopes in client-side code. Use server-side authentication for sensitive operations.

Example OAuth 2.0 Flow with Scopes

// Node.js example using Google API Client Library const {google} = require('googleapis'); const youtube = google.youtube('v3'); // Configure OAuth2 client const oauth2Client = new google.auth.OAuth2( 'YOUR_CLIENT_ID', 'YOUR_CLIENT_SECRET', 'YOUR_REDIRECT_URL' ); // Generate auth URL with specific scopes const scopes = [ 'https://www.googleapis.com/auth/youtube.upload', 'https://www.googleapis.com/auth/youtube.readonly' ]; const url = oauth2Client.generateAuthUrl({ access_type: 'offline', scope: scopes }); console.log('Authorize this app by visiting:', url);

Complete Scope Reference

All YouTube API Scopes

Basic YouTube Data API

https://www.googleapis.com/auth/youtube https://www.googleapis.com/auth/youtube.readonly https://www.googleapis.com/auth/youtube.upload

YouTube Partner Scopes

https://www.googleapis.com/auth/youtubepartner https://www.googleapis.com/auth/youtubepartner-channel-audit

YouTube Analytics

https://www.googleapis.com/auth/yt-analytics.readonly https://www.googleapis.com/auth/yt-analytics-monetary.readonly

YouTube Channel Memberships

https://www.googleapis.com/auth/youtube.channel-memberships.creator

Scope Comparison Table

Scope Read Write Upload Analytics Partner Memberships
youtube
youtube.readonly
youtube.upload
youtubepartner
yt-analytics.readonly
youtube.channel-memberships.creator

Additional Resources

Official YouTube API Documentation Google OAuth 2.0 Documentation YouTube API Scope Reference Google API Client Libraries

Troubleshooting

Common Scope-Related Issues

  1. Insufficient Permissions: Ensure you're requesting the correct scope for the operation
  2. Scope Mismatch: Verify the token was obtained with the required scopes
  3. Expired Tokens: Implement token refresh logic
  4. User Denied Scopes: Handle authorization failures gracefully

Debugging Tips

Note: Always refer to the official YouTube API documentation for the most up-to-date information and scope changes.