Akshay Parkhi's Weblog

Build a Research Engine in Claude Code: YouTube Search → NotebookLM → Synthesized Insights in 5 Minutes

9th March 2026

I built a research engine inside Claude Code. It searches YouTube, feeds results into Google NotebookLM, and lets me query across all the sources. All of this happens without leaving the terminal. Here’s exactly how it works and how to build it yourself.

The Problem

Researching a topic usually means these steps:

  1. Open YouTube.
  2. Search.
  3. Watch 10 videos.
  4. Take notes.
  5. Try to synthesize.

That’s hours of work. I wanted a system where I could type one command and get a structured research briefing from dozens of sources.

The Architecture

┌─────────────────────────────────────────────────────────┐
│                   Claude Code Terminal                    │
│                                                          │
│  Step 1: /yt-search "claude code skills"                 │
│          ↓                                               │
│  ┌────────────────────────────────┐                      │
│  │  yt-dlp (YouTube Search)       │                      │
│  │  → 20 structured results       │                      │
│  │  → titles, views, URLs, dates  │                      │
│  └────────────┬───────────────────┘                      │
│               ↓                                          │
│  Step 2: /notebooklm create + add sources                │
│          ↓                                               │
│  ┌────────────────────────────────┐                      │
│  │  Google NotebookLM             │                      │
│  │  → ingests all 20 videos       │                      │
│  │  → transcribes + indexes       │                      │
│  │  → builds knowledge graph      │                      │
│  └────────────┬───────────────────┘                      │
│               ↓                                          │
│  Step 3: Ask questions against all sources               │
│          ↓                                               │
│  ┌────────────────────────────────┐                      │
│  │  NotebookLM AI                 │                      │
│  │  → cross-references 20 videos  │                      │
│  │  → synthesized answer          │                      │
│  │  → with source citations       │                      │
│  └────────────────────────────────┘                      │
│                                                          │
│  Optional: Generate podcast, report, quiz, blog          │
└─────────────────────────────────────────────────────────┘

Three skills, one terminal, zero browser tabs.

The Three Skills

1. YouTube Search (/yt-search)

A Claude Code slash command that searches YouTube using yt-dlp and returns structured results. You need no API key. It uses YouTube’s search directly.

/yt-search claude code skills
/yt-search AI agents --count 10
/yt-search robotics --months 3
/yt-search machine learning --no-date-filter

Each result includes title, channel, subscriber count, view count, duration, upload date, and direct URL. By default, the command filters results to the last 6 months, so you get current content.

2. NotebookLM Integration (/notebooklm)

The notebooklm-py package gives Claude Code full programmatic access to Google NotebookLM. Create notebooks, add sources (YouTube URLs, PDFs, websites), and query across all of them. You do all of this from the terminal.

# Create a notebook
notebooklm create "Research Topic"

# Add YouTube videos as sources
notebooklm source add "https://youtube.com/watch?v=..." --notebook <id>

# Ask questions across all sources
notebooklm ask "What are the key patterns?" --notebook <id>

NotebookLM handles the heavy lifting. It transcribes videos, indexes the content, and builds a knowledge graph across all sources. When you ask a question, it cross-references every source and synthesizes an answer.

3. Playwright CLI (playwright-cli)

Browser automation from the terminal. Open pages, click elements, fill forms, take screenshots. This completes the research loop. If NotebookLM surfaces something interesting, you can immediately browse to it and verify it.

Setting It Up

Step 1: Install Dependencies

# YouTube search engine
pip install yt-dlp

# NotebookLM programmatic access
pip install "notebooklm-py[browser]"
playwright install chromium

# Authenticate with Google (one-time)
notebooklm login

# Install the Claude Code skill
notebooklm skill install

Step 2: Create the YouTube Search Skill

Create ~/.claude/commands/yt-search.md:

---
description: "Search YouTube and return structured video results"
argument-hint: "<query> [--count N]"
allowed-tools:
  - Bash
---

Run the YouTube search script with the user's arguments.

Execute this command:

```
python ~/.claude/skills/yt-search/scripts/search.py $ARGUMENTS
```

