The catalogue/YouTube Analytics
YouTube Analytics
app.youtube-analytics
Channel and video analytics for your YouTube channel: views, watch time, retention and audience
What it does
The app, in its own words.
Read YouTube channel analytics with the YouTube Analytics API and the YouTube Data API v3: views, watch time, subscribers, traffic sources, devices, geography, demographics, top videos, audience retention, and the channel's videos and playlists. Read-only; Google OAuth.
Tools
12 tools the agent can call.
Every one is declared with typed parameters and returns structured results, so the host can render them instead of narrating them.
- get-audience-retentionAudience retention curve of one video: for each point of the video (elapsedVideoTimeRatio, 0.01 to 1.0 in about 100 steps) the share of views still watching (audienceWatchRatio; can exceed 1 where people rewatch) and relativeRetentionPerformance (0-1, compared with videos of similar length; 0.5 is average). Returned as parallel arrays. Use it to find where viewers drop off. Optional filters: audienceType and subscribedStatus (default: all views).
- get-channel-reportChannel analytics for a date range: views, watch time (estimatedMinutesWatched), average view duration, subscribers gained and lost, likes, comments and shares, as totals or broken down by day, month, country, content type, traffic source, device type or operating system. Returns { totals } for groupBy none, otherwise { columns, rows } (rows are arrays in column order). Dates are Pacific time; the last 2-3 days are usually incomplete. For one video use get-video-report; for any other metric or dimension combination use run-report.
- get-demographicsViewer age and gender for the channel or one video: the percentage of views (signed-in viewers only) per ageGroup (age13-17 ... age65-) and/or gender (female, male, user_specified). Returns { columns, rows } with viewerPercentage (0-100). YouTube hides demographics when there are too few viewers, so small channels may get no rows.
- get-top-videosThe channel’s best-performing videos in a date range, ranked by views, watch time or subscribers gained or lost. Each row has the video id, title, publishedAt, url, duration and views, estimatedMinutesWatched, averageViewDuration (seconds), averageViewPercentage, likes, comments, shares, subscribersGained, subscribersLost for that range. At most 50 videos. Use get-video-report on an id for its breakdown.
- get-video-reportAnalytics for one video over a date range: views, watch time, average view duration and percentage, subscribers gained and lost, likes, comments and shares, as totals or broken down by day, month, country, traffic source, device type or operating system. Returns { totals } for groupBy none, otherwise { columns, rows }. Use get-top-videos or list-videos to find video ids; get-audience-retention for where viewers drop off.
- get-videosDetails and lifetime stats of up to 50 videos by id: title, description (first 500 characters), tags, publishedAt, durationSeconds, definition, captions, privacyStatus, scheduled publishAt, madeForKids, views, likes, comments, thumbnail and url. Ids that do not exist or are not visible to the account are listed in notFound. For views in a date range use get-video-report.
- list-channelsList the YouTube channels of the connected Google account (usually one; a Brand Account may manage several). Returns id (UC...), title, handle, publishedAt, subscribers, views, videoCount and uploadsPlaylistId. Start here: pass a channel id as channelId to the report tools when the account has more than one channel (they default to the account’s own channel).
- list-playlist-videosList the videos in a playlist, in playlist order: position, videoId, title, videoPublishedAt, addedAt, privacyStatus, owner channel and url. Up to 50 per page with nextPageToken. Deleted or private videos appear with their placeholder title. Use get-videos on the ids for stats.
- list-playlistsList the channel’s playlists: id, title, description (first 200 characters), publishedAt, itemCount, privacyStatus and url. Up to 50 per page with nextPageToken. Use list-playlist-videos for a playlist’s videos, or run-report with filters playlist==ID for its analytics.
- list-videosList the channel’s uploaded videos, newest first, with lifetime stats: id, title, publishedAt, url, privacyStatus (public, unlisted, private), durationSeconds, views, likes, comments. Up to 50 per page; pass nextPageToken back as pageToken for more. Costs 3 quota units per page. To find videos by keyword use search-videos.
- run-reportRun any YouTube Analytics query (reports.query) for the channel when the focused report tools do not cover it: choose metrics, dimensions, filters and sort yourself. Example: dimensions insightPlaybackLocationType (where videos were watched), or dimensions sharingService with metric shares. Only some metric/dimension combinations are valid (see https://developers.google.com/youtube/analytics/channel_reports); an invalid one returns [BAD_REQUEST] with the API’s reason. Revenue metrics are not available (the app does not request the monetary scope). Returns { columns, rows } or { totals } without dimensions; pass nextStartIndex back as startIndex to page.
- search-videosSearch the connected account’s own videos by keyword (title, description, tags). Returns id, title, publishedAt, url, a short description and liveBroadcastContent; up to 50 per page with nextPageToken. Expensive: 100 quota units per call out of a default 10,000 a day, so prefer list-videos to browse. Very recent uploads can take a while to appear.
Auth and permissions
What it asks for.
Declared in the manifest, in advance. The app cannot reach anything it did not ask for here.
Scopes
System secrets
Installation secrets
Reading further
The manifest and the source for YouTube Analytics live in the repository, alongside the other apps.