Skip to content
NEWMeet Alaaddin, your AI genie with a voice. trig8n launches 1 January 2027. See what is new

Library / Reports, Analytics & Dashboards

Reports, Analytics & Dashboards

Analyze YouTube channel stats via Telegram bot with Gemini and Google Sheets

Triggered by a Telegram message with a channel link, fetches YouTube Data API stats, logs snapshots to Google Sheets and returns a Gemini-written channel analysis in chat.

What it does

## Youtube Channel Analyser ### How it works This workflow lets a user send a YouTube channel link through Telegram, validates and resolves the channel with the YouTube Data API, then fetches recent upload and video statistics. It computes channel/video velocity metrics, builds a channel fingerprint, logs valid snapshots to Google Sheets, and uses Gemini to generate a Telegram channel analysis report. It also returns Telegram messages for bad links, missing channels, API errors, or insufficient sample size. ### Setup steps 1. Telegram — create a bot with BotFather, add its token as a Telegram credential, and select that same credential on the trigger and all five message nodes (Notify Bad Channel Link, Notify Channel Not Found, Notify No Baseline Found, Handle Telegram API Error, Send Channel Report). 2. YouTube Data API v3 — enable it in Google Cloud and create an API key. In n8n add a Query Auth generic credential with Name set to key and Value set to your API key, then select it on all three HTTP Request nodes. The name must be exactly key, that is the query parameter the YouTube API expects. 3. Google Sheets — create a sheet tab whose first row holds these 12 headers, spelled exactly: snapshot_at, channel_id, channel_title, subscribers, total_videos, sample_size, baseline_vph, baseline_views_per_day, median_views, median_duration_min, pct_with_chapters, noise_floor_hit Then open Append to Google Sheets and pick your document and tab from the dropdowns. The node ships with placeholder IDs that must be replaced or the run will fail. If you use a service account credential, also share the sheet with the service account email address, otherwise every append returns a permission error. 4. Gemini — add a Google Gemini API credential and confirm the model in Gemini Model Setup is available on your account and region. 5. Test before publishing — run it against a large channel, a small channel, a brand new channel with no uploads, and a bad link, to confirm all four reply paths fire. ### Customization Adjust the number of uploads fetched, the sample-size threshold, velocity/baseline formulas, Google Sheets columns, and the Gemini prompt to match the type of channel analysis you want to produce.

The steps

  1. Handle Telegram API Error
  2. When Telegram Message Received
  3. Set Channel Lookup Details
  4. If Valid Channel Link
  5. Notify Bad Channel Link
  6. Fetch YouTube Channel Info
  7. If Channel Exists
  8. Notify Channel Not Found
  9. Prepare Channel Data
  10. Fetch Last 20 Uploads
  11. Split Uploads
  12. Aggregate Video IDs
  13. Fetch Video Statistics
  14. Split Video Statistics

25 steps in total.

Similar automations