Skip to content
Get started
BlogYouTube Shorts audience retention through the API

YouTube Shorts audience retention through the API

How to get the retention curve of a Short from the YouTube Analytics API: the elapsedVideoTimeRatio dimension, the audienceWatchRatio and relativeRetentionPerformance metrics, the single-video filter, OAuth scopes and limits. Plus how Praeko returns it through its API and MCP server.

The audience retention report in YouTube Studio shows which moments of a video held viewers' attention and where they stopped watching. If you want that data in code (a script, your own dashboard, or an AI agent drafting the next script), you need the YouTube Analytics API. This post walks through the query, what each number means, what Google's docs say about scopes, and what they leave out about Shorts.

The report you want: audience retention

The YouTube Analytics API has a channel report called "Audience retention". Google's channel reports page describes it as a measure of a video's ability to retain its audience. Its rules shape everything else:

  • Required dimension: elapsedVideoTimeRatio, the share of the video that has elapsed.
  • Metrics (one or more): audienceWatchRatio, relativeRetentionPerformance, startedWatching, stoppedWatching and totalSegmentImpressions. According to the revision history, the last three were added to this report on May 6, 2024.
  • Required filter: video, with a single ID. The page says this report does not accept a comma-separated list of values for the video filter.
  • Optional filters: audienceType, subscribedStatus and youtubeProduct.

So you make one request per video. Thirty Shorts means thirty requests.

The request

The method is reports.query, at GET https://youtubeanalytics.googleapis.com/v2/reports. Required parameters are ids, startDate, endDate (YYYY-MM-DD) and metrics. For your own channel, use ids=channel==MINE.

text
GET https://youtubeanalytics.googleapis.com/v2/reports
  ?ids=channel==MINE
  &startDate=2026-11-01
  &endDate=2026-12-03
  &metrics=audienceWatchRatio,relativeRetentionPerformance
  &dimensions=elapsedVideoTimeRatio
  &filters=video==YOUR_SHORT_ID;audienceType==ORGANIC
Authorization: Bearer <OAuth token of the channel owner>

Separate multiple filters with ;. audienceType==ORGANIC is optional. Supported values are ORGANIC, AD_INSTREAM and AD_INDISPLAY; with ORGANIC, the curve leaves out ad traffic.

The response is a table (kind: youtubeAnalytics#resultTable). columnHeaders lists the columns in order: dimensions first, then metrics, in the order you asked for them. rows holds the data. The shape below is illustrative only: field names come from the docs, and the values are placeholders.

json
{
  "kind": "youtubeAnalytics#resultTable",
  "columnHeaders": [
    { "name": "elapsedVideoTimeRatio", "columnType": "DIMENSION", "dataType": "FLOAT" },
    { "name": "audienceWatchRatio", "columnType": "METRIC", "dataType": "FLOAT" },
    { "name": "relativeRetentionPerformance", "columnType": "METRIC", "dataType": "FLOAT" }
  ],
  "rows": [
    ["<0.01>", "<audienceWatchRatio>", "<relativeRetentionPerformance>"],
    ["<0.02>", "<audienceWatchRatio>", "<relativeRetentionPerformance>"]
  ]
}

When there is no data, rows is omitted. The method page also warns that data may stop before endDate if a requested metric is not available yet for the latest dates.

What the numbers mean

  • elapsedVideoTimeRatio: the API returns 100 data points per video, from 0.01 to 1.0. On a 30-second Short each point covers about 0.3 seconds; on a 60-second one, about 0.6.
  • audienceWatchRatio: the absolute ratio of viewers watching at that point, comparing how many times that part was watched with the total views. It can go above 1 when people rewatch. Google's example: if 20% of viewers rewatch a segment, its value can be 1.2.
  • relativeRetentionPerformance: how well the video retains viewers compared with YouTube videos of similar length, from 0 to 1. Zero means worse than any similar-length video, 1 means better than all of them, and 0.5 is the median.
  • startedWatching and stoppedWatching: how many times that segment was the first (or the last) one seen in a playback.
  • totalSegmentImpressions: how many times that segment was viewed.

On a Short, an audienceWatchRatio above 1 near the end tells you people watched again. relativeRetentionPerformance answers a different question: whether your Short holds attention better or worse than others of similar length.

Video totals come from the same method without the dimension: averageViewDuration (average playback length in seconds) and averageViewPercentage (average percentage watched). Per the metrics page, both have excluded looping clips traffic since December 13, 2021.

Scopes: read two official pages side by side

Every YouTube Analytics API request must be authorized with OAuth 2.0. The authorization guide says API keys alone don't work, and service accounts only work for content owners, never as a channel.

On the scope itself, compare two pages:

  • The authorization guide says yt-analytics.readonly ("View YouTube Analytics reports for your YouTube content") grants read access to non-monetary reports. So do youtube.readonly, youtube and youtubepartner.
  • The reports.query reference carries a notice: "API requests to this method now require access to the https://www.googleapis.com/auth/youtube.readonly scope". The revision history logs the same requirement on June 18, 2018.

Praeko requests yt-analytics.readonly together with its publishing scopes (youtube.upload and youtube.force-ssl). If you build your own integration, test the query with the exact scope set you plan to request before you ship.

What about Shorts?

The retention report and metrics pages don't mention Shorts. The report takes a video ID, a Short has an ID like any other video, and the docs describe no special handling.

What the docs do say about Shorts lives elsewhere:

  • The creatorContentType dimension identifies the content type, with SHORTS meaning "The viewed content was a YouTube Short". Data starts January 1, 2019. The retention report table does not list it as a dimension.
  • YouTube changed how Shorts views are counted on March 31, 2025, and the revision history says the change took effect in the YouTube Analytics API on April 30, 2025: Shorts views count every time a Short starts to play or replay. The engagedViews metric was added to keep the previous counting method. That changes the denominator of anything you compute from views.

How Praeko returns retention

When you connect YouTube to Praeko, the same consent screen already asks for yt-analytics.readonly. Channels connected before that scope was added show reauthorize and need to reconnect once.

Without you writing the query, Praeko:

  • Requests the curve of each video published in the last 120 days, with audienceType==ORGANIC, plus the totals (views, estimatedMinutesWatched, averageViewDuration, averageViewPercentage).
  • Waits 36 hours after publishing before the first try. If YouTube has no data yet, it tries again every 12 hours. Once the curve is ready, it re-reads every 3 days until the video is 14 days old, then every 7 days.
  • Stores the result. The routes read that copy, so your calls don't spend YouTube queries.
  • Returns a missing number as null, never 0, with the reason in retention.message.

Two API routes (details in Metrics, retention and CTR):

  • GET /v1/insights/retention lists the posts of a period with avgViewPercentage, avgWatchTimeSec, watchTimeMin, impressions, ctr and the retention state of each one. Thumbnail impressions and CTR come from a different Google API, the YouTube Reporting API.
  • GET /v1/insights/:item/retention returns the curve of one post: position (0 to 1), watched (the audienceWatchRatio) and relative (the relativeRetentionPerformance). More on the curve.
bash
curl "https://praeko.app/v1/insights/retention?from=2026-11-01T00:00:00Z&limit=50" \
  -H "Authorization: Bearer $PRAEKO_KEY"

channels[].state tells you whether each account can deliver the data: ready, pending (the first report is still being generated), reauthorize, unavailable or error.

From an AI agent (Claude Code, Codex, Cursor), the get_retention tool on the Praeko MCP server calls that list route. The agent reads percentage watched, average watch time, impressions and CTR for each post in the period, and uses them to propose the next script. In the Praeko dashboard, the same table and the curve live under Insights, on the Analytics tab.

Summary

  • Report: Audience retention. Dimension elapsedVideoTimeRatio (100 points), video filter with a single ID.
  • Metrics: audienceWatchRatio (can exceed 1), relativeRetentionPerformance (0 to 1, median 0.5), plus startedWatching, stoppedWatching and totalSegmentImpressions.
  • Scope: read the authorization guide and the reports.query notice together, then test with your own token.
  • Shorts: the report doesn't treat them separately; creatorContentType and the 2025 change to views are what's different.
  • With Praeko: GET /v1/insights/retention, GET /v1/insights/:item/retention and get_retention over MCP.

Sources

  1. YouTube Analytics API: Channel Reports (Audience retention) (accessed )
  2. YouTube Analytics API: Metrics (accessed )
  3. YouTube Analytics API: Dimensions (accessed )
  4. YouTube Analytics API: Reports: query (accessed )
  5. YouTube Analytics and Reporting APIs: Authorization (accessed )
  6. YouTube Analytics and Reporting APIs: Revision History (accessed )
  7. YouTube Help: Measure key moments for audience retention (accessed )
  8. Praeko Docs: Metrics, retention and CTR (accessed )
  9. Praeko Docs: MCP server (accessed )
Question or mistake on this page? contato@praeko.appView .md

← All articles