youtube-analytics-cli

module
v0.0.0-...-aea8ea7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2026 License: MIT

README

yt — YouTube Analytics CLI

Go CI

Growth-oriented YouTube analytics from your terminal.

Features

  • Channel overview — subscribers, views, and video count at a glance
  • Analytics dashboard — views, watch time, subscribers, revenue over any period
  • Video deep dive — packaging, retention, engagement, growth, monetization, and audience breakdown for a single video
  • Diagnostics — automated insights (CTR, retention, sub conversion) with actionable recommendations
  • Top videos — rank videos by any metric (views, revenue, likes, etc.)
  • Multi-account — manage multiple YouTube channels with named aliases
  • Flexible output — colored tables (default), JSON (--json), or plain TSV (--plain)
  • Custom queries — arbitrary metrics, dimensions, filters, and sorting

Installation

With go install
go install github.com/shubs/youtube-analytics-cli/cmd/yt@latest
From source
git clone https://github.com/shubs/youtube-analytics-cli.git
cd youtube-analytics-cli
make build
# Binary is at ./bin/yt

Quick Start

1. Set up OAuth credentials

You need Google Cloud OAuth 2.0 credentials with the YouTube Analytics and YouTube Data API enabled. See CONTRIBUTING.md for details.

yt auth setup <CLIENT_ID> <CLIENT_SECRET>
2. Log in
yt auth login

This opens your browser for OAuth consent. The token is stored securely in your system keyring.

3. Explore
# Channel overview
yt channel

# Last 28 days analytics
yt analytics overview

# Last 7 days
yt analytics overview --since 7d

# Top 10 videos by views
yt videos top --since 90d

# Deep dive on a specific video
yt video <VIDEO_ID>

# Revenue breakdown by country
yt analytics revenue -d country --since 90d

# Output as JSON
yt analytics overview --json

Command Reference

Command Description
yt auth setup Configure OAuth client credentials
yt auth login [alias] Authenticate with YouTube
yt auth logout <alias> Remove stored credentials
yt auth list List configured accounts
yt auth status Show authentication status
yt channel Show channel information
yt channel stats Channel stats with period comparison
yt analytics overview Key metrics overview
yt analytics query Custom analytics query
yt analytics revenue Revenue breakdown
yt analytics demographics Age and gender demographics
yt analytics traffic Traffic source breakdown
yt videos list List recent videos
yt videos top Top videos by metric
yt video <ID> Deep dive dashboard for a video
yt version Show version information

Prerequisites

  • Go 1.24+
  • Google Cloud project with OAuth 2.0 credentials (Desktop app type)
  • APIs enabled: YouTube Data API v3 and YouTube Analytics API

License

MIT

Directories

Path Synopsis
cmd
yt command
internal
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL