Skip to Content
ChannelsYoutubeYouTube — Channel Overview

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:

  1. 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
  2. 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

CapabilityDetail
AnalyticsViews, watch time, subscribers, top videos, traffic sources, audience retention
Video publishingUpload videos via YouTube Data API v3 (Phase 2)
Content assistRepurposer generates: video description, chapter markers, tags, end-screen script
Keyword researchYouTube search suggestions feed into the Keyword Researcher agent as a secondary source
Insight workerTop video themes; subscriber growth; watch time trend; best performing video lengths

Workers Needed

WorkerQueueTrigger
youtube-insights.worker.ts (new)agent__youtube-insightsWeekly
content-repurposer.worker.ts — add YouTube output typeagent__content-repurposerOn 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:

  1. Overview — subscriber count, total views, watch time (last 30 days)
  2. Top Videos — sorted by views or watch time; thumbnail + metrics table
  3. Traffic Sources — pie chart of where views come from
  4. Insights — AI-generated performance summary
  5. Suggestions — action items from insight worker

Implementation Plan

Phase 1 — Connect + Analytics

  1. Create packages/providers/youtube/src/index.ts:

    • getAuthUrl(callbackUrl, channelId) — extend Google auth with YouTube scopes
    • exchangeCode(code, callbackUrl) — returns tokens (reuse Google OAuth pattern)
    • refreshAccessToken(refreshToken) — same as other Google channels
    • getChannels(accessToken)GET /youtube/v3/channels?mine=true — list user’s channels
    • getChannelStats(accessToken, channelId) — subscribers, total views, videoCount
    • getTopVideos(accessToken, channelId, maxResults)GET /youtube/v3/videos
    • getVideoAnalytics(accessToken, channelId, startDate, endDate) — YouTube Analytics API
  2. 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 select
    • GET /youtube/page/select → list channels
    • POST /youtube/page/select → save selected channel as subChannelInfo
  3. Add seed entry to packages/db/prisma/seed.ts

  4. Create youtube-insights.worker.ts

  5. Create YouTubeChannelDetail.tsx

Phase 2 — Video Publishing

  1. Add uploadVideo(accessToken, videoFile, metadata) to provider:

    • Resumable upload: POST /upload/youtube/v3/videos with uploadType=resumable
    • Metadata: title, description, tags, categoryId, privacyStatus
  2. Add case "youtube" to social-publisher.worker.ts (or a new youtube-publisher.worker.ts)

  3. SocialPost enum: add YouTube as a platform

Phase 3 — Content Repurposer

  1. 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"], },

© 2026 Leadmetrics — Internal use only