How to Connect YouTube API to an AI Agent
Auth setup
1. Enable YouTube Data API v3 in Google Cloud Console. 2. Create API key for read-only public data. 3. Create OAuth credentials for user operations.
Key facts
| Base URL | https://www.googleapis.com/youtube/v3/ |
| API version | v3 |
| Auth | API key for public data. OAuth 2.0 for user data (uploads, playlists). Enable YouTube Data API v3 in Google Cloud Console. |
| Token URL | https://oauth2.googleapis.com/token |
| Scopes | https://www.googleapis.com/auth/youtube |
| Request body | application/json |
| Pagination | token-based: nextPageToken and prevPageToken in response. Use pageToken param. |
| Rate limit | 10,000 quota units/day. Each endpoint costs different units (search=100, list=1). |
| Error format | JSON: {"error":{"code":403,"message":"...","errors":[{"reason":"quotaExceeded"}]}} |
Key endpoints
| Method | Path | Description |
GET | /search | Search videos, channels, playlists |
GET | /videos | Get video details |
GET | /channels | Get channel details |
POST | /videos?uploadType=resumable | Upload video |
Quickstart
GET /youtube/v3/search?part=snippet&q=MCP+server&type=video&key={API_KEY}
Agent pitfalls & tips
- Quota is unit-based, NOT request-based. Search costs 100 units!
- Use 'part' parameter wisely โ each part (snippet, statistics, contentDetails) adds quota cost.
- API key works for all public data โ no OAuth needed for reading.
- Upload requires resumable upload protocol for reliability.
- Analytics API is separate: youtubeAnalytics.googleapis.com.
Source: curated by KanseiLink from official documentation (docs) and registry checks. Last reviewed: 2026-04-07. Specs change โ verify against the official docs before production use.
Frequently Asked Questions
What is YouTube API's AEO score?
โผ
YouTube API has an AEO score of 0.70 and is rated A (Functional agent integration). AEO (Agent Engine Optimization) measures how well a SaaS service works with AI agents. Scores range from 0.00 to 1.00, with grades from AAA (best) to D (not agent-ready).
Is YouTube API AI-agent-ready?
โผ
YouTube API is currently connectable for AI agent use. Third-party MCP integrations are available for this service. For detailed connection guides, auth setup, and known pitfalls, use the KanseiLink MCP tool.
How does YouTube API compare to other Marketing services?
โผ
In the Marketing category, YouTube API is rated A. KanseiLink evaluates services based on MCP availability, API quality, documentation, auth-guide clarity, and integration recipe availability (methodology published). Visit the full rankings at kansei-link.com to see how YouTube API compares.
How can I integrate YouTube API with an AI agent?
โผ
The fastest way to integrate YouTube API with an AI agent is through KanseiLink MCP. Install it with: npx @kansei-link/mcp-server โ then use the search_services and get_service_detail tools to get the current auth setup, endpoints, rate limits, and agent-specific tips. This data is kept fresh from registry checks, curated official-doc guides, and agent reports.
How do I authenticate with YouTube API?
โผ
API key for public data. OAuth 2.0 for user data (uploads, playlists). Enable YouTube Data API v3 in Google Cloud Console. Setup: 1. Enable YouTube Data API v3 in Google Cloud Console. 2. Create API key for read-only public data. 3. Create OAuth credentials for user operations.
What are YouTube API's API rate limits?
โผ
10,000 quota units/day. Each endpoint costs different units (search=100, list=1).