OverviewProductsPlatformsAPI ReferenceResources
Posting Analytics

Get YouTube video retention curve

GEThttps://zernio.com/api/v1/analytics/youtube/video-retention

Returns the audience retention curve for a single YouTube video, plus the video's duration for rendering the curve on a time axis. Requires yt-analytics.readonly scope (re-authorization may be needed).

Authentication

AuthorizationBearer tokenRequired

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

Query parameters

videoIdstringRequired

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

accountIdstringRequired

The Zernio account ID for the YouTube account

fromDatestring (date)

Start date (YYYY-MM-DD). Defaults to the video's publish date (lifetime curve).

toDatestring (date)

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).

startDateDeprecatedstring (date)

Alias of fromDate, kept for existing callers

endDateDeprecatedstring (date)

Alias of toDate, kept for existing callers

Responses

Success· the request worked

Errors· the request failed

How it behaves

The curve

  • Up to 100 points (elapsedVideoTimeRatio 0.01-1.0), aggregated over the whole date range. YouTube does not support per-day retention breakdowns.
  • audienceWatchRatio: the absolute share of viewers watching at that point in the video. It can exceed 1 (rewinds and looping, common on Shorts).
  • relativeRetentionPerformance: compares against videos of similar length (0 = worst, 0.5 = median, 1 = best).
  • Zernio returns exactly the buckets YouTube reports for the requested range and fills none in. A curve that ends before 1.0, or skips a position, means YouTube returned no row there for that range.
  • The range ends at toDate (default 3 days ago), so recent views are included only with a later toDate.

Empty curves

YouTube returns an empty curve for videos with very few views or before analytics processing completes (2-3 day delay).

startedWatching and stoppedWatching

YouTube does not return segment-level data for every video. Zernio then fetches the curve without it: segmentMetricsAvailable is false and both fields are 0 placeholders in every point. When it is true, a 0 is the value YouTube reported.

GET/v1/analytics/youtube/video-retention
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.analytics.getYouTubeVideoRetention({  query: {    videoId: 'video_abc123',    accountId: 'account_abc123',  },});console.log(data);
{  "success": true,  "accountId": "65f1a2b3c4d5e6f7a8b9c0d1",  "videoId": "zF7Gp4jnDa0",  "title": "what's your choice?",  "publishedAt": "2026-05-20T12:00:00Z",  "durationSeconds": 24,  "dateRange": {    "startDate": "2026-05-20",    "endDate": "2026-06-09"  },  "retentionCurve": [    {      "elapsedVideoTimeRatio": 0.01,      "audienceWatchRatio": 1.6956,      "relativeRetentionPerformance": 0.73665,      "startedWatching": 280331,      "stoppedWatching": 5348,      "totalSegmentImpressions": 478466    },    {      "elapsedVideoTimeRatio": 0.02,      "audienceWatchRatio": 1.678,      "relativeRetentionPerformance": 0.73865,      "startedWatching": 385,      "stoppedWatching": 11790,      "totalSegmentImpressions": 473492    }  ],  "segmentMetricsAvailable": true,  "scopeStatus": {    "hasAnalyticsScope": true  }}
OpenAPI specification
Was this page helpful?