# YouTube

Monitor your favorite YouTube channels, track new uploads, analyze your subscriptions, and discover content with AI-powered insights.


# Overview

Connect Weavestream to YouTube to monitor:

  • 📺 Channel Videos - Latest uploads from any channel
  • 🔔 Subscriptions - New videos from channels you follow
  • 👍 Liked Videos - Your liked video history
  • 📝 Playlists - Videos in any playlist
  • 🎬 Your Channel - Your own uploads and analytics
  • 💬 Comments - Comments on videos
  • 🔥 Trending - Popular videos in your region

Estimated Setup Time: 10 minutes


# Prerequisites

  • Google account
  • YouTube account (if monitoring your own content)
  • Weavestream installed on your Mac

# Part 1: Get Your YouTube API Key

# Step 1: Go to Google Cloud Console

  1. Go to https://console.cloud.google.com
  2. Sign in with your Google account

# Step 2: Create a New Project

  1. Click the project dropdown at the top (says "Select a project")
  2. Click "New Project"
  3. Project name: Weavestream YouTube Monitor
  4. Click "Create"
  5. Wait for project creation (takes a few seconds)
  6. Select your new project from the dropdown

# Step 3: Enable YouTube Data API v3

  1. In the left sidebar, click "APIs & Services""Library"
  2. Search for "YouTube Data API v3"
  3. Click on "YouTube Data API v3"
  4. Click "Enable"
  5. Wait for API to be enabled

# Step 4: Create API Credentials

  1. Go to "APIs & Services""Credentials"
  2. Click "+ Create Credentials"
  3. Select "API key"
  4. Your API key will be created and displayed

📋 Copy your API key:

  • Example: AIzaSyAbc123XyZ789-RandomString456
  • Click the copy icon or manually copy it

Important: Click "Restrict Key" to secure it.

# Step 5: Restrict Your API Key (Recommended)

  1. After creating, click "Edit API key" (or find it in credentials list)
  2. Under "API restrictions":
    • Select "Restrict key"
    • Check "YouTube Data API v3"
  3. Under "Application restrictions" (optional but recommended):
    • Select "HTTP referrers (web sites)"
    • Or "IP addresses" if you want to lock it to your network
    • Or leave as "None" for testing
  4. Click "Save"

# Part 2: Find Channel IDs

To monitor specific YouTube channels, you need their Channel ID.

# Method 1: Via Channel URL

If channel URL looks like:

youtube.com/channel/UC4PooiX37Pld1T8J5SYT-SQ

Channel ID is: UC4PooiX37Pld1T8J5SYT-SQ (everything after /channel/)


# Method 2: Via Custom URL

If channel URL looks like:

youtube.com/@mkbhd
youtube.com/c/Mkbhd
youtube.com/user/marquesbrownlee

You need to convert it to a Channel ID:

Steps:

  1. Go to the channel's page
  2. View page source (Right-click → View Page Source)
  3. Search for "channelId" or "externalId"
  4. Copy the ID (starts with UC)

Or use this trick:

  1. Visit: https://www.youtube.com/@CHANNEL_HANDLE
  2. Click any video
  3. Look at video description → Click channel name
  4. URL will now show: youtube.com/channel/UC...

# Method 3: Via API

Use YouTube API to search:

GET https://www.googleapis.com/youtube/v3/search?part=snippet&q=MKBHD&type=channel&key=YOUR_API_KEY

Look for channelId in response.


# Method 4: Use Online Tool

Go to: https://commentpicker.com/youtube-channel-id.php

  • Enter any channel URL
  • Get the Channel ID instantly

# Part 3: Find Playlist IDs

To monitor specific playlists, you need Playlist IDs.

# From Playlist URL:

URL format:

youtube.com/playlist?list=PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf

Playlist ID is: PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf (everything after list=)

# Special Playlists:

Every channel has automatic playlists:

  • Uploads: UU + rest of Channel ID
    • Example: Channel UC4PooiX37Pld1T8J5SYT-SQ → Uploads UU4PooiX37Pld1T8J5SYT-SQ
    • (Replace first UC with UU)
  • Liked Videos (Your Own): Use authenticated API call to get your liked videos

# Part 4: Configure Weavestream

