Get YouTube channel-level insights
Returns channel-scoped aggregate metrics from YouTube Analytics API v2. Saves you from looping /v1/analytics/youtube/daily-views over every video when you only need channel totals. Response shape matches /v1/analytics/instagram/account-insights so the same client handling works. Requires yt-analytics.readonly scope (412 with reauthorizeUrl if missing). Data has a 2-3 day delay (endDate is clamped accordingly). Max 89 days, defaults to last 30 days. Requires the Analytics add-on. NOT exposed: impressions (Studio thumbnail impressions) and impressionsClickThroughRate. YouTube Analytics API v2 does not expose these for any principal type, not channel owners, not Partner Program channels, not content owners with CMS access. The only way to get them is Studio CSV export. This is a Google-side limitation.
API key authentication - use your Zernio API key as a Bearer token
In: header
Query Parameters
The Zernio SocialAccount ID for the YouTube account.
Comma-separated list. Defaults to "views,estimatedMinutesWatched,subscribersGained,subscribersLost".
Live YouTube Analytics v2 metrics:
- views
- estimatedMinutesWatched
- averageViewDuration (ratio - weighted mean computed across days)
- subscribersGained
- subscribersLost
Zernio-synthesized from daily follower snapshots (cross-platform parity):
- followers_gained
- followers_lost
Start date (YYYY-MM-DD). Defaults to 30 days ago.
dateEnd date (YYYY-MM-DD). Defaults to today. YouTube Analytics has a 2-3 day delay, so the fetch is internally clamped to 3 days ago; any requested range extending beyond that returns zero values for the tail days. The response's dateRange.until field reflects your requested value.
date"total_value" (default) returns aggregated totals. "time_series" returns per-day values in the "values" array.
"total_value""time_series" | "total_value"Response Body
application/json
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.analytics.getYouTubeChannelInsights({ query: { accountId: 'account_abc123', },});console.log(data);{
"success": true,
"accountId": "string",
"platform": "facebook",
"dateRange": {
"since": "2019-08-24",
"until": "2019-08-24"
},
"metricType": "time_series",
"breakdown": "string",
"metrics": {
"property1": {
"total": 0,
"values": [
{
"date": "2019-08-24",
"value": 0
}
],
"breakdowns": [
{
"dimension": "string",
"value": 0
}
]
},
"property2": {
"total": 0,
"values": [
{
"date": "2019-08-24",
"value": 0
}
],
"breakdowns": [
{
"dimension": "string",
"value": 0
}
]
}
},
"dataDelay": "Data may be delayed up to 48 hours"
}{
"error": "Unauthorized"
}{
"success": false,
"error": "To access daily video analytics, please reconnect your YouTube account to grant the required permissions.",
"code": "youtube_analytics_scope_missing",
"scopeStatus": {
"hasAnalyticsScope": false,
"requiresReauthorization": true,
"reauthorizeUrl": "http://example.com"
}
}Get TikTok account-level insights GET
Returns account-level TikTok insights from /v2/user/info/ (live) plus historical time series joined from Zernio's daily snapshotter (AccountStats). Response shape matches /v1/analytics/instagram/account-insights. Max 89 days, defaults to last 30 days. Requires the Analytics add-on and the user.info.stats scope on the account (412 if missing). Scope intentionally narrow. TikTok's public API exposes only the four counter metrics below. The deep metrics that live in TikTok Studio are NOT available on any public TikTok API, even for Business accounts: - profile_views - account-level impressions / reach - follower inflow / outflow breakdown - video watch time, average watch time, full-watched rate - impression_sources (FYP / Following / Hashtag / Search / Personal profile) TikTok's Research API doesn't expose those fields either, and is restricted to non-commercial academic use per TikTok's eligibility policy. There is no public API workaround. Post-level metrics (views, likes, comments, shares per video) are available via /v1/analytics?postId=... from TikTok's /v2/video/query/.
Get YouTube daily views GET
Returns daily view counts for a YouTube video including views, watch time, and subscriber changes. Requires yt-analytics.readonly scope (re-authorization may be needed). Data has a 2-3 day delay. Max 90 days, defaults to last 30 days.