Sync an external 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.
API key authentication - use your Zernio API key as a Bearer token
In: header
SocialAccount ID whose posts to sync. Must be connected to Zernio.
The post URL to locate. Optional. Provide url or postId to return a specific post; omit both to just refresh and return the account's recent posts.
The platform post/media/video id to locate, as an alternative to url. Optional.
Response Body
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.syncExternalPosts({ body: { accountId: 'account_abc123', },});console.log(data);{
"synced": {
"postsFound": 0,
"postsSynced": 0,
"skipped": true
},
"found": true,
"post": {
"platform": "string",
"platformPostId": "string",
"platformPostUrl": "string",
"content": "string",
"publishedAt": "2019-08-24T14:15:22Z",
"mediaType": "string",
"mediaUrl": "string",
"thumbnailUrl": "string",
"mediaItems": [
{}
],
"analytics": {
"likes": 0,
"comments": 0,
"shares": 0,
"saves": 0,
"sends": 0,
"clicks": 0,
"views": 0,
"reach": 0,
"impressions": 0,
"engagementRate": 0,
"lastUpdated": "2019-08-24T14:15:22Z"
}
},
"posts": [
{
"platform": "string",
"platformPostId": "string",
"platformPostUrl": "string",
"content": "string",
"publishedAt": "2019-08-24T14:15:22Z",
"mediaType": "string",
"mediaUrl": "string",
"thumbnailUrl": "string",
"mediaItems": [
{}
],
"analytics": {
"likes": 0,
"comments": 0,
"shares": 0,
"saves": 0,
"sends": 0,
"clicks": 0,
"views": 0,
"reach": 0,
"impressions": 0,
"engagementRate": 0,
"lastUpdated": "2019-08-24T14:15:22Z"
}
}
]
}{
"error": "string",
"type": "invalid_request_error",
"code": "string",
"param": "string",
"platform": "string",
"platformError": {},
"details": {}
}{
"error": "string",
"type": "invalid_request_error",
"code": "string",
"param": "string",
"platform": "string",
"platformError": {},
"details": {}
}Get post analytics GET
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. 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.
Get post analytics timeline GET
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.