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
- User Experience: Fewer scopes = better user adoption
- Security: More restrictive scopes reduce potential security risks
- App Review: Some scopes require additional verification
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
- Incremental Authorization: Request additional scopes as needed rather than all at once
- Scope Explanation: Provide clear explanations to users about why each scope is needed
- Error Handling: Handle scope-related errors gracefully
- 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.
- Regularly review the scopes your application uses
- Monitor for scope changes in API updates
- Implement proper token storage and rotation
- Use HTTPS for all API communications
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 |
✅ |
✅ |
❌ |
❌ |
❌ |
✅ |
Troubleshooting
Common Scope-Related Issues
- Insufficient Permissions: Ensure you're requesting the correct scope for the operation
- Scope Mismatch: Verify the token was obtained with the required scopes
- Expired Tokens: Implement token refresh logic
- 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.