Analytics

Get Facebook Page insights

Changed on

Returns page-level Facebook insights (media views, views, post engagements, video metrics, follower counts). The response shape matches /v1/analytics/instagram/account-insights, so the same client handling works across platforms.

Max 89 days, defaults to last 30 days.

Metric names

Metric names track the current (post-November 2025) Meta Graph API. These legacy metrics were deprecated by Meta on November 15, 2025 and are NOT accepted by this endpoint:

  • page_impressions
  • page_fans
  • page_fan_adds
  • page_fan_removes

Use the replacements below. Because Meta did not provide direct adds/removes replacements, Zernio synthesizes followers_gained / followers_lost from the daily follower snapshotter.

get/v1/analytics/facebook/page-insights

Request

  • Base URL
    https://zernio.com/api
  • URL
    https://zernio.com/api/v1/analytics/facebook/page-insights
  • Auth
    HTTP bearer

Query parameters

accountIdstring required

The Zernio SocialAccount ID for the connected Facebook Page.

metricsstring

Comma-separated list of metrics. Defaults to "page_media_view,page_post_engagements,page_follows,followers_gained,followers_lost".

Live Meta metrics (current names, post-Nov-2025):

  • page_media_view (replaces deprecated page_impressions)
  • page_views_total
  • page_post_engagements
  • page_video_views
  • page_video_view_time
  • page_follows (replaces deprecated page_fans)

Zernio-synthesized from daily follower snapshots (filling the Nov-2025 gap left by the page_fan_adds / page_fan_removes deprecation):

  • followers_gained
  • followers_lost

Monetization (opt-in, not in the defaults):

  • content_monetization_earnings: an object per day, always with unit "micro_amount" and an ISO 4217 "currency".
  • monetization_approximate_earnings: a bare number per day; unit is always "unspecified" and "currency" always null.

Each monetization metric costs its own Graph call, so requesting both adds two calls. Values are approximate and Meta restates them later. The two are on different scales and not comparable. Both keep daily "values" on every metricType and are never rescaled by Zernio.

Earnings are Page-level daily buckets and "total" is their sum. Meta does not document whether a bucket is that day's earnings or a running total, and every Page measured so far earned exactly 0.

Reconcile "total" against the Page's Meta export before relying on it (daily "values" are always returned for this).

Per-post lifetime earnings: GET /v1/analytics/facebook/post-earnings.

A Page not enrolled in monetization, or that earned nothing, returns normal daily buckets of 0 in "metrics" (Meta does not distinguish them), so a 0 total does NOT mean the Page is enrolled.

"unavailableMetrics" covers the narrower case where Meta returned no bucket at all ("no_data") or rejected the request; the metric is then omitted from "metrics" rather than reported as 0.

fromDatestring date

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

toDatestring date

End date (YYYY-MM-DD). Defaults to today.

sincestring date

Alias of fromDate, kept for existing callers

untilstring date

Alias of toDate, kept for existing callers

metricType'time_series' | 'total_value'

"total_value" (default) returns aggregated totals only. "time_series" returns daily values in the "values" array.

Response

Page insights data

successboolean
accountIdstring

The Zernio SocialAccount ID

platform'facebook' | 'instagram' | 'youtube' | 'linkedin' | 'tiktok'

Platform that served this response.

metricType'time_series' | 'total_value'
breakdownstring

Breakdown dimension used (only present when breakdown was requested)

metricsobject

Object keyed by metric name.

  • For time_series: each metric has "total" (number) and "values" (array of {date, value}).
  • For total_value: each metric has "total" (number) and optionally "breakdowns" (array of {dimension, value}).

Monetary metrics also carry "unit" and "currency". Zernio never rescales money: "total" and every "values[].value" are the platform's raw numbers in the stated unit.

Monetary metrics keep "values" even on metricType=total_value, because their "total" is the sum of the daily buckets the platform returned over the range. Keep the series to reconcile that sum against the platform's own reporting before invoicing on it.

A metric that could not be served is absent from this object and listed in "unavailableMetrics" instead, so an unavailable metric is never reported as a zero.

dataDelaystring

Example response

{
  "success": true,
  "dataDelay": "Data may be delayed up to 48 hours"
}

Changes

    • warning

      added the new account enum value to the / response property for the response 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