Global AI Network
Agent Template v1.0.0

YouTube Stats Notion Tracker

3+
Deployments
5m
Setup Time
Free
Pricing

Need custom configuration?

Our solution engineers can help you adapt this agent to your specific infrastructure and requirements.

Enterprise Grade Best Practices Production Optimized

INTEGRATED_MODULES

Notion
Notion
YouTube
YouTube
Step by Step

Setup Tutorial

mission-briefing.md

What This Agent Does

This YouTube-to-Notion automation agent seamlessly bridges your YouTube content library with your Notion workspace by automatically enriching video metadata. The agent runs on a schedule you define, queries your Notion database for new videos, fetches comprehensive details from YouTube (including video statistics, channel information, and engagement metrics), and updates your Notion pages with this enriched data—all without manual intervention.

Key benefits and time savings:

  • Eliminate manual data entry: Automatically populate video titles, descriptions, view counts, subscriber counts, and channel details
  • Save 5-10 minutes per video: No more copying and pasting YouTube information into Notion
  • Stay current: Keep your content database fresh with real-time YouTube statistics
  • Scale effortlessly: Process dozens of videos in minutes instead of hours
  • Centralize your workflow: Manage all video metadata in one Notion workspace

Target use cases:

  • Content creators tracking video performance across projects
  • Marketing teams monitoring competitor or partner channel activity
  • Educational institutions cataloging video resources with engagement metrics
  • Agencies managing multiple client YouTube channels
  • Researchers collecting and organizing video data for analysis

Who Is It For

This agent is perfect for content creators, marketing professionals, and team leads who maintain video libraries in Notion and want to automate the tedious process of gathering YouTube metadata. Whether you're managing a single channel or monitoring multiple creators, this workflow eliminates repetitive data collection tasks and ensures your Notion database stays synchronized with your YouTube presence.

You'll benefit most if you:

  • Regularly add YouTube videos to a Notion database
  • Want detailed video statistics without manual lookup
  • Manage content across multiple channels or creators
  • Need to track video performance metrics over time
  • Prefer automation over manual administrative tasks

Required Integrations

Notion

Why it's needed: Notion serves as your central database where videos are stored and enriched. The agent queries this database to find new videos and updates them with YouTube metadata, creating a unified content management system.

Setup steps:

  1. Create a Notion integration:

    • Visit notion.com/my-integrations
    • Click "New integration"
    • Name it TaskAGI YouTube Enrichment (or your preferred name)
    • Select your workspace
    • Click "Submit"
  2. Copy your API key:

    • On the integration page, locate the "Internal Integration Token"
    • Click "Show" and copy the full token
    • Store this securely—you'll need it for TaskAGI configuration
  3. Share your database with the integration:

    • Open your Notion database containing videos
    • Click the "Share" button (top right)
    • Select your integration from the list
    • Grant "Edit" permissions
  4. Identify your database ID:

    • Open your video database in Notion
    • Copy the URL: https://notion.so/workspace/[DATABASE_ID]?v=...
    • Extract the 32-character alphanumeric string after the last / and before ?
    • Example: a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
  5. Configure in TaskAGI:

    • Navigate to IntegrationsNotion
    • Paste your Internal Integration Token
    • Test the connection with "Verify Connection"
    • You'll reference your Database ID in the workflow configuration

Configuration in TaskAGI: Your Notion database should include at minimum:

  • A text field for YouTube Video ID (e.g., dQw4w9WgXcQ)
  • A URL field for the video link
  • Text/number fields for storing: title, description, view count, like count, subscriber count, channel name

YouTube

Why it's needed: YouTube's API provides the rich metadata your Notion database needs—view counts, engagement metrics, channel information, and video descriptions. This creates a comprehensive content record without manual research.

Setup steps:

  1. Create a Google Cloud project:

    • Go to console.cloud.google.com
    • Click the project dropdown (top left)
    • Select "New Project"
    • Name it TaskAGI YouTube Integration
    • Click "Create"
  2. Enable the YouTube Data API:

    • In your new project, go to APIs & ServicesLibrary
    • Search for "YouTube Data API v3"
    • Click the result and select "Enable"
    • Wait for activation (usually instant)
  3. Create API credentials:

    • Go to APIs & ServicesCredentials
    • Click "Create Credentials""API Key"
    • Copy your API Key immediately
    • Click the pencil icon to restrict your key:
      • Under API restrictions, select "YouTube Data API v3"
      • Save changes
  4. Configure in TaskAGI:

    • Navigate to IntegrationsYouTube
    • Paste your API Key
    • Test with "Verify Connection"
    • The system will confirm your quota availability

How to obtain API keys/credentials:

Configuration Steps

Node 1-3: Information & Setup

These documentation nodes provide reference information:

  • Agent Name Options: Choose a descriptive name like YouTube Video Enrichment Agent
  • Category & Industry: Select Content Management and your industry
  • Setup Instructions: Review the workflow overview (already completed by this guide)

Node 4: Schedule Trigger

Purpose: Determines when the agent runs automatically

Configuration:

  • Interval Type: Select Daily, Weekly, or Every X hours
  • Time: Set when you want the agent to run (e.g., 09:00 AM)
  • Timezone: Choose your local timezone
  • Example: Run daily at 8:00 AM to catch overnight uploads

Recommendation: Start with daily execution to keep your database fresh without excessive API usage.

Node 5: Query Notion for New Videos

Purpose: Fetches videos from your Notion database that need enrichment

Configuration:

  • Database ID: Paste your 32-character Notion database ID
  • Filter: Create a filter to find videos needing updates
    • Example: YouTube Video ID is not empty AND View Count is empty
    • This ensures you only process videos with IDs but missing metadata
  • Page Size: Set to 100 (processes up to 100 videos per run)

Expected output: A list of video records with their YouTube IDs

Node 6: Loop Through Videos

Purpose: Processes each video individually

Configuration:

  • Loop Source: Automatically set to results from Node 5
  • Loop Item Variable: video (reference as {{video}} in subsequent nodes)
  • No additional configuration needed—this node automatically iterates

Node 7: Extract Video ID

Purpose: Isolates the YouTube video ID from your Notion record

Configuration:

  • Input: {{video.properties['YouTube Video ID'].rich_text[0].plain_text}}
  • Function: Extract alphanumeric ID (typically 11 characters)
  • Output Variable: videoId

Example: From dQw4w9WgXcQ, extracts the clean ID for API calls

Node 8: Get YouTube Video Details

Purpose: Retrieves video statistics and metadata

Configuration:

  • Video ID: {{videoId}}
  • Fields to retrieve:
    • snippet.title → Video title
    • statistics.viewCount → Total views
    • statistics.likeCount → Likes
    • snippet.description → Full description
    • contentDetails.duration → Video length

Output variables (automatically created):

  • {{youtubeVideoDetails.title}}
  • {{youtubeVideoDetails.viewCount}}
  • {{youtubeVideoDetails.likeCount}}

Node 9: Get YouTube Channel Info

Purpose: Fetches channel-level data

Configuration:

  • Channel ID: {{youtubeVideoDetails.channelId}}
  • Fields to retrieve:
    • statistics.subscriberCount → Channel subscribers
    • snippet.title → Channel name
    • snippet.description → Channel description

Output variables:

  • {{youtubeChannelInfo.subscriberCount}}
  • {{youtubeChannelInfo.title}}

Node 10: Build Notion Properties

Purpose: Formats YouTube data into Notion field structure

Configuration: Create a function that maps YouTube data to Notion fields:

{
  "Title": youtubeVideoDetails.title,
  "View Count": youtubeVideoDetails.viewCount,
  "Like Count": youtubeVideoDetails.likeCount,
  "Channel Name": youtubeChannelInfo.title,
  "Subscriber Count": youtubeChannelInfo.subscriberCount,
  "Description": youtubeVideoDetails.description
}

Tip: Match field names exactly to your Notion database structure

Node 11: Update Notion Page

Purpose: Writes enriched data back to your Notion database

Configuration:

  • Database ID: Same as Node 5
  • Page ID: {{video.id}}
  • Properties: Use output from Node 10
  • Update Mode: Merge (preserves existing data)

Result: Your Notion page now contains complete YouTube metadata

Testing Your Agent

Step 1: Prepare Test Data

  1. Create a test video entry in your Notion database
  2. Include a valid YouTube Video ID (e.g., from a popular video)
  3. Leave metadata fields empty (Title, Views, etc.)
  4. Save the entry

Step 2: Run Test Execution

  1. In TaskAGI, click "Test Run" on your workflow
  2. Monitor the execution log for each node
  3. Watch for green checkmarks (success) or red X's (errors)

Step 3: Verify Each Step

  • Node 5: Confirm your test video appears in query results
  • Node 7: Verify the video ID extracted correctly
  • Node 8: Check that YouTube details loaded (title, views, etc.)
  • Node 9: Confirm channel info retrieved (subscribers, name)
  • Node 11: Return to Notion and refresh—your fields should be populated

Step 4: Expected Results

Success indicators:

  • All nodes show green status
  • Notion fields display YouTube data (title, view count, channel name)
  • No API errors in the execution log
  • Execution completed in under 30 seconds

Common issues and solutions:

  • "Database not found": Verify your Database ID and integration permissions
  • "Invalid video ID": Ensure your Notion field contains valid 11-character YouTube IDs
  • "API quota exceeded": YouTube free tier allows 10,000 units daily; reduce frequency or batch size
  • "Field not found": Check that Notion field names match your configuration exactly

Step 5: Enable Scheduled Execution

Once testing succeeds:

  1. Click "Enable Schedule" on your workflow
  2. Confirm the trigger time and frequency
  3. Your agent now runs automatically—check Notion periodically to see fresh data!

Congratulations! Your YouTube-to-Notion automation is now live and saving you hours of manual work. 🎉

Similar Solutions

Related Agents

Explore these powerful automation agents that complement your workflow.

YouTube video to WordPress blog post

YouTube video to WordPress blog post

This AI agent turns YouTube videos to WordPress blog posts automatically.

YouTube to Shorts AI Agent

YouTube to Shorts AI Agent

Generate short form content from longer YouTube videos automatically. This agent intelligently cuts & crops relevant par...

YouTube Comments Scraper AI Agent

YouTube Comments Scraper AI Agent

Extract comments from YouTube videos including user feedback, engagement metrics, and sentiment analysis data. Simple fo...