Zernio
APIFor you
Zernio
APIFor you
API Reference

Posting Analytics

Cross-platform

Get post analyticsGETAnalytics changed since a cursorGETSync an external postPOSTGet post analytics timelineGETGet daily aggregated metricsGETGet best times to postGETGet content performance decayGETGet frequency vs engagementGETGet follower statsGET

Instagram

Get Instagram insightsGETGet Instagram follower historyGETGet Instagram demographicsGET

YouTube

Get YouTube channel insightsGETGet YouTube daily viewsGETGet YouTube video retention curveGETGet YouTube demographicsGET

LinkedIn

Get LinkedIn aggregate statsGETGet LinkedIn org analyticsGETGet LinkedIn post statsGETGet LinkedIn post reactionsGET

Facebook

Get Facebook Page insightsGETGet Facebook post reactionsGETGet Facebook post monetization earningsGET

TikTok

Get TikTok account-level insightsGET

Google Business

Get Google Business Profile performance metricsGETGet Google Business Profile search keywordsGET

Other

Cancel a tracking windowDELETEGet an analytics dashboardGETGet Facebook Page demographicsGETList Google Analytics (GA4) dimensions and metricsGETGet Instagram online followersGETGet LinkedIn organization follower demographicsGETGet a post's authenticity scoreGETGet post samplesGETGet a tracking windowGETList the posts a Facebook Page is tagged inGETList visitor posts on a Facebook PageGETList authenticity scoresGETList tracking windowsGETOpen a tracking windowPOSTRun a Google Analytics (GA4) realtime reportPOSTRun a Google Analytics (GA4) reportPOST
Dashboard
OverviewPlatformsAPI ReferenceResources
Posting Analytics

Get YouTube daily views

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). YouTube finalizes analytics with a ~3-day delay; by default only finalized days are returned, and an explicit endDate can reach into the delay window (see the endDate parameter). Max 90 days, defaults to last 30 days.


GET
/v1/analytics/youtube/daily-views

Authorization

bearerAuth
AuthorizationBearer <token>

API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.

In: header

Query Parameters

videoId*string

The YouTube video ID (e.g., "dQw4w9WgXcQ")

accountId*string

The Zernio account ID for the YouTube account

fromDate?string

Start date (YYYY-MM-DD). Defaults to 30 days ago.

Formatdate
toDate?string

End date (YYYY-MM-DD). Defaults to 3 days ago, the newest fully finalized day (YouTube finalizes analytics with a ~3-day delay). An explicit toDate is honored up to today: days inside the delay window are provisional and may still be revised by YouTube (see provisionalSince in the response), and days YouTube has not processed yet are omitted from dailyViews.

Formatdate
startDate?string
Deprecated

Alias of fromDate, kept for existing callers

Formatdate
endDate?string
Deprecated

Alias of toDate, kept for existing callers

Formatdate

Response Body

application/json

application/json

application/json

application/json

application/json

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.getYouTubeDailyViews({  query: {    videoId: 'video_abc123',    accountId: 'account_abc123',  },});console.log(data);
{  "success": true,  "videoId": "dQw4w9WgXcQ",  "durationSeconds": 213,  "dateRange": {    "startDate": "2025-01-01",    "endDate": "2025-01-12"  },  "totalViews": 12345,  "dailyViews": [    {      "date": "2025-01-12",      "views": 1234,      "estimatedMinutesWatched": 567.5,      "averageViewDuration": 45.2,      "averageViewPercentage": 21.2,      "subscribersGained": 10,      "subscribersLost": 2,      "likes": 89,      "comments": 12,      "shares": 5    },    {      "date": "2025-01-11",      "views": 987,      "estimatedMinutesWatched": 432.1,      "averageViewDuration": 43.8,      "averageViewPercentage": 20.6,      "subscribersGained": 8,      "subscribersLost": 1,      "likes": 67,      "comments": 8,      "shares": 3    }  ],  "lastSyncedAt": "2025-01-15T12:00:00Z",  "scopeStatus": {    "hasAnalyticsScope": true  }}
Was this page helpful?

Get YouTube channel 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. 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.

Get YouTube video retention curve

Returns the audience retention curve for a single YouTube video, plus the video's duration for rendering the curve on a time axis. The curve has up to 100 points (elapsedVideoTimeRatio 0.01-1.0) aggregated over the whole date range; YouTube does not support per-day retention breakdowns. audienceWatchRatio is the absolute share of viewers watching at that point in the video and can exceed 1 (rewinds and looping, common on Shorts). relativeRetentionPerformance compares against videos of similar length (0 = worst, 0.5 = median, 1 = best). YouTube returns an empty curve for videos with very few views or before analytics processing completes (2-3 day delay). Requires yt-analytics.readonly scope (re-authorization may be needed).