You can retrieve YouTube channel statistics via the Scavio search API by setting platform to youtube. This avoids the YouTube Data API v3 quota system and returns subscriber counts, view counts, and recent videos in a single request.
Prerequisites
- Python 3.9+
- Scavio API key
Walkthrough
Step 1: Search for a YouTube channel
Search the channel name with platform:youtube to get channel-level stats.
import requests
API_KEY = "your-scavio-api-key"
def get_channel_stats(channel_name: str) -> dict:
r = requests.post(
"https://api.scavio.dev/api/v1/search",
json={
"query": channel_name,
"platform": "youtube",
"num_results": 5
},
headers={"x-api-key": API_KEY},
timeout=20
)
r.raise_for_status()
return r.json()
data = get_channel_stats("Fireship")
results = data.get("organic_results", [])
for r in results:
print(r.get("title"), r.get("channel"), r.get("views"))Step 2: Search for recent videos from a channel
Add the channel name plus a topic to get relevant video listings with view counts.
def get_channel_videos(channel_name: str, topic: str = "") -> list:
query = f"{channel_name} {topic}".strip()
r = requests.post(
"https://api.scavio.dev/api/v1/search",
json={"query": query, "platform": "youtube", "num_results": 20},
headers={"x-api-key": API_KEY},
timeout=20
)
r.raise_for_status()
results = r.json().get("organic_results", [])
return [
{
"title": v.get("title"),
"url": v.get("link"),
"views": v.get("views"),
"duration": v.get("duration"),
"published": v.get("published_date"),
"channel": v.get("channel")
}
for v in results
if channel_name.lower() in (v.get("channel") or "").lower()
]Step 3: Build a simple terminal dashboard
Display stats for multiple channels in a formatted table.
CHANNELS = ["Fireship", "Theo - t3.gg", "ThePrimeagen", "Web Dev Simplified"]
print(f"{'Channel':<25} {'Recent Videos Found':>20}")
print("-" * 50)
for channel in CHANNELS:
videos = get_channel_videos(channel)
total_views = sum(
int(v["views"].replace(",", "").replace(" views", ""))
for v in videos
if v.get("views") and v["views"].replace(",", "").replace(" views", "").isdigit()
)
print(f"{channel:<25} {len(videos):>10} videos found")Python Example
import requests
import re
from datetime import date
API_KEY = "your-scavio-api-key"
def parse_views(views_str: str) -> int:
if not views_str:
return 0
cleaned = re.sub(r"[^0-9KMB.]", "", views_str.upper())
if "B" in cleaned:
return int(float(cleaned.replace("B", "")) * 1_000_000_000)
if "M" in cleaned:
return int(float(cleaned.replace("M", "")) * 1_000_000)
if "K" in cleaned:
return int(float(cleaned.replace("K", "")) * 1_000)
return int(cleaned) if cleaned.isdigit() else 0
def get_channel_videos(channel_name: str, n: int = 20) -> list:
r = requests.post(
"https://api.scavio.dev/api/v1/search",
json={"query": channel_name, "platform": "youtube", "num_results": n},
headers={"x-api-key": API_KEY},
timeout=20
)
r.raise_for_status()
results = r.json().get("organic_results", [])
return [
{"title": v.get("title"), "url": v.get("link"),
"views": parse_views(v.get("views","")),
"views_raw": v.get("views"), "duration": v.get("duration"),
"published": v.get("published_date"), "channel": v.get("channel")}
for v in results
]
def channel_dashboard(channels: list) -> None:
print(f"YouTube Dashboard — {date.today()}")
print("=" * 70)
for ch in channels:
videos = get_channel_videos(ch)
if not videos:
print(f"{ch}: no data")
continue
total_views = sum(v["views"] for v in videos)
top = sorted(videos, key=lambda v: v["views"], reverse=True)[:1]
print(f"\n{ch}")
print(f" Videos found: {len(videos)} | Total tracked views: {total_views:,}")
if top:
print(f" Top video: {top[0]['title'][:60]} ({top[0]['views_raw']})")
if __name__ == "__main__":
channel_dashboard(["Fireship", "Theo - t3.gg", "ThePrimeagen"])JavaScript Example
const API_KEY = 'your-scavio-api-key';
async function getChannelVideos(channelName, n = 20) {
const res = await fetch('https://api.scavio.dev/api/v1/search', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'x-api-key': API_KEY },
body: JSON.stringify({ query: channelName, platform: 'youtube', num_results: n })
});
const data = await res.json();
return data.organic_results ?? [];
}
const channels = ['Fireship', 'Theo - t3.gg'];
for (const ch of channels) {
const videos = await getChannelVideos(ch);
console.log(`\n${ch}: ${videos.length} videos found`);
for (const v of videos.slice(0, 3)) {
console.log(` ${v.title?.slice(0, 60)} | ${v.views}`);
}
}Expected Output
YouTube Dashboard - 2026-05-22
======================================================================
Fireship
Videos found: 18 | Total tracked views: 24,892,441
Top video: Every JavaScript Framework Explained in 30 Seconds (4.2M views)
Theo - t3.gg
Videos found: 15 | Total tracked views: 12,441,209
Top video: I was wrong about React Server Components (2.1M views)