OverviewProductsPlatformsAPI ReferenceResources
Posting Analytics

Get post analytics

GEThttps://zernio.com/api/v1/analytics

Returns analytics for posts. With postId, returns a single post. Without it, returns a paginated list with overview stats.

  • Accepts both Zernio Post IDs and External Post IDs (auto-resolved).
  • fromDate defaults to 90 days ago if omitted, max range 366 days.
  • Single post lookups may return 202 (sync pending) or 424 (all platforms failed).
  • For follower stats, use /v1/accounts/follower-stats.
  • Accounts creators connected to your creator campaigns are left out, here and in every other analytics, follower-stats, account health, inbox and external posts read, unless the request names their profileId or accountId.

Authentication

AuthorizationBearer tokenRequired

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

Query parameters

Optional
postIdstring

Returns analytics for a single post. Accepts Zernio Post IDs, External Post IDs and the platform's native post ID. Zernio IDs are auto-resolved to External Post analytics.

platformstring

Filter by platform (default "all")

profileIdstring

Filter by profile ID (default "all"). With a native postId, selects that profile's copy of the post.

accountIdstring

Filter by account ID. With a native postId, selects that account's copy of the post.

sourcestringDefault allOne of all | late | external

Filter by post source: late (posted via Zernio API), external (synced from platform), all (default)

fromDatestring (date)

Inclusive lower bound (YYYY-MM-DD). Defaults to 90 days ago if omitted. Max range is 366 days.

toDatestring (date)

Inclusive upper bound (YYYY-MM-DD). Defaults to today if omitted.

limitintegerDefault 50

Page size (default 50)

pageintegerDefault 1

Page number (default 1)

sortBystringDefault dateOne of date | engagement | impressions | reach | likes | comments | shares | saves | clicks | views | follows | ig_reels_avg_watch_time | ig_reels_video_view_total_time | reposts | reels_skip_rate | completion_rate | profile_views | website_clicks

Sort by date, engagement, or a specific metric. Platform-specific metrics (follows, reposts, reels_skip_rate, ig_reels_*, completion_rate, profile_views, website_clicks) sort a null value as 0.

orderstringDefault descOne of asc | desc

Sort order

tagsstring

Comma-separated tags (at most 20). Lists only posts created through Zernio that carry every listed tag, matched exactly and case-sensitively. Up to 200 published posts can match within the date range; more returns 400 asking to narrow fromDate and toDate. Ignored when postId is set.

viewstringDefault fullOne of full | summary

full returns the listing as before. summary leaves out the accounts list, each platform entry's copy of analytics, the impressionSources, audienceTypes, audienceCountries and retentionCurve maps, and mediaItems (thumbnailUrl stays). Ignored when postId is set.

Responses

Success· the request worked

Errors· the request failed

How it behaves

LinkedIn personal accounts

Analytics are only available for posts published through Zernio. LinkedIn's API only returns metrics for posts authored by the authenticated user. Organization/company page analytics work for all posts.

Facebook Page stories

Stories on a connected Page, published through Zernio or natively, are collected while they are live and returned like any other post (platformPostUrl points to the story). Metrics for a story published through Zernio are available on its Zernio post ID.

Their lifetime metrics refresh about hourly, with a final reading shortly before the story expires at 24 hours. After that the values stay at that last reading.

Mapping:

  • impressions = story media views (Meta stopped accepting per-story impressions in October 2026, so impressions equals views)
  • reach = unique story media viewers
  • views = story media views
  • likes = story reactions
  • comments = story replies
  • shares = story shares
  • clicks: always 0, because Meta exposes no link-click metric for stories

Upload a file

Either `multipart/form-data` with the file under `file` plus `accountId`, `name` (defaults to the file name) and `parentId`, or JSON with a public `url` the file is fetched from (100 MB cap). Large files go through the provider's resumable upload.

Analytics changed since a cursor

Cursor feed of the analytics snapshots that CHANGED, across every account you can read, in one paginated stream. Built for integrations that would otherwise call `GET /v1/analytics` once per connected account. Each page carries changes from many accounts at once, so your call count scales with how much actually changed rather than with how many accounts you have. Measured against a fleet of roughly 1,600 connected accounts: about 1,599 per-account analytics calls an hour became about 205 delta calls an hour, a 7.8x reduction. ### Bootstrap once, then stay in sync 1. Take the cursor FIRST: call this endpoint with NO `cursor`. It answers with an empty `data` array plus the feed's current position in `nextCursor`. 2. Load your baseline from `GET /v1/analytics`, the historical endpoint. This one is a rolling 7-day change log and cannot replay history. 3. Resume from the cursor you took before the baseline. Taking the cursor afterwards instead drops every change that lands while the baseline is loading: it is in neither the row you already read nor the feed you resume behind it. The overlap this order creates is safe. Metrics are absolute values rather than increments, so draining it leaves every post on its newest value. `nextCursor` is present on every response, empty pages included, so you always have something to advance with. ### Ordering Entries come back oldest first, in the order the feed received them. That order is NOT `syncedAt`. `syncedAt` is stamped when an account's sync cycle started, and a slow cycle writes its rows after a faster cycle that started later, so `syncedAt` can go backwards between consecutive entries. Do not sort, filter or resume on `syncedAt`. The cursor is the only stable position, and it is opaque: pass it back verbatim, and do not parse, construct or compare cursors. ### `hasMore: false` does not mean the feed ended This stream has no end and `nextCursor` is never null. - `hasMore: true`: more changes are already waiting, so call again straight away. - `hasMore: false`: you are caught up. Keep the cursor and poll again on your normal interval. ### The newest changes settle before they are served The feed deliberately holds back its last few seconds of writes, so that a row can never become visible behind a cursor you have already advanced past. A read issued the instant an `analytics.synced` webhook lands will therefore often return an empty page for that account. Do not read an empty page as "nothing changed": poll again with the SAME cursor you last used rather than advancing. ### Repeats inside one instant A sync cycle occasionally records the same post twice at the same feed position. When that happens the feed delivers one of those rows, not both. Measured over a day of production traffic, about 1.3% of rows fall in such a group and 99.4% of those groups are identical rows, so this is far more often deduplication than loss. Metrics are absolute values rather than increments, so a later entry for the same post supersedes an earlier one. ### Retention is 7 days Changes older than that leave the feed. A cursor older than 6 days is rejected with a `400` (a day of margin, because expiry is lazy). Recover the same way you bootstrapped: 1. Take a fresh cursor from a call to this endpoint with no `cursor`. 2. Re-load from `GET /v1/analytics`. 3. Resume from that cursor. A consumer that polls at least daily never reaches this. ### Webhook and access Pairs with the `analytics.synced` webhook, so changes can be read on notification instead of on a timer. That event carries no cursor of its own: keep using the `nextCursor` this endpoint gave you. Requires the same analytics access as `GET /v1/analytics`, and shares the stricter per-second rate-limit window applied to analytics endpoints.

GET/v1/analytics
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.analytics.getAnalytics();console.log(data);
{  "postId": "65f1c0a9e2b5af0012ab34cd",  "latePostId": null,  "status": "published",  "content": "Check out our new product launch!",  "scheduledFor": "2024-11-01T10:00:00Z",  "publishedAt": "2024-11-01T10:00:05Z",  "analytics": {    "impressions": 15420,    "reach": 12350,    "likes": 342,    "comments": 28,    "shares": 45,    "saves": 0,    "clicks": 189,    "views": 0,    "engagementRate": 2.78,    "lastUpdated": "2024-11-02T08:30:00Z"  },  "platformAnalytics": [    {      "platform": "twitter",      "status": "published",      "platformPostId": "123456789",      "accountId": "64e1f0a9e2b5af0012ab34cd",      "accountUsername": "@acmecorp",      "analytics": {        "impressions": 15420,        "reach": 12350,        "likes": 342,        "comments": 28,        "shares": 45,        "saves": 0,        "clicks": 189,        "views": 0,        "engagementRate": 2.78,        "lastUpdated": "2024-11-02T08:30:00Z"      },      "syncStatus": "synced",      "platformPostUrl": "https://twitter.com/acmecorp/status/123456789",      "errorMessage": null    }  ],  "platform": "twitter",  "platformPostUrl": "https://twitter.com/acmecorp/status/123456789",  "isExternal": false,  "syncStatus": "synced",  "message": null,  "thumbnailUrl": "https://storage.example.com/image.jpg",  "mediaType": "image",  "mediaItems": [    {      "type": "image",      "url": "https://storage.example.com/image.jpg",      "thumbnail": "https://storage.example.com/image.jpg"    }  ]}
OpenAPI specification
Was this page helpful?