Analytics

Get Analytics

Returns normalized metrics for a Onepostly post or a platform-native post id. Pass only accountId to get live account insights for Instagram and Facebook.

GET
/v1/analytics

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

Response Body

Normalized analytics. Metrics refresh about hourly for posts under 30 days old and about weekly after that.

application/json
  1. response
analytics*
Example Request
import { Configuration, AnalyticsApi } from "@onepostly/sdk";const analyticsApi = new AnalyticsApi(  new Configuration({ apiKey: process.env.ONEPOSTLY_API_KEY }));const response = await analyticsApi.getAnalytics({  post: "1699f415-7fb6-43f4-9d2a-c447491f32a8",  metrics: "views,reach,profile_views",  period: "day",});console.log(response);
Example Response
{  "analytics": {    "post": "b3e1a7c2-8f4d-4e6a-9c1b-2d3e4f5a6b7c",    "status": "ready",    "fetchedAt": "2026-08-25T10:00:00.000Z",    "subjects": [      {        "scope": "destination",        "subjectId": "d4e5f6a7-8b9c-4d0e-8f1a-2b3c4d5e6f7a",        "accountId": "a1b2c3d4-e5f6-4a7b-8c9d-e0f1a2b3c4d5",        "platform": "instagram",        "externalPostId": "17895695668004550",        "status": "ready",        "metrics": {          "impressions": 1234,          "reach": 987,          "likes": 123,          "comments": 12,          "shares": 4,          "saves": 2,          "plays": 456,          "engagement": 0.14        },        "fetchedAt": "2026-08-25T10:00:00.000Z",        "expiresAt": "2026-09-01T10:00:00.000Z",        "error": null      }    ]  }}