Metrics over time
get_metrics_over_timeRetrieve YouTube analytics metrics over time by day, week, month, or year to analyze trends, build growth charts, and compare subscriber gains versus losses for a channel or video.
Instructions
A time series of metrics by day, week, month or year — for trend analysis and growth charts. Adds netSubscribers when gained and lost are both requested. Buckets cut off by the date range are flagged partial=true.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_metrics_over_time"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| period | No | Named date range, Studio-style. Rolling ranges end at the latest complete day of data (analytics lag ~2-3 days; dates are US Pacific). Ignored when start_date is set. | last_90_days |
| metrics | No | Analytics metric names. Default: views, estimatedMinutesWatched, subscribersGained, subscribersLost. Others: engagedViews, likes, comments, shares, averageViewDuration, averageViewPercentage, estimatedRevenue, estimatedAdRevenue, cpm, playbackBasedCpm, ... | |
| save_to | No | Optional file to also save the rows to (.csv or .json). A bare filename goes in the output directory; absolute paths are allowed. | |
| end_date | No | Custom range end, YYYY-MM-DD (inclusive). Defaults to the latest complete day. | |
| video_id | No | Limit to one video (11-character ID, e.g. 'dQw4w9WgXcQ'). Omit for the whole channel. | |
| start_date | No | Custom range start, YYYY-MM-DD. Overrides `period`. | |
| granularity | No | Bucket size. Weeks start on Monday. | day |
| content_type | No | Only Shorts, regular videos, or live streams. | |
| include_cumulative_subscribers | No | Add totalSubscribers per bucket (running total of net subscribers since the channel started; great for growth charts). Channel-wide only. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||