# Step 1: Add YouTube as a Source

  1. Open Weavestream
  2. Click the "+" button in the sidebar
  3. Select "Add Source"
  4. Fill in the source details:
    • Name: YouTube
    • Base URL: https://www.googleapis.com/youtube/v3
    • Auth Type: Query Parameter
    • Query Param Name: key
    • Query Param Value: Paste your API key
    • Icon: Select play.rectangle or custom youtube icon if available
    • Color: Choose your preference (suggested: #FF0000 - YouTube red, or #FF4500)
    • Refresh Interval: 120 minutes (2 hours - YouTube doesn't change constantly)
  5. Click "Add" or "Save"

# Step 2: Add Endpoints

Now we'll add endpoints to monitor different YouTube content.


# Endpoint 1: Channel Latest Videos

Get the latest uploads from any channel.

Configuration:

  • Name: [Channel Name] - Latest Videos
  • Path: /search
  • Method: GET

Query Parameters:

  • part: snippet,id
  • channelId: UC4PooiX37Pld1T8J5SYT-SQ (replace with your channel ID)
  • order: date (newest first)
  • type: video
  • maxResults: 25 (up to 50 max)

Field Mapping:

  • Array Path: items
  • ID Field: id.videoId
  • Title Field: snippet.title
  • Date Field: snippet.publishedAt
  • Summary Fields: snippet.description, snippet.channelTitle
  • Status Field: (none)

Retention Mode: Keep All (preserve video history)

Repeat this endpoint for each channel you want to monitor.


# Endpoint 2: Playlist Videos

Get all videos from a specific playlist.

Configuration:

  • Name: [Playlist Name] Videos
  • Path: /playlistItems
  • Method: GET

Query Parameters:

  • part: snippet,contentDetails
  • playlistId: PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf (your playlist ID)
  • maxResults: 50

Field Mapping:

  • Array Path: items
  • ID Field: id
  • Title Field: snippet.title
  • Date Field: snippet.publishedAt
  • Summary Fields: snippet.description, snippet.channelTitle, snippet.position (position in playlist)
  • Status Field: (none)

Retention Mode: Delete on Sync (playlist changes)


# Endpoint 3: Trending Videos

See what's trending in your region.

Configuration:

  • Name: Trending Videos
  • Path: /videos
  • Method: GET

Query Parameters:

  • part: snippet,statistics,contentDetails
  • chart: mostPopular
  • regionCode: US (or your country: GB, CA, AU, etc.)
  • maxResults: 25

Field Mapping:

  • Array Path: items
  • ID Field: id
  • Title Field: snippet.title
  • Date Field: snippet.publishedAt
  • Summary Fields: snippet.description, statistics.viewCount, statistics.likeCount
  • Status Field: (none)

Retention Mode: Delete on Sync (trending changes frequently)


# Endpoint 4: Search Videos

Search YouTube for specific topics.

Configuration:

  • Name: Search - [Topic]
  • Path: /search
  • Method: GET

Query Parameters:

  • part: snippet
  • q: machine learning (your search term)
  • type: video
  • order: relevance (or date, viewCount, rating)
  • maxResults: 25

Optional Parameters:

  • publishedAfter: 2024-01-01T00:00:00Z (ISO 8601 format - only recent videos)
  • videoDuration: medium (any, short, medium, long)
  • videoDefinition: high (any, high)

Field Mapping: Same as "Channel Latest Videos"

Use Case: Create separate endpoints for topics you're interested in:

  • "Machine Learning Tutorials"
  • "Guitar Lessons"
  • "Cooking Recipes"

# Endpoint 5: Channel Statistics

Get detailed stats about a channel (subscribers, video count, views).

Configuration:

  • Name: [Channel Name] - Stats
  • Path: /channels
  • Method: GET

Query Parameters:

  • part: snippet,statistics,contentDetails
  • id: UC4PooiX37Pld1T8J5SYT-SQ (channel ID)

Field Mapping:

  • Array Path: items
  • ID Field: id
  • Title Field: snippet.title
  • Date Field: snippet.publishedAt
  • Summary Fields:
    • statistics.subscriberCount
    • statistics.videoCount
    • statistics.viewCount
  • Status Field: (none)

Retention Mode: Keep All (track subscriber growth over time)


# Endpoint 6: Video Details

Get detailed information about specific videos.

Configuration:

  • Name: Video Details
  • Path: /videos
  • Method: GET

Query Parameters:

  • part: snippet,statistics,contentDetails,status
  • id: dQw4w9WgXcQ,jNQXAC9IVRw (comma-separated video IDs)

Field Mapping:

  • Array Path: items
  • ID Field: id
  • Title Field: snippet.title
  • Date Field: snippet.publishedAt
  • Summary Fields:
    • statistics.viewCount
    • statistics.likeCount
    • statistics.commentCount
    • contentDetails.duration (ISO 8601 format)
  • Status Field: (none)

# Endpoint 7: Video Comments

Get comments from a specific video.

Configuration:

  • Name: Comments - [Video Title]
  • Path: /commentThreads
  • Method: GET

Query Parameters:

  • part: snippet
  • videoId: dQw4w9WgXcQ (the video ID)
  • order: relevance (or time)
  • maxResults: 100

Field Mapping:

  • Array Path: items
  • ID Field: id
  • Title Field: snippet.topLevelComment.snippet.authorDisplayName
  • Date Field: snippet.topLevelComment.snippet.publishedAt
  • Summary Fields: snippet.topLevelComment.snippet.textDisplay
  • Status Field: (none)

# Endpoint 8: Your Subscriptions (Requires OAuth)

Note: This requires OAuth authentication, not just API key.

If you set up OAuth (see Advanced section):

Configuration:

  • Path: /subscriptions
  • Query Parameters:
    • part: snippet
    • mine: true
    • maxResults: 50

Gets channels you're subscribed to.


# Part 5: Understanding YouTube API Data

# Video Search Result Structure

{
  "items": [
    {
      "kind": "youtube#searchResult",
      "id": {
        "kind": "youtube#video",
        "videoId": "dQw4w9WgXcQ"
      },
      "snippet": {
        "publishedAt": "2009-10-25T06:57:33Z",
        "channelId": "UCuAXFkgsw1L7xaCfnd5JJOw",
        "title": "Rick Astley - Never Gonna Give You Up",
        "description": "The official video for...",
        "thumbnails": {
          "default": { "url": "https://i.ytimg.com/..." },
          "high": { "url": "https://i.ytimg.com/..." }
        },
        "channelTitle": "Rick Astley"
      }
    }
  ],
  "nextPageToken": "CAUQAA",
  "pageInfo": {
    "totalResults": 1000000,
    "resultsPerPage": 5
  }
}

# Video Details Structure

{
  "items": [
    {
      "id": "dQw4w9WgXcQ",
      "snippet": {
        "publishedAt": "2009-10-25T06:57:33Z",
        "channelId": "UCuAXFkgsw1L7xaCfnd5JJOw",
        "title": "Rick Astley - Never Gonna Give You Up",
        "description": "...",
        "thumbnails": {...},
        "channelTitle": "Rick Astley",
        "tags": ["rick astley", "never gonna give you up"],
        "categoryId": "10"
      },
      "statistics": {
        "viewCount": "1400000000",
        "likeCount": "15000000",
        "commentCount": "2500000"
      },
      "contentDetails": {
        "duration": "PT3M33S",
        "definition": "hd",
        "caption": "false"
      }
    }
  ]
}

Key Fields:

  • id.videoId or id - Unique video identifier
  • snippet.title - Video title
  • snippet.publishedAt - Upload timestamp
  • snippet.description - Video description
  • statistics.viewCount - Number of views
  • contentDetails.duration - Video length (ISO 8601 format: PT3M33S = 3 min 33 sec)

# Part 6: Create Useful Filters

# Filter 1: Videos This Week

  1. Under YouTube source, click "+""New Filter"
  2. Name: Uploaded This Week
  3. Select Endpoints: All channel endpoints
  4. Add Condition:
    • Field: snippet.publishedAt
    • Operator: in last
    • Value: 7 days
  5. Save

# Filter 2: High View Count (Viral Videos)

  1. Create new filter
  2. Name: Viral Videos (1M+ views)
  3. Select Endpoint: Trending or Video Details endpoints
  4. Add Condition:
    • Field: statistics.viewCount
    • Type: Number
    • Operator: greater than
    • Value: 1000000
  5. Save

# Filter 3: Short Videos (<5 minutes)

  1. Create new filter
  2. Name: Short Videos
  3. Select Endpoints: Video Details endpoint
  4. Add Condition:
    • Field: contentDetails.duration
    • Operator: contains
    • Value: PT (all durations start with this)

Note: Duration filtering is complex with ISO 8601 format. Better to ask AI: "Show me videos under 5 minutes"


# Filter 4: Specific Channel

  1. Create new filter
  2. Name: [Channel Name] Videos
  3. Select Endpoints: All video search endpoints
  4. Add Condition:
    • Field: snippet.channelTitle
    • Operator: equals
    • Value: MKBHD (channel name)
  5. Save

# Filter 5: High Engagement (Likes/Views Ratio)

Complex - use AI for this: Ask: "Show me videos where likes are more than 5% of views"


# Part 7: Use AI to Discover Content

Now you can ask intelligent questions about YouTube!

# Example Questions:

Discovery:

  • "What videos did MKBHD upload this week?"
  • "Show me trending tech videos"
  • "Find cooking tutorials under 10 minutes"
  • "What's the most viewed video from [channel]?"

Channel Analysis:

  • "How many subscribers does [channel] have?"
  • "Compare view counts between [channel A] and [channel B]"
  • "What's the average video length for [channel]?"
  • "Which channel uploads most frequently?"

Content Planning (for creators):

  • "What topics are trending in my niche?"
  • "Show me videos with high engagement ratios"
  • "Find successful video titles in [category]"
  • "What's the best upload time based on trending videos?"

Watch Planning:

  • "Find highly rated videos I haven't seen"
  • "Show me educational content from today"
  • "What short videos can I watch during lunch?"
  • "Recommend videos based on [topic]"

Research:

  • "Find all videos mentioning 'ChatGPT'"
  • "Show me videos with over 1M views about Python"
  • "What are the most commented videos this month?"
  • "Find videos with specific tags"

# Part 8: Advanced Configuration

# Query Parameter Options

YouTube API supports many parameters:

Search Filters:

q: search term            - What to search for
channelId: UC...         - Limit to specific channel
channelType: any         - any, show (official channels)
eventType: live          - Only live streams
order: date              - date, rating, relevance, title, viewCount
publishedAfter: ISO 8601 - Only videos after date
publishedBefore: ISO 8601 - Only videos before date
regionCode: US           - Country code
relevanceLanguage: en    - Language preference
safeSearch: moderate     - none, moderate, strict
type: video              - video, channel, playlist
videoCategoryId: 10      - Category (10=Music, 20=Gaming, etc.)
videoDefinition: high    - any, high, standard
videoDuration: medium    - any, short (<4min), medium (4-20min), long (>20min)
videoEmbeddable: true    - Only embeddable videos
videoLicense: creativeCommon - any, creativeCommon, youtube

Pagination:

maxResults: 50           - Results per page (max 50)
pageToken: CAUQAA       - For next/prev page

# Video Duration Format

YouTube uses ISO 8601 duration format:

Format: PT[hours]H[minutes]M[seconds]S

Examples:

  • PT3M33S = 3 minutes 33 seconds
  • PT1H30M = 1 hour 30 minutes
  • PT45S = 45 seconds
  • PT2H5M10S = 2 hours 5 minutes 10 seconds

Parsing: You'll need to parse this format for filtering. Let AI handle duration queries.


# Video Categories

Common category IDs:

  • 1 - Film & Animation
  • 2 - Autos & Vehicles
  • 10 - Music
  • 15 - Pets & Animals
  • 17 - Sports
  • 19 - Travel & Events
  • 20 - Gaming
  • 22 - People & Blogs
  • 23 - Comedy
  • 24 - Entertainment
  • 25 - News & Politics
  • 26 - Howto & Style
  • 27 - Education
  • 28 - Science & Technology

Get full list:

GET /videoCategories?part=snippet&regionCode=US

# Pagination Handling

YouTube uses token-based pagination:

Response includes:

{
  "nextPageToken": "CAUQAA",
  "prevPageToken": "CAIQAA",
  "pageInfo": {
    "totalResults": 1000000,
    "resultsPerPage": 25
  }
}

To get next page: Add pageToken=CAUQAA to your next request.

Weavestream should handle this automatically.


# Part 9: OAuth Setup (Optional - For Personal Data)

If you want to access your own subscriptions, liked videos, or upload to your channel, you need OAuth instead of just an API key.

# When to Use OAuth:

API Key (Simple): Public data only

  • Any channel's videos
  • Public playlists
  • Trending videos
  • Search results

OAuth (Advanced): Personal data

  • Your subscriptions
  • Your liked videos
  • Your watch history
  • Your channel analytics
  • Commenting/liking (write access)

# OAuth Setup Steps:

  1. Google Cloud Console → Your project → "Credentials"
  2. Create Credentials"OAuth 2.0 Client ID"
  3. Application type: "Desktop app"
  4. Download the credentials JSON
  5. In Weavestream:
    • Auth Type: OAuth
    • OAuth Flow: Authorization Code
    • Authorization URL: https://accounts.google.com/o/oauth2/v2/auth
    • Token URL: https://oauth2.googleapis.com/token
    • Scopes: https://www.googleapis.com/auth/youtube.readonly
    • Add Client ID and Client Secret from downloaded JSON

# Troubleshooting

# Issue: "API key not valid"

Solution:

  1. Verify API key is correct (no extra spaces)
  2. Check API key restrictions don't block your request
  3. Ensure YouTube Data API v3 is enabled in your project
  4. Try creating a new unrestricted API key for testing

# Issue: "Quota exceeded"

Solution: YouTube API has daily quota limits:

  • Free tier: 10,000 units/day
  • Most read operations cost 1-5 units
  • Search costs 100 units per request!

Best practices:


# Issue: "The request cannot be completed because you have exceeded your quota"

Solution:

  1. Wait until midnight Pacific Time (quota resets daily)
  2. Check quota usage: Google Cloud Console → APIs & Services → YouTube Data API v3 → Quotas
  3. Optimize endpoints to use fewer units
  4. Request quota increase (can take days to approve)

# Issue: "No results returned" or empty items array

Solution:

  1. Verify channel ID is correct (starts with UC)
  2. Check part parameter includes snippet and id
  3. Ensure type=video for video searches
  4. Try increasing maxResults
  5. Check array path is set to items

# Issue: "Channel ID not found"

Solution:

  1. Verify you're using Channel ID (UC...), not username
  2. Use one of the methods in Part 2 to find correct Channel ID
  3. Try accessing channel via browser first to confirm it exists
  4. Some private channels may not be accessible via API

# API Rate Limits & Costs

# Quota Costs (per request):

Operation Cost (units)
Search 100
List videos 1
List playlists 1
List playlist items 1
Get video details 1
Get channel details 1
List comments 1
Trending videos 1

Daily limit: 10,000 units (free tier)

Example daily usage:

  • 100 searches = 10,000 units (limit reached!)
  • 100 video listings = 100 units
  • 50 searches + 50 video lists = 5,050 units

Recommendation:

  • Minimize use of /search endpoint (costs 100 units!)
  • Use direct endpoints when possible (/videos, /channels, /playlistItems)
  • Increase refresh intervals
  • Request quota increase if needed

# Security Best Practices

# Do:

  • Restrict API key to YouTube Data API v3 only
  • Add IP address restrictions if accessing from fixed location
  • Create separate API keys for different uses
  • Monitor quota usage regularly
  • Rotate API keys every 90 days
  • Store credentials securely (Weavestream uses macOS Keychain)

# Don't:

  • Share API keys publicly (GitHub, forums, etc.)
  • Embed keys in public websites
  • Use same key for multiple unrelated projects
  • Leave keys unrestricted
  • Commit keys to version control

# Additional Resources

# YouTube API Documentation:

# Useful Endpoints:

Endpoint Purpose
/search Search videos/channels/playlists
/videos Get video details
/channels Get channel information
/playlistItems List videos in playlist
/commentThreads Get video comments
/subscriptions List subscriptions (OAuth)
/activities Channel activity feed (OAuth)

# Summary Checklist

Before you finish, verify:

  • Google Cloud project created
  • YouTube Data API v3 enabled
  • API key created and copied
  • API key restrictions configured
  • Channel IDs found for channels you want to monitor
  • YouTube source added to Weavestream
  • At least one endpoint configured (Channel Latest Videos)
  • Array path set to items
  • Field mappings working (video titles and dates visible)
  • Refresh interval set to 2+ hours (to preserve quota)
  • Smart filters created for content discovery
  • Tested AI questions about your YouTube content

You're all set! Discover and monitor YouTube content with AI-powered insights! 📺


Last updated: February 2026 YouTube Data API version: v3