YouTube — Channel Overview
Researched: May 2026
Why This Channel
YouTube is the world’s second-largest search engine and the dominant long-form video platform. Most Leadmetrics clients already have a YouTube channel — they just don’t have a system to manage it alongside their other content. Connecting YouTube creates two distinct value streams:
- Analytics — pull views, watch time, subscriber growth, and top-performing videos into the platform so agents can use real performance data to inform content strategy
- Content assist — the Content Repurposer agent can auto-generate YouTube video descriptions, chapter timestamps, and end-screen scripts from existing blog posts; the Blog Writer can surface video topics based on what’s performing on the channel
YouTube also uses Google OAuth — the same infrastructure already used for GSC, GA4, Google Ads, and GBP. Adding YouTube is a one-scope extension of what already exists.
Auth Mechanism
Google OAuth 2.0 — reuse the existing Google provider infrastructure.
- Auth URL:
https://accounts.google.com/o/oauth2/v2/auth - Token URL:
https://oauth2.googleapis.com/token - Scopes:
https://www.googleapis.com/auth/youtube.readonly https://www.googleapis.com/auth/youtube.upload - Token refresh: same as existing Google channels (access token 1 hour; refresh token long-lived)
Sub-channel selection: after OAuth, the user selects which YouTube Channel to connect (some accounts manage multiple channels). Stored as subChannelInfo.id = channelId.
What It Enables
| Capability | Detail |
|---|---|
| Analytics | Views, watch time, subscribers, top videos, traffic sources, audience retention |
| Video publishing | Upload videos via YouTube Data API v3 (Phase 2) |
| Content assist | Repurposer generates: video description, chapter markers, tags, end-screen script |
| Keyword research | YouTube search suggestions feed into the Keyword Researcher agent as a secondary source |
| Insight worker | Top video themes; subscriber growth; watch time trend; best performing video lengths |
Workers Needed
| Worker | Queue | Trigger |
|---|---|---|
youtube-insights.worker.ts (new) | agent__youtube-insights | Weekly |
content-repurposer.worker.ts — add YouTube output type | agent__content-repurposer | On blog post approval (when YouTube channel connected) |
Content Repurposer Integration
When a blog post is approved and the tenant has a connected YouTube channel, the Content Repurposer can generate:
- YouTube video script (intro hook + body + CTA, based on blog content)
- Video description (SEO-optimised, 5000 chars max, with timestamps)
- Tags (30 tags, mix of broad + specific)
- Chapter markers (00:00 Intro, 01:30 Main Point, etc.)
- Thumbnail concept brief (headline + visual direction for designer)
- End screen script (subscribe CTA + next video suggestion)This turns every approved blog post into a YouTube content package — one of the highest-leverage content-multiplication features in the platform.
Insight Worker Output (ChannelInsight)
- Total views and watch time over 30 days
- Subscriber net change (gained vs. lost)
- Top 5 videos by views + watch time percentage
- Best performing video lengths (< 5 min vs 5–15 min vs 15+ min)
- Top traffic sources (YouTube Search vs. Suggested vs. External)
- Suggested: next video topic based on top-search-traffic videos
Channel Detail Page — YouTubeChannelDetail.tsx
Tabs:
- Overview — subscriber count, total views, watch time (last 30 days)
- Top Videos — sorted by views or watch time; thumbnail + metrics table
- Traffic Sources — pie chart of where views come from
- Insights — AI-generated performance summary
- Suggestions — action items from insight worker
Implementation Plan
Phase 1 — Connect + Analytics
-
Create
packages/providers/youtube/src/index.ts:getAuthUrl(callbackUrl, channelId)— extend Google auth with YouTube scopesexchangeCode(code, callbackUrl)— returns tokens (reuse Google OAuth pattern)refreshAccessToken(refreshToken)— same as other Google channelsgetChannels(accessToken)—GET /youtube/v3/channels?mine=true— list user’s channelsgetChannelStats(accessToken, channelId)— subscribers, total views, videoCountgetTopVideos(accessToken, channelId, maxResults)—GET /youtube/v3/videosgetVideoAnalytics(accessToken, channelId, startDate, endDate)— YouTube Analytics API
-
Add OAuth routes to
apps/api/src/routers/channel-connect.ts:GET /youtube/connect→ return auth URL (YouTube-scoped)GET /youtube/callback→ exchange code, redirect to channel selectGET /youtube/page/select→ list channelsPOST /youtube/page/select→ save selected channel assubChannelInfo
-
Add seed entry to
packages/db/prisma/seed.ts -
Create
youtube-insights.worker.ts -
Create
YouTubeChannelDetail.tsx
Phase 2 — Video Publishing
-
Add
uploadVideo(accessToken, videoFile, metadata)to provider:- Resumable upload:
POST /upload/youtube/v3/videoswithuploadType=resumable - Metadata: title, description, tags, categoryId, privacyStatus
- Resumable upload:
-
Add
case "youtube"tosocial-publisher.worker.ts(or a newyoutube-publisher.worker.ts) -
SocialPostenum: addYouTubeas a platform
Phase 3 — Content Repurposer
- Add YouTube output case to
content-repurposer.worker.ts— triggered when blog post is approved + YouTube channel is connected
Seed Entry
// packages/db/prisma/seed.ts — CHANNEL_CATALOGUE
{
type: "YouTube",
name: "YouTube",
iconKey: "youtube",
description: "Track YouTube analytics and generate video content from blog posts.",
authenticationType: "oauth2",
requiresUrl: false,
isActive: true,
categories: ["social_media", "seo"],
},