YouTube Viral Topic
Use this skill to find recent YouTube videos that are already performing strongly in a niche. Do not make low-subscriber status the default logic.
Quick Start
Run the bundled script from this skill directory:
bashpython3 scripts/search_youtube_viral_topic.py --topic "AI agent,Claude Code" --days 30 --min-views 10000 --limit 50 --format markdown
Required environment for live API calls:
bashexport YOUTUBE_API_KEY="..."
You can also pass --api-key explicitly for one-off runs. Never write API keys into skill files or output artifacts.
Workflow
- Convert the user's niche into concise query clusters.
- Call YouTube
search.listwithtype=video,order=viewCount, andpublishedAfterfor the requested recent window. - Deduplicate video ids across queries.
- Batch-enrich videos through
videos.listfor statistics and metadata. - Batch-enrich channels through
channels.listfor public subscriber counts. - Filter only by viral strength:
view_count >= --min-viewslike_count + comment_count * 2 >= --min-engagementonly when the user sets--min-engagement
- Rank by
viral_score, thenview_count, thenlike_view_rate. - Return JSON for automation or Markdown for human topic review.
Output Contract
Each result must preserve the source URL, video metrics, and optional channel context:
json{ "platform": "youtube", "content_id": "", "url": "", "title": "", "author_id": "", "author_name": "", "subscriber_count": 0, "published_at": "", "view_count": 0, "like_count": 0, "comment_count": 0, "hot_score": 0, "viral_score": 0, "evidence": [] }
For cross-platform tables, follower_count is still populated with YouTube channel subscribers when available, but it is not a default filter.
Read references/scoring.md before changing thresholds or combining YouTube results with other platforms.
Guardrails
- Do not call the default output "low-fan" or "low-subscriber" results.
- Treat
subscriberCountas public rounded/abbreviated subscriber data, useful only as context. - If
hiddenSubscriberCountis true or subscriber count is missing, keep the video eligible as long as it passes the viral filters. - Prefer API collection over browser scraping. Browser sessions should only be used when the user explicitly asks.
- Use videos as topic signals, structure references, and hook references. Do not copy scripts or captions wholesale.


