Get post 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.
API key authentication - use your Zernio API key as a Bearer token
In: header
Query Parameters
Returns analytics for a single post. Accepts both Zernio Post IDs and External Post IDs. Zernio IDs are auto-resolved to External Post analytics.
Filter by platform (default "all")
Filter by profile ID (default "all")
Filter by post source: late (posted via Zernio API), external (synced from platform), all (default)
"all""all" | "late" | "external"Inclusive lower bound (YYYY-MM-DD). Defaults to 90 days ago if omitted. Max range is 366 days.
dateInclusive upper bound (YYYY-MM-DD). Defaults to today if omitted.
datePage size (default 50)
501 <= value <= 100Page number (default 1)
11 <= valueSort by date, engagement, or a specific metric
"date""date" | "engagement" | "impressions" | "reach" | "likes" | "comments" | "shares" | "saves" | "clicks" | "views"Sort order
"desc""asc" | "desc"Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://zernio.com/api/v1/analytics"{
"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",
"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"
}
]
}{
"postId": "string",
"latePostId": "string",
"status": "published",
"content": "string",
"scheduledFor": "2019-08-24T14:15:22Z",
"publishedAt": "2019-08-24T14:15:22Z",
"analytics": {
"impressions": 0,
"reach": 0,
"likes": 0,
"comments": 0,
"shares": 0,
"saves": 0,
"clicks": 0,
"views": 0,
"engagementRate": 0,
"lastUpdated": "2019-08-24T14:15:22Z"
},
"platformAnalytics": [
{
"platform": "string",
"status": "published",
"accountId": "string",
"accountUsername": "string",
"analytics": {
"impressions": 0,
"reach": 0,
"likes": 0,
"comments": 0,
"shares": 0,
"saves": 0,
"clicks": 0,
"views": 0,
"engagementRate": 0,
"lastUpdated": "2019-08-24T14:15:22Z"
},
"syncStatus": "synced",
"platformPostUrl": "http://example.com",
"errorMessage": "string"
}
],
"platform": "string",
"platformPostUrl": "http://example.com",
"isExternal": true,
"syncStatus": "synced",
"message": "string",
"thumbnailUrl": "http://example.com",
"mediaType": "image",
"mediaItems": [
{
"type": "image",
"url": "http://example.com",
"thumbnail": "http://example.com"
}
]
}{
"error": "Invalid query parameters",
"details": {}
}{
"error": "Unauthorized"
}{
"error": "Analytics add-on required",
"code": "analytics_addon_required"
}{
"error": "Not found"
}{
"postId": "string",
"latePostId": "string",
"status": "published",
"content": "string",
"scheduledFor": "2019-08-24T14:15:22Z",
"publishedAt": "2019-08-24T14:15:22Z",
"analytics": {
"impressions": 0,
"reach": 0,
"likes": 0,
"comments": 0,
"shares": 0,
"saves": 0,
"clicks": 0,
"views": 0,
"engagementRate": 0,
"lastUpdated": "2019-08-24T14:15:22Z"
},
"platformAnalytics": [
{
"platform": "string",
"status": "published",
"accountId": "string",
"accountUsername": "string",
"analytics": {
"impressions": 0,
"reach": 0,
"likes": 0,
"comments": 0,
"shares": 0,
"saves": 0,
"clicks": 0,
"views": 0,
"engagementRate": 0,
"lastUpdated": "2019-08-24T14:15:22Z"
},
"syncStatus": "synced",
"platformPostUrl": "http://example.com",
"errorMessage": "string"
}
],
"platform": "string",
"platformPostUrl": "http://example.com",
"isExternal": true,
"syncStatus": "synced",
"message": "string",
"thumbnailUrl": "http://example.com",
"mediaType": "image",
"mediaItems": [
{
"type": "image",
"url": "http://example.com",
"thumbnail": "http://example.com"
}
]
}{
"error": "string",
"details": {}
}Connect WhatsApp via credentials POST
Connect a WhatsApp Business Account by providing Meta credentials directly. This is the headless alternative to the Embedded Signup browser flow. To get the required credentials: 1. Go to Meta Business Suite (business.facebook.com) 2. Create or select a WhatsApp Business Account 3. In Business Settings > System Users, create a System User 4. Assign it the `whatsapp_business_management` and `whatsapp_business_messaging` permissions 5. Generate a permanent access token 6. Get the WABA ID from WhatsApp Manager > Account Tools > Phone Numbers 7. Get the Phone Number ID from the same page (click on the number)
Get best times to post GET
Returns the best times to post based on historical engagement data. Groups all published posts by day of week and hour (UTC), calculating average engagement per slot. Use this to auto-schedule posts at optimal times. Requires the Analytics add-on.