YouTube Channel Analyzer via API (Not Scraping)
Analyze YouTube channels programmatically via search API. Track performance, find content gaps, compare competitors.
Scraping YouTube breaks every 3-6 months. Google changes class names, adds bot detection, rotates DOM structures. Every time it breaks, you lose a weekend fixing selectors. The alternative is using APIs that handle the abstraction for you. YouTube Data API gives channel-level metrics. A search API gives you discovery: what videos rank, what competitors appear, and what content gaps exist. Different tools for different questions.
What a search API reveals about a channel
Searching for a channel name or its core topics shows you how discoverable their content is. You see which videos appear in search results, what position they hold, and what competitors appear alongside them.
import requests, os
def analyze_channel_visibility(channel_name: str, topics: list) -> dict:
"""Analyze how a YouTube channel appears in search results."""
headers = {"x-api-key": os.environ["SCAVIO_API_KEY"]}
visibility = {"channel": channel_name, "topics": {}}
for topic in topics:
resp = requests.post(
"https://api.scavio.dev/api/v1/search",
headers=headers,
json={
"query": f"{topic} site:youtube.com",
"num_results": 10,
},
timeout=10,
)
results = resp.json().get("results", [])
channel_hits = [
{"position": i + 1, "title": r["title"], "url": r["url"]}
for i, r in enumerate(results)
if channel_name.lower() in r["title"].lower()
or channel_name.lower() in r.get("url", "").lower()
]
competitors = [
{"position": i + 1, "title": r["title"]}
for i, r in enumerate(results)
if channel_name.lower() not in r["title"].lower()
]
visibility["topics"][topic] = {
"own_videos": channel_hits,
"competitor_videos": competitors[:5],
}
return visibility
result = analyze_channel_visibility("Fireship", [
"javascript tutorial 2026",
"react vs vue 2026",
"web development trends",
])
for topic, data in result["topics"].items():
own = len(data["own_videos"])
print(f"{topic}: {own} videos in top 10")Finding content gaps
A content gap is a topic your target audience searches for where neither you nor your competitors have strong results. Search for topics in your niche and check whether any channel dominates. Topics with no dominant channel are opportunities.
def find_content_gaps(niche_topics: list) -> list:
"""Find YouTube topics with no dominant channel."""
headers = {"x-api-key": os.environ["SCAVIO_API_KEY"]}
gaps = []
for topic in niche_topics:
resp = requests.post(
"https://api.scavio.dev/api/v1/search",
headers=headers,
json={"query": f"{topic} site:youtube.com", "num_results": 10},
timeout=10,
)
results = resp.json().get("results", [])
channels = set()
for r in results:
# Extract channel from YouTube URL patterns
url = r.get("url", "")
if "youtube.com" in url:
channels.add(url.split("/")[3] if len(url.split("/")) > 3 else "unknown")
# If many different channels appear, no one dominates
if len(channels) >= 6:
gaps.append({"topic": topic, "unique_channels": len(channels)})
return sorted(gaps, key=lambda x: x["unique_channels"], reverse=True)
gaps = find_content_gaps([
"rust async tutorial 2026",
"bun vs deno performance 2026",
"htmx real world project",
"sqlite for production 2026",
])
for g in gaps:
print(f"Gap: {g['topic']} ({g['unique_channels']} different channels)")Search API vs YouTube Data API
- YouTube Data API: subscriber counts, view counts, upload schedule, exact video stats. Requires Google Cloud project and OAuth. Quota: 10,000 units/day free.
- Search API: discovery and ranking position. Which videos appear when users search. No Google Cloud setup needed.
- Best together: use search API for competitive discovery, YouTube Data API for deep channel metrics.
Tracking competitor videos over time
Run the visibility analysis weekly and store results. Over time you build a picture of which competitors are gaining or losing search presence. This is data YouTube Analytics does not provide because it only shows your own channel.
Cost estimate
Analyzing 5 channels across 20 topics weekly: 100 searches per week, 400 per month. At $0.005/credit: $2/mo. Content gap analysis on 50 topics monthly: another $0.25. Total under $3/mo. Compare to TubeBuddy at $7.50/mo or vidIQ at $16.58/mo for their pro tiers, though those tools offer thumbnail analysis and tag suggestions that a search API does not.
Honest limitations
A search API tells you what ranks, not why. It cannot tell you watch time, click-through rate, or audience retention. For optimizing your own channel, YouTube Studio and YouTube Data API are irreplaceable. The search API is for competitive intelligence: understanding the landscape before you create content, not analyzing performance after you publish.