Most content research starts with the open web. You search newsletters, articles, blog posts, and social posts, then use what you find to shape the next thing you write.
That can look thorough while leaving out an entire source of ideas: YouTube.
A web search may surface a YouTube link. For a research tool to analyze YouTube itself, it needs direct access to video and channel data, including views, likes, and comments. If you also want to know what was said inside a video, your tools need a transcript source too.
Without those connections, you can finish a research and still miss the video that should change your angle. That missing idea could become your next newsletter, blog post, X post, or the next video you decide to record.
That was the problem behind Episode 25 of One Shot Show.
Dheeraj Sharma built a YouTube research agent in Claude Code that could search YouTube data, inspect videos and channels, compare recent and older results, and rank possible topics based on his content niche. Then he added the part that made those rankings useful: files describing his channel, the subjects he avoids, the competitors he watches, and the criteria he uses to judge an idea.
The session was in-depth.
It walked through five layers behind the YouTube research agent. We started by explaining how you can integrate your agent with the YouTube Data API, then went through each layer, with each one answering a different question:
What can the agent see?
What should it remember?
What does it need to know about this YouTube channel?
How should it judge an idea?
How should it run and return a recommendation?
In this post, we’re giving you an agent folder that you can use and customize to match your content style. If you follow all the instructions below, you’ll be able to run research across YouTube and get detailed information on any video, including key metrics, channel details, and the full transcript.
Here is how the full system came together.
Let’s dive in.
Layer 1: Give the Agent YouTube Data
Dheeraj began with the integration layer. This is where outside information from YouTube can enter the agent.
In earlier One Shot Show builds, that usually meant connecting an MCP server, a Claude connector, or a command-line tool such as Tavily CLI. This time he built a small local script that called the YouTube Data API directly.
To connect YouTube Data API, you need to start with accessing Google Cloud Console:
Create or select a Google Cloud project.
Enable YouTube Data API v3.
Create an API key.
Restrict that key to the APIs the project needs.
Store the key outside the source code.
Once you get the API key, you need to store it in .env.local in your local folder.
Then, you need to teach Claude how to interact with the YouTube API through a script. So he asked Claude to create a script with the functions the agent would need to interact with the YouTube API, including:
Search for videos by topic.
Retrieve video statistics.
Look up channels by name.
Compare a group of competitor channels.
Separate Shorts from long-form videos.
Retrieve thumbnail URLs for pattern analysis.
What this means is that your agent will be able to interact with any of YouTube’s features, so you can use it to run research.
Here’s the prompt you can copy and use so your agent can generate the same script for you:
















