Get post analytics timeline
Returns a daily timeline of analytics metrics for a specific post, showing how impressions, likes, and other metrics evolved day-by-day since publishing. Each row represents one day of data per platform. For multi-platform Zernio posts, returns separate rows for each platform. Requires the Analytics add-on.
API key authentication - use your Zernio API key as a Bearer token
In: header
Query Parameters
The post to fetch timeline for. Accepts an ExternalPost ID, a platformPostId, or a Zernio Post ID.
Start of date range (ISO 8601). Defaults to 90 days ago.
date-timeEnd of date range (ISO 8601). Defaults to now.
date-timeResponse Body
application/json
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.getPostTimeline({ query: { postId: 'post_abc123', },});console.log(data);{
"postId": "6507a1b2c3d4e5f6a7b8c9d0",
"timeline": [
{
"date": "2025-01-15",
"platform": "instagram",
"platformPostId": "17902345678901234",
"impressions": 1200,
"reach": 980,
"likes": 45,
"comments": 3,
"shares": 12,
"saves": 8,
"clicks": 25,
"views": 0
},
{
"date": "2025-01-16",
"platform": "instagram",
"platformPostId": "17902345678901234",
"impressions": 2400,
"reach": 1850,
"likes": 92,
"comments": 7,
"shares": 21,
"saves": 15,
"clicks": 48,
"views": 0
}
]
}{
"error": "Missing required parameter: postId"
}{
"error": "Unauthorized"
}{
"error": "Analytics add-on required",
"code": "analytics_addon_required"
}{
"error": "Forbidden"
}{
"error": "Post not found"
}Sync an external post POST
Fetch an account's latest external posts (published directly on the platform, not through Zernio) on demand, so a just-published post is retrievable within seconds instead of waiting for the background sync (which refreshes each account at most every ~90 minutes). Primary use case: verifying a submitted post. When a user publishes on the platform and immediately pastes the post URL into your app, call this with `accountId` plus `url` (or `postId`) to confirm the post exists and return its metadata. Behavior: - We check our stored copy first and return immediately if the post is already known (no platform call). - Otherwise we fetch the account's latest posts live from the platform, then match and return the submitted post. - Requests are debounced per account (~15s): if the account was just synced, the live fetch is skipped. `accountId` is required — a post URL or id alone cannot be resolved to an account, and the account must be connected to Zernio (we use its token to read the platform). Supported for every platform with a listing API (Instagram, Facebook, TikTok, YouTube, X, Threads, Pinterest, Reddit, Bluesky, Google Business, and LinkedIn organization accounts; LinkedIn personal accounts are not supported). `url` accepts any format the platform uses (e.g. `instagram.com/p/…`, `instagram.com/reel/…`, `youtu.be/…`, `youtube.com/shorts/…`, `tiktok.com/@user/video/…`, and `vm.tiktok.com` short links). Pass `postId` (the platform media/video id) as an alternative locator. Note: post-level analytics (reach, impressions) still carry the platform's own delay (e.g. ~24h on Instagram). This endpoint confirms the post exists and returns its metadata plus basic engagement (likes, comments), not delayed insights.
Get daily aggregated metrics GET
Returns daily aggregated analytics metrics and a per-platform breakdown. Each day includes post count, platform distribution, and summed metrics (impressions, reach, likes, comments, shares, saves, clicks, views). Defaults to the last 180 days. Requires the Analytics add-on.