yt_channel_snapshot
Fetches live YouTube channel stats, recent long-form videos, and Shorts metrics using OAuth for private owner analytics. Writes an updated local report.html dashboard and JSON cache.
Instructions
Fetch live YouTube channel statistics, recent long-form videos, and Shorts metrics, and write an updated local report.html dashboard and channel_snapshot.json cache on disk. When YouTube OAuth2 credentials are present (and force_public is false), queries YouTube Data API v3 (~3 quota units) and YouTube Analytics API v2 for private owner metrics (averageViewPercentage, swipedAwayRate, engagedViews, estimatedMinutesWatched, subscribersGained); public page scraping is opt-in only (force_public=true or MATEAI_YT_PUBLIC_SCRAPE=1); without OAuth or opt-in it returns setup instructions. Overwrites report.html idempotently on each run.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| handle | No | YouTube channel handle (with or without leading '@', e.g. '@mateai-c6m'). Defaults to '@mateai-c6m'. | @mateai-c6m |
| force_public | No | Opt in to public page scraping for this call (bypasses OAuth2; public views/likes only). Only set when the user asks for it. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | ||
| shorts | Yes | ||
| videos | Yes | ||
| channel | Yes | ||
| dashboardPath | Yes |