X link clicks in the PubNio analytics API

X lists link clicks (url_link_clicks) and profile visits (user_profile_clicks) as non-public metrics. PubNio reads them only for posts up to 30 days old. After that they return unsupported with reason non_public_metrics_expired, even when earlier reads stored a value; if X refuses the fields, PubNio rereads public counts only. Provider facts checked 2026-12-05.

X (Twitter): LiveView as Markdown

What PubNio returns

MetricScopeX fieldUnitCombines by
link_clicksposturl_link_clicks (non-public; posts up to 30 days old only)countsum
link_clicksaccountsum of posts' url_link_clicks (non-public)countsum
profile_visitspostuser_profile_clicks (non-public; posts up to 30 days old only)countsum
profile_visitsaccountsum of posts' user_profile_clicks (non-public)countsum

link_clicks: Outbound or website link clicks.

profile_visits: Profile visits attributed to the post or account.

How PubNio reads it

  • X's reference says “Non-public, organic, and promoted metrics are only available for posts created within the last 30 days.” PubNio's adapter uses the same 30 days: after it, the read asks for public fields only and marks both metrics expired.
  • A value stored while the post was inside the 30 days is not returned afterwards: the stored expired marker takes precedence over the stored number, so the API answers unsupported with a null value.
  • The retry happens once, only when X answers the first read with an invalid-request or permission error, and then the reason is non_public_metrics_unavailable. Public counts (impressions, likes, replies, reposts, quotes, bookmarks) keep updating for the whole post window.
  • Account link clicks add the url_link_clicks of each post created in the range that carries one; a post without the non-public count adds nothing.

Example

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

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

Limits

  • An account link_clicks total is the last daily read's value for its window, 30 days before the read through the day of the read, whatever from and to the request names. Per-day values come from the daily series, which the workspace plan bounds.
  • A metric X 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.

Sources