← 返回
数据分析 Key 中文

YouTube Analytics

YouTube Data API v3 analytics toolkit. Analyze YouTube channels, videos, and search results. Use when the user asks to: check YouTube channel stats, analyze video performance, compare channels, search for videos, get subscriber counts, view engagement metrics, find trending videos, get channel uploads, or analyze YouTube competition. Requires a YouTube Data API v3 key from Google Cloud Console.
YouTube Data API v3 分析工具包。用于分析频道、视频及搜索结果。适用于查询频道统计、分析视频表现、频道对比、视频搜索、订阅数、互动指标、热门视频、频道上传内容及竞品分析。需提供 Google Cloud Console 的 API 密钥。
adamkristopher
数据分析 clawhub v1.0.0 1 版本 99661.5 Key: 需要
★ 7
Stars
📥 2,804
下载
💾 267
安装
1
版本
#latest

概述

YouTube Analytics Toolkit

Setup

Install dependencies:

cd scripts && npm install

Configure credentials by creating a .env file in the project root:

YOUTUBE_API_KEY=AIzaSy...your-api-key
YOUTUBE_DEFAULT_MAX_RESULTS=50

Prerequisites: A Google Cloud project with the YouTube Data API v3 enabled. Get your API key from the Google Cloud Console.

Quick Start

User saysFunction to call
----------------------------
"Analyze this YouTube channel"analyzeChannel(channelId)
"Compare these two channels"compareChannels([id1, id2])
"How is this video performing?"analyzeVideo(videoId)
"Search YouTube for [topic]"searchAndAnalyze(query)
"Get stats for this channel"getChannelStats(channelId)
"Get this video's view count"getVideoStats(videoId)
"Find channels about [topic]"searchChannels(query)
"Show recent uploads from this channel"getChannelVideos(channelId)

Execute functions by importing from scripts/src/index.ts:

import { analyzeChannel, searchAndAnalyze } from './scripts/src/index.js';

const analysis = await analyzeChannel('UCxxxxxxxx');

Or run directly with tsx:

npx tsx scripts/src/index.ts

Workflow Pattern

Every analysis follows three phases:

1. Analyze

Run API functions. Each call hits the YouTube Data API and returns structured data.

2. Auto-Save

All results automatically save as JSON files to results/{category}/. File naming patterns:

  • Named results: {sanitized_name}.json
  • Auto-generated: YYYYMMDD_HHMMSS__{operation}.json

3. Summarize

After analysis, read the saved JSON files and create a markdown summary in results/summaries/ with data tables, comparisons, and insights.

High-Level Functions

FunctionPurposeWhat it gathers
-----------------------------------
analyzeChannel(channelId)Full channel analysisChannel info, recent videos, avg views per video
compareChannels(channelIds)Compare multiple channelsSide-by-side subscribers, views, video counts
analyzeVideo(videoId)Video performance analysisViews, likes, comments, like rate, comment rate
searchAndAnalyze(query, maxResults?)Search + statsSearch results with full video statistics

Individual API Functions

For granular control, import specific functions from the API modules. See references/api-reference.md for the complete list of 13 API functions with parameters, types, and examples.

Channel Functions

FunctionPurpose
-------------------
getChannel(channelId)Get full channel details
getChannelStats(channelId)Get simplified stats (subscribers, views, videoCount)
getMultipleChannels(channelIds)Batch fetch multiple channels

Video Functions

FunctionPurpose
-------------------
getVideo(videoId)Get full video details
getVideoStats(videoId)Get simplified stats (views, likes, comments)
getMultipleVideos(videoIds)Batch fetch multiple videos
getChannelVideos(channelId)Get recent uploads from a channel

Search Functions

FunctionPurpose
-------------------
searchVideos(query, options?)Search for videos
searchChannels(query, options?)Search for channels

Results Storage

Results auto-save to results/ with this structure:

results/
├── channels/       # Channel data and comparisons
├── videos/         # Video data and analyses
├── search/         # Search results
└── summaries/      # Human-readable markdown summaries

Managing Results

import { listResults, loadResult, getLatestResult } from './scripts/src/index.js';

// List recent results
const files = listResults('channels', 10);

// Load a specific result
const data = loadResult(files[0]);

// Get most recent result for an operation
const latest = getLatestResult('channels', 'channel_analysis');

Tips

  1. Use channel IDs — Channel IDs start with UC (e.g., UCxxxxxxxx). You can find them in the channel URL or page source.
  2. Request summaries — After pulling data, ask for a markdown summary with tables and insights.
  3. Compare channels — Use compareChannels() to benchmark competitors side by side.
  4. Batch requests — Use getMultipleChannels() or getMultipleVideos() for efficient batch lookups.
  5. Search + analyzesearchAndAnalyze() combines search with full video stats in one call.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-28 13:12 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

Data Analysis

ivangdavila
{"answer":"数据分析与可视化。查询数据库、生成报告、自动化电子表格,将原始数据转化为清晰可行的见解。适用于:(1) 您……"}
★ 198 📥 64,876
data-analysis

Excel / XLSX

ivangdavila
创建、检查和编辑 Microsoft Excel 工作簿及 XLSX 文件,支持可靠的公式、日期、类型、格式、重算及模板保留功能。
★ 367 📥 139,997
data-analysis

Stock Analysis

udiedrichsen
{"answer":"基于雅虎财经数据,分析股票与加密货币。支持投资组合管理、自选股预警、股息分析、8维评分、热门趋势扫描及传闻/早期信号探测。适用于股票分析、持仓追踪、财报异动、加密监控、热门股追踪或提前发掘非主流传闻。"}
★ 269 📥 56,895