Then create the search script at ~/.claude/skills/yt-search/scripts/search.py. The script does the following:

  1. It uses yt-dlp to search YouTube.
  2. It parses the JSON output.
  3. It filters by date.
  4. It formats results with view counts, subscriber counts, and a views-to-subscribers ratio for spotting viral content.

Key features of the search script:

  • Date filtering — defaults to last 6 months, configurable with --months N
  • Over-fetching — requests 2x results to compensate for the old videos that the date filter removes
  • Views/subs ratio — helps identify videos that over-performed relative to channel size
  • No API key — uses yt-dlp’s built-in search, so you need no YouTube Data API quota

Step 3: Verify Everything Works

# Test YouTube search
/yt-search test query --count 3

# Test NotebookLM
notebooklm list

Real Example: Researching Claude Code Skills

Here’s exactly what I ran and what happened:

# Step 1: Search YouTube
/yt-search claude code skills

I got 20 results. Top hits:

#TitleChannelViews
1What are skills?Claude (official)428K
2CLAUDE CODE FULL COURSENick Saraev560K
3Claude Code Skills Just Got Even BetterNate Herk158K
4Claude Agent Skills ExplainedAnthropic145K
5Every Level of Claude Code ExplainedSimon Scrapes139K
# Step 2: Create NotebookLM notebook and add all 20 videos
# Claude Code did this automatically — created the notebook,
# then batch-added all 20 YouTube URLs as sources
# Step 3: Query the research
"What are the top Claude Code skills mentioned across these sources?"

NotebookLM cross-referenced all 20 videos and synthesized this answer:

Top Skills by Category

CategorySkillWhat It Does
MetaSkill CreatorTeaches Claude to build and refine other skills
DesignFront-end DesignEnforces typography, color, layout conventions
QualityCode ReviewerSubagent for security audits and architecture checks
BusinessStripe IntegrationRepeatable payment flows and webhook setup
ResearchLead ResearchIdentifies customers with LinkedIn profiles
DevSupabase SupportDatabase migrations and backend setup
ContentHumanizerRemoves AI-sounding writing patterns
ProductivityEmail ManagerClassifies 1,000+ emails in 60 seconds

The key insight from the research is to focus on two categories of skills. The first is capability uplift (things Claude struggles with, like visual design). The second is encoded preference (your specific repeatable workflows).

What You Can Generate From a Notebook

Once you load your sources, NotebookLM can generate:

  • Podcasts — two AI hosts discussing your sources in a natural conversation
  • Study Guides — structured summaries with key concepts
  • Briefing Docs — executive-style overviews
  • Quizzes — test comprehension of the material
  • Q&A sessions — ask any question, get answers grounded in your sources

All of this happens from the terminal. You need no browser.

Why This Works Better Than Manual Research

Manual ProcessThis System
Search YouTube in browserOne command: /yt-search
Watch 20 videos (10+ hours)NotebookLM transcribes all 20 in minutes
Take notes while watchingAsk specific questions, get cited answers
Synthesize across sources manuallyCross-referenced automatically
Write up findingsGenerate report, podcast, or blog

The total time from search to synthesized research brief is under 5 minutes. The equivalent manual process would take most of a day.

The Broader Pattern

This isn’t just about YouTube and NotebookLM. The pattern is:

Claude Code Skill (data acquisition)
  → External AI Service (processing + indexing)
    → Claude Code Skill (querying + synthesis)
      → Output (blog, report, podcast, code)

You can substitute different data sources (GitHub repos, arxiv papers, documentation sites) and different processing engines (NotebookLM, RAG pipelines, custom embeddings). The key is that Claude Code acts as the orchestration layer. It connects the pieces and lets you drive everything from natural language in your terminal.

Skills turn Claude Code from a coding assistant into a general-purpose automation platform. The YouTube-to-NotebookLM pipeline is just one example. It shows what becomes possible when you give your AI assistant the ability to connect to and interact with external services.

More recent articles

This is Build a Research Engine in Claude Code: YouTube Search → NotebookLM → Synthesized Insights in 5 Minutes by Akshay Parkhi, posted on 9th March 2026.

Next: Top Claude Code Skills: What 20 YouTube Videos and 2.3M Views Agree On

Previous: playwright-cli: How to Give Your AI Coding Assistant a Real Browser