Analytics

Get Daily Analytics Timeline

Returns daily cumulative metrics for each post destination. Covers the last 90 days by default.

GET
/v1/analytics/timeline

Authorization

headerx-api-key<token>

Workspace API key, sent in the x-api-key header. Keys start with op_ and are created in the dashboard.

Query Parameters

post?string

Onepostly post id or platform-native post id. Native ids also need accountId. You can omit it when you pass destinationId.

Length1 <= length
accountId?string

Connection 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.

Length1 <= length
destinationId?string

Destination id. It identifies one destination on its own, so post and accountId become optional.

Length1 <= length
metrics?string

Comma-separated metric names for account insights. Each platform has its own default set.

Length1 <= length <= 500
period?string
Value in"day""week""days_28""lifetime"
since?integer
Range0 < value
until?integer
Range0 < value
breakdown?string

Instagram account insights breakdown, such as follower_type, media_product_type, age, city or country.

Length1 <= length <= 64
timeframe?string

Instagram demographics timeframe, such as this_week, this_month or last_30_days.

Length1 <= length <= 32
metricType?string
Length1 <= length <= 32
from?string

First day to include, as YYYY-MM-DD.

Match^\d{4}-\d{2}-\d{2}$
to?string

Last day to include, as YYYY-MM-DD.

Match^\d{4}-\d{2}-\d{2}$

Response Body

Daily timeline per subject

application/json
  1. response
timeline*
Example Request
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);
Example 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            }          }        ]      }    ]  }}