Zernio
APIFor you
Zernio
APIFor you
API Reference

Posting Analytics

Cross-platform

Get post analyticsGETAnalytics changed since a cursorGETSync an external postPOSTGet post analytics timelineGETGet daily aggregated metricsGETGet best times to postGETGet content performance decayGETGet frequency vs engagementGETGet follower statsGET

Instagram

Get Instagram insightsGETGet Instagram follower historyGETGet Instagram demographicsGET

YouTube

Get YouTube channel insightsGETGet YouTube daily viewsGETGet YouTube video retention curveGETGet YouTube demographicsGET

LinkedIn

Get LinkedIn aggregate statsGETGet LinkedIn org analyticsGETGet LinkedIn post statsGETGet LinkedIn post reactionsGET

Facebook

Get Facebook Page insightsGETGet Facebook post reactionsGETGet Facebook post monetization earningsGET

TikTok

Get TikTok account-level insightsGET

Google Business

Get Google Business Profile performance metricsGETGet Google Business Profile search keywordsGET

Other

Get an analytics dashboardGETGet Facebook Page demographicsGETList Google Analytics (GA4) dimensions and metricsGETGet Instagram online followersGETGet LinkedIn organization follower demographicsGETList the posts a Facebook Page is tagged inGETList visitor posts on a Facebook PageGETRun a Google Analytics (GA4) realtime reportPOSTRun a Google Analytics (GA4) reportPOST
Dashboard
OverviewPlatformsAPI ReferenceResources
Posting Analytics

Run a Google Analytics (GA4) realtime report

Activity on a connected GA4 property in the last 30 minutes (up to 60 for Analytics 360), through Google's runRealtimeReport. Not cached. Only realtime dimensions and metrics are accepted, e.g. country, unifiedScreenName with activeUsers.


POST
/v1/analytics/googleanalytics/realtime

Authorization

bearerAuth
AuthorizationBearer <token>

API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.analytics.runGoogleAnalyticsRealtimeReport({  body: {    accountId: 'account_abc123',    metrics: [      'sessions',      'activeUsers',    ],    minuteRanges: [      {        startMinutesAgo: 0,        endMinutesAgo: 0,        name: 'Example',      },    ],  },});console.log(data);
{  "accountId": "string",  "propertyId": "string",  "dimensionHeaders": [    {      "name": "string"    }  ],  "metricHeaders": [    {      "name": "string",      "type": "string"    }  ],  "rows": [    {      "dimensionValues": [        {          "value": "string"        }      ],      "metricValues": [        {          "value": "string"        }      ]    }  ],  "rowCount": 0,  "metadata": {},  "propertyQuota": {}}
Was this page helpful?

List visitor posts on a Facebook Page

Returns the posts other people published on the connected Facebook Page, newest first. Zernio reads the Page feed (Graph `/{page-id}/feed`, which works on New Pages Experience Pages, unlike the deprecated `visitor_posts` edge) and drops the posts the Page published itself and the posts other people published on their own timeline that only tag the Page. A Page without visitor posts returns an empty `data` array. Cursor-paginated: pass `nextCursor` from the previous response as `cursor` to read the next page. `limit` sets how many feed entries are scanned, so a page can hold fewer posts than `limit`, or none, while `nextCursor` is not null. `nextCursor` is null when there are no more pages, and the final page can come back empty. Works on `facebook` accounts with a Page selected. Meta requires the `pages_read_user_content` permission, which Zernio requests with the comments scope: an account connected without it receives Meta's refusal as `platform_api_error`.

Run a Google Analytics (GA4) report

Runs a report on a connected GA4 property through Google's Data API (`runReport`). Pick any GA4 dimensions and metrics; filters and ordering use Google's own shapes. Identical requests on the same property are cached for 10 minutes. Google meters each property by quota tokens; when it is used up the request returns 429 until Google refills it (hourly quotas within the hour, daily ones at midnight Pacific time).

accountId*string

Zernio account ID of the Google Analytics connection (platform googleanalytics).

dimensions?array<string>

GA4 dimension API names, e.g. date, sessionSource, pagePath. List them with GET /v1/analytics/googleanalytics/metadata.

Itemsitems <= 9
metrics*array<string>

GA4 metric API names, e.g. sessions, activeUsers, keyEvents, totalRevenue.

Items1 <= items <= 10
dimensionFilter?

A Google FilterExpression on dimensions, in Google's own shape.

metricFilter?

A Google FilterExpression on metrics, in Google's own shape.

orderBys?array<>

Google OrderBy objects, e.g. { "metric": { "metricName": "sessions" }, "desc": true }.

Itemsitems <= 10
limit?integer

Rows to return. Defaults to Google's default (10000).

Range1 <= value <= 10000
minuteRanges?array<>
Items1 <= items <= 2