Analytics
Get Daily Analytics Timeline
Returns daily cumulative metrics for each post destination. Covers the last 90 days by default.
x-api-key<token>Workspace API key, sent in the x-api-key header. Keys start with op_ and are created in the dashboard.
post?stringOnepostly post id or platform-native post id. Native ids also need accountId. You can omit it when you pass destinationId.
1 <= lengthaccountId?stringConnection id. Required with a platform-native post id, and picks the destination when a Onepostly post has several. Passed on its own, it returns live account insights for Instagram and Facebook.
1 <= lengthdestinationId?stringDestination id. It identifies one destination on its own, so post and accountId become optional.
1 <= lengthmetrics?stringComma-separated metric names for account insights. Each platform has its own default set.
1 <= length <= 500period?string"day""week""days_28""lifetime"since?integer0 < valueuntil?integer0 < valuebreakdown?stringInstagram account insights breakdown, such as follower_type, media_product_type, age, city or country.
1 <= length <= 64timeframe?stringInstagram demographics timeframe, such as this_week, this_month or last_30_days.
1 <= length <= 32metricType?string1 <= length <= 32from?stringFirst day to include, as YYYY-MM-DD.
^\d{4}-\d{2}-\d{2}$to?stringLast day to include, as YYYY-MM-DD.
^\d{4}-\d{2}-\d{2}$Daily timeline per subject
application/json- response
timeline*import { Configuration, AnalyticsApi } from "@onepostly/sdk";const analyticsApi = new AnalyticsApi( new Configuration({ apiKey: process.env.ONEPOSTLY_API_KEY }));const response = await analyticsApi.getAnalyticsTimeline({ post: "1699f415-7fb6-43f4-9d2a-c447491f32a8", metrics: "views,reach,profile_views", period: "day", from: "2026-08-01", to: "2026-08-28",});console.log(response);{ "timeline": { "post": "b3e1a7c2-8f4d-4e6a-9c1b-2d3e4f5a6b7c", "subjects": [ { "scope": "destination", "subjectId": "d4e5f6a7-8b9c-4d0e-8f1a-2b3c4d5e6f7a", "platform": "instagram", "status": "ready", "points": [ { "day": "2026-08-01", "metrics": { "impressions": 1234, "reach": 987, "likes": 123, "comments": 12, "shares": 4, "saves": 2, "plays": 456, "engagement": 0.14 }, "delta": { "impressions": 120, "reach": 90, "likes": 11, "comments": 1, "shares": 0, "saves": 0, "plays": 40, "engagement": 0.01 } } ] } ] }}