Analytics

Get YouTube daily views

Changed on

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; 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

Request

Query parameters

videoIdstring required

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

accountIdstring required

The Zernio account ID for the YouTube account

fromDatestring date

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

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); days YouTube has not processed yet are omitted from dailyViews.

startDatestring date

Alias of fromDate, kept for existing callers

endDatestring date

Alias of toDate, kept for existing callers

Response

Daily views breakdown

successboolean
videoIdstring

The YouTube video ID

durationSecondsinteger nullable

Video length in seconds (from YouTube contentDetails.duration)

provisionalSincestring date

Present only when the range reaches into YouTube's ~3-day processing window: the first date whose numbers are provisional and may still be revised by YouTube.

totalViewsinteger

Sum of views across all days in the range

staleboolean

Present and true when YouTube refused the refresh (the Analytics quota or its rate limit) and the response serves the days Zernio already stored, so some days may be missing; lastSyncedAt says how old they are. Retry later for a full refresh.

lastSyncedAtstring date-time nullable

When the data was last synced from YouTube

Example response

{
  "success": true
}

Changes

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status