YouTube analytics API: the metrics PubNio reads
PubNio's YouTube adapter declares 8 post metrics and 10 account metrics as supported. It re-reads each post on a schedule for 366 days after publishing. A metric YouTube does not report comes back as null with a reason. Provider facts checked 2026-12-05.
What PubNio returns
| Metric | Post field | Account field |
|---|---|---|
views | views | views |
likes | likes | likes |
comments | comments | comments |
shares | shares | shares |
| follows | subscribersGained | not declared |
followers | — | subscriberCount |
follower_gained | — | subscribersGained |
follower_lost | — | subscribersLost |
watch_time_ms | estimatedMinutesWatched × 60,000 | estimatedMinutesWatched × 60,000 |
avg_watch_time_ms | averageViewDuration × 1,000 | averageViewDuration × 1,000 |
| completion_rate | averageViewPercentage ÷ 100 | averageViewPercentage ÷ 100 |
YouTube returns no value for the other keys, impressions, reach, saves, clicks, link_clicks, profile_visits, page_views, engagement, and engagement_rate: the adapter marks each not_exposed or leaves it out.
“Not declared” means the adapter's capabilities leave the metric out. A post reading then comes back unsupported with reason not_exposed; an account reading comes back pending with reason account_analytics_pending and stays there, because the account sync reads only declared metrics.
How PubNio reads it
- PubNio reads YouTube Analytics reports for the channel, twice per read: once for totals and once with the
daydimension for the series. A video read adds the filtervideo==<id>. followersis the channel'ssubscriberCountfrom the Data API channels endpoint, a separate request.- Each report asks for
ids=channel==<channel id>with the request'sstartDateandendDateunchanged: unlike some adapters, this one does not shorten a long range before calling YouTube.
PubNio reads a YouTube post no sooner than 1 day after it is published; a post the sync pass finds later is read when it is found. After the first read it reads every 6 hours until day 7, daily until day 30, and weekly after that. It stops reading the post 366 days after publishing.
A post's daily points are YouTube's own daily values, stored as YouTube returns them for each day of the read.
Account metrics are read once a day, each time for the UTC dates from 30 days before the read through the day of the read, and readings count as stale two days after the last read.
Capabilities also declare latencySeconds: 86400, how long the adapter expects YouTube's numbers to take to settle. PubNio publishes the figure; reads are scheduled only by the rules above.
PubNio's YouTube analytics capabilities require these OAuth scopes on the connected account: https://www.googleapis.com/auth/youtube.readonly, https://www.googleapis.com/auth/yt-analytics.readonly. When one is missing, the sync marks the metrics permission_missing and lists what is absent in missingScopes.
watch_time_ms: YouTube's reference defines estimatedMinutesWatched as “The number of minutes that users watched videos for the specified channel, content owner, video, or playlist.” PubNio multiplies it by 60,000 for watch_time_ms, and averageViewDuration (seconds) by 1,000 for avg_watch_time_ms. Both are read for a video or the channel, with YouTube's own daily rows.
- The same conversion runs on the totals report and on every daily row, so a series point and the total use one unit.
- The reference defines
averageViewDurationas “The average length, in seconds, of video playbacks.”
Example
views is declared, and no daily account read has stored it yet, so it is pending with reason not_published until the first read lands. impressions and reach are metrics YouTube does not supply: each comes back unsupported with its reason. The request answers 200 with one entry per key.
GET /api/v1/workspaces/4e5f6a7b-8c9d-4e0f-9a1b-2c3d4e5f6a7b/analytics/accounts/7f3c2a10-5b4e-4d6f-8a9b-0c1d2e3f4a5b?metrics=views&metrics=impressions&metrics=reach
Authorization: Bearer pn_live_***
[
{
"key": "views",
"value": null,
"availability": "pending",
"reason": "not_published"
},
{
"key": "impressions",
"value": null,
"availability": "unsupported",
"reason": "not_exposed"
},
{
"key": "reach",
"value": null,
"availability": "unsupported",
"reason": "not_exposed"
}
]
Limits
- No impressions, reach, saves, clicks, or profile visits for YouTube, and so no engagement or engagement rate.
- A request covers at most 366 days and 30 metrics, in UTC dates, and defaults to the last 30 days. How far back a daily series reaches depends on the workspace plan, and stored daily points are deleted after 400 days.
Sources
- YouTube Analytics API: Metrics, read 2026-12-05

