YouTube follows in the PubNio analytics API

For a YouTube video, follows is subscribersGained from a report filtered to that video. For the channel, PubNio reads subscribersGained as follower_gained and subscribersLost as follower_lost, and followers is the channel's subscriberCount. Channel follows is not declared at all.

YouTube: LiveView as Markdown

What PubNio returns

MetricScopeYouTube fieldUnitCombines by
followspostsubscribersGainedcountsum
followsaccountnot declaredcountsum
follower_gainedaccountsubscribersGainedcountsum
follower_lostaccountsubscribersLostcountsum
followersaccountsubscriberCountcountlatest

follows: New follows attributed to the post or gained in the period.

follower_gained: Followers gained in the period.

follower_lost: Followers lost in the period.

followers: Current follower or subscriber count; a stock, never summed.

How PubNio reads it

  • The subscriber count is parsed from the Data API response, which may send it as a string; a value that is not a finite number is dropped rather than stored.
  • An account metric missing from the capability list, such as channel follows, is not refused: the API returns it pending with reason account_analytics_pending. The account sync reads only supported metrics, so it stays pending.

Example

The capabilities endpoint answers without calling YouTube. Under the YouTube provider, these are its entries for follows.

request.http
GET /api/v1/workspaces/4e5f6a7b-8c9d-4e0f-9a1b-2c3d4e5f6a7b/analytics/capabilities
Authorization: Bearer pn_live_***
response-excerpt-youtube-metrics.json
[
  {
    "key": "follows",
    "scope": "post",
    "granularity": "day",
    "unit": "count",
    "aggregation": "sum",
    "availability": "available",
    "supported": true,
    "renamedFrom": "subscribersGained"
  }
]

Limits

  • PubNio stops re-reading a YouTube post 366 days after it is published, so a post's follows stops changing then.
  • A metric YouTube does not report comes back with value: null and an availability state that says why. A post with no stored values whose last read failed on permissions, a rate limit, or a transient error answers with that error instead.