Tutorial

How to Build an n8n YouTube Research Workflow

Build an n8n workflow that searches YouTube, fetches video metadata, and compiles research reports. Automated YouTube content research pipeline.

YouTube is a primary research source for product reviews, tutorials, and industry analysis. Manually searching and reviewing videos is time-consuming. This tutorial builds an n8n workflow that searches YouTube for videos on a topic, fetches metadata for each result, and compiles a structured research report. The workflow uses the Scavio API for YouTube search and can be scheduled to run daily for ongoing topic monitoring.

Prerequisites

  • n8n self-hosted or cloud instance
  • A Scavio API key from scavio.dev
  • Basic familiarity with n8n nodes
  • A research topic to track

Walkthrough

Step 1: Build the YouTube search node

Create an HTTP Request node in n8n that searches YouTube via the Scavio API. This returns video titles, channels, view counts, and URLs.

JavaScript
// n8n Function node: YouTube search via Scavio API
const SCAVIO_KEY = $env.SCAVIO_API_KEY;

const topic = $input.first().json.topic || 'AI tools for developers';

const response = await fetch('https://api.scavio.dev/api/v1/search', {
  method: 'POST',
  headers: {
    'x-api-key': SCAVIO_KEY,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    query: `${topic} site:youtube.com`,
    country_code: 'us',
    num_results: 10
  })
});

const data = await response.json();
const videos = (data.organic_results || [])
  .filter(r => r.link.includes('youtube.com/watch'))
  .map(r => ({
    title: r.title,
    url: r.link,
    snippet: r.snippet || '',
    video_id: r.link.match(/v=([^&]+)/)?.[1] || '',
  }));

return videos.map(v => ({ json: v }));

Step 2: Compile the research report

Aggregate video data into a structured research report with key findings, top channels, and content themes.

JavaScript
// n8n Function node: Compile YouTube research report
const videos = $input.all().map(i => i.json);

const report = {
  topic: 'AI tools for developers',
  date: new Date().toISOString().slice(0, 10),
  video_count: videos.length,
  videos: videos.map((v, i) => ({
    rank: i + 1,
    title: v.title,
    url: v.url,
    key_point: v.snippet.slice(0, 120),
  })),
  summary: `Found ${videos.length} relevant YouTube videos. Top themes: ${videos.slice(0, 3).map(v => v.title.split(' ').slice(0, 4).join(' ')).join(', ')}.`,
};

console.log(`Report: ${report.video_count} videos on "${report.topic}"`);
return [{ json: report }];

Step 3: Schedule and deliver the report

Add a cron trigger for daily execution and an email or Slack node to deliver the report to your team.

JavaScript
// n8n workflow structure:
// 1. Cron Trigger (daily at 9 AM)
// 2. Set Node (define research topics)
// 3. HTTP Request Node (Scavio YouTube search)
// 4. Function Node (compile report)
// 5. Email/Slack Node (deliver report)

// Set Node configuration:
const topics = [
  'AI developer tools review 2026',
  'API development tutorial',
  'developer productivity tips',
];

// Cost estimate: 3 topics x $0.005 = $0.015/day
console.log(`Daily YouTube research: ${topics.length} topics`);
console.log(`Estimated daily cost: $${(topics.length * 0.005).toFixed(3)}`);

Python Example

Python
import os, requests, time, re

SCAVIO_KEY = os.environ['SCAVIO_API_KEY']
H = {'x-api-key': SCAVIO_KEY, 'Content-Type': 'application/json'}

def youtube_research(topic, num=10):
    resp = requests.post('https://api.scavio.dev/api/v1/search', headers=H,
        json={'query': f'{topic} site:youtube.com', 'country_code': 'us', 'num_results': num})
    results = resp.json().get('organic_results', [])
    videos = []
    for r in results:
        if 'youtube.com/watch' in r.get('link', ''):
            vid_match = re.search(r'v=([^&]+)', r['link'])
            videos.append({'title': r['title'], 'url': r['link'],
                'video_id': vid_match.group(1) if vid_match else '', 'snippet': r.get('snippet', '')})
    print(f'YouTube research: "{topic}" -> {len(videos)} videos')
    for v in videos[:5]:
        print(f'  {v["title"][:55]}')
    return videos

youtube_research('AI tools for developers 2026')

JavaScript Example

JavaScript
const SCAVIO_KEY = process.env.SCAVIO_API_KEY;

async function youtubeResearch(topic) {
  const resp = await fetch('https://api.scavio.dev/api/v1/search', {
    method: 'POST',
    headers: { 'x-api-key': SCAVIO_KEY, 'Content-Type': 'application/json' },
    body: JSON.stringify({ query: `${topic} site:youtube.com`, country_code: 'us', num_results: 10 })
  });
  const data = await resp.json();
  const videos = (data.organic_results || [])
    .filter(r => r.link.includes('youtube.com/watch'))
    .map(r => ({ title: r.title, url: r.link, snippet: r.snippet || '' }));
  console.log(`"${topic}": ${videos.length} videos`);
  videos.slice(0, 5).forEach(v => console.log(`  ${v.title.slice(0, 55)}`));
}

youtubeResearch('AI developer tools 2026');

Expected Output

JSON
YouTube research: "AI tools for developers 2026" -> 8 videos
  Top 10 AI Coding Tools Every Developer Needs in 202
  Cursor vs GitHub Copilot vs Claude Code: Full Compa
  How I Use AI to Build Apps 10x Faster
  The Best Free AI Tools for Developers
  AI Code Review Tools That Actually Work

Report: 8 videos on "AI tools for developers"
Daily YouTube research: 3 topics
Estimated daily cost: $0.015

Related Tutorials

Frequently Asked Questions

Most developers complete this tutorial in 15 to 30 minutes. You will need a Scavio API key (free tier works) and a working Python or JavaScript environment.

n8n self-hosted or cloud instance. A Scavio API key from scavio.dev. Basic familiarity with n8n nodes. A research topic to track. A Scavio API key gives you 250 free credits per month.

Yes. The free tier includes 250 credits per month, which is more than enough to complete this tutorial and prototype a working solution.

Scavio has a native LangChain package (langchain-scavio), an MCP server, and a plain REST API that works with any HTTP client. This tutorial uses the raw REST API, but you can adapt to your framework of choice.

Start Building

Build an n8n workflow that searches YouTube, fetches video metadata, and compiles research reports. Automated YouTube content research pipeline.