Analytics
Get top posts
Cached top posts with full metrics and time-limited media URLs, sortable including outlier sorts that surface posts that over-performed the account's own baseline.
/api/public/analytics/top-postscurl "https://postiv.ai/api/public/analytics/top-posts?accountId=all&limit=10&sort=date" \
-H "Authorization: Bearer pk_postiv_..."{
"success": true,
"posts": [
{
"id": "ap1...",
"hook": "I lost my biggest client...",
"postUrl": "https://linkedin.com/...",
"mediaType": "text",
"isLeadMagnet": false,
"mediaUrls": [],
"metrics": {
"impressions": 12400,
"engagements": 640,
"engagementRate": 5.2
},
"outliers": {
"engagementMultiplier": 2.1
}
}
]
}Authorization
Requires an organization API key with the analytics:read scope, sent as Authorization: Bearer or x-api-key.
Query parameters
accountIduuid|'all'requiredAlias: account_id.
limitintdefault: 251-100.
sortstringdefault: "date"dateengagementsimpressionsengagement_outlierreach_outliertype_outliertype_reach_outlierperiodintTrailing days, 1-365. Default is all-time (no filter) if omitted and no start/end.
startstringendstringResponse
Top posts with metrics and outlier scores.
posts[].iduuidposts[].hook / postUrl / linkedinUrn / createdAt / mediaType / category / isLeadMagnet / lastFetchedAtmixedposts[].mediaUrlsstring[]Refreshed signed URLs.
posts[].metricsobject{ impressions, engagements, engagementRate, reactions, comments, reshares, membersReached, postSaves, postSends, linkClicks, premiumCtaClicks, followersGainedFromContent, profileViewsFromContent, videoPlays, videoWatchTime, videoViewers }
posts[].outliersobject{ weightedEngagementScore, impressionsMultiplier, engagementMultiplier, mediaTypeImpressionsMultiplier, mediaTypeEngagementMultiplier, calculatedAt, overallBaselineSampleSize, mediaTypeBaselineSampleSize }
posts[].metadataobject{ postText, postLink }
Errors
| 400 | missing_account_id |
| 404 | analytics_account_not_found |
Good to know
- Rows with no analytics id AND all-null impressions/engagements (queue-only, never imported) are filtered out: this only ranks posts that actually have analytics.