Get post analytics

Fetch analytics and metrics for a published post across all social accounts it was published to.

Fetch analytics and metrics for a published post across all social accounts it was published to. Returns both per-account metrics (likes, comments, shares, views, impressions, reach, engagement rate) and aggregated totals across all platforms. Only available for posts that have been published - draft or scheduled posts will return a 400 error. Platform-specific metrics (e.g., retweets for X, saves for Instagram) are included in the platform_specific field of each account's metrics.

Instagram Stories: media_product_type is "STORY" and the metric set differs from feed/reels - likes/comments/saves are not supported and returned as null, while replies, profile_visits, follows, link_clicks, reposts, total_interactions and a navigation breakdown (tap_forward, tap_back, tap_exit, swipe_forward) are populated instead. Story insights are only queryable for approximately 24 hours after publish; after that window this endpoint returns metrics: null with metrics_error.code: "metrics_expired" for that account.

Instagram Reels: media_product_type is "REELS" and the response adds average_watch_time_ms, total_watch_time_ms (milliseconds, replays included), skip_rate (percentage of views skipped in the first 3 seconds, estimated by Meta), reposts and total_interactions. Any of these Meta did not report is null and named in platform_specific.unavailable_fields. Per-reel follows and profile visits are not available from Instagram; use the account-level follower_growth from GET /v1/social-accounts/{id}/metrics instead. Instagram data can lag up to 48 hours.

Facebook: video and single-photo posts may initially have a media ID. When Meta provides a corresponding Post ID, Outstand resolves and caches it, so platform_post_id may differ from the ID returned at publish time. Unsupported or unreported engagement counts are null and named in platform_specific.unavailable_fields; measured zero remains 0. Available counts are returned even when other fields or supplementary insights are unavailable. engagement_total and engagement_rate are null when required engagement counts are unavailable. Aggregated totals sum only available measurements and can be partial; engagement-rate averages include measured zeros and exclude unavailable rates.

Facebook video and Reel posts also return video insights: views, average_watch_time_ms and total_watch_time_ms for every video; total_plays (including replays), replays and followers_gained for Reels, where views counts plays excluding replays; and approx_completion_rate for regular videos, the share of views that reached 97% of the video. Meta exposes no completion metric for Reels, so Reels omit it - use average_watch_time_ms and the retention graph instead. Pass include=retention to add retention, an array of { t, pct } points (at most 41, sampled by Meta) giving the percentage of plays still watching at each position. Video fields Meta did not report are null and named in platform_specific.unavailable_fields; the video id and raw metric names are under platform_specific.video. Reading video insights needs the read_insights permission and a Page user with the Analyze task.

GET/v1/posts/{id}/analytics

Path Parameters

idstring

Query Parameters

include?string

Comma-separated list of optional, costlier metrics to add. retention adds the video retention graph (metrics.retention) for Facebook video and Reel posts, at the cost of one extra Graph API request per video. Ignored for other networks and for non-video posts.

Response Body

fetch("https://api.outstand.so/v1/posts/string/analytics?include=retention", {  method: "GET"})
{
  "success": true,
  "post": {
    "id": "9dyJS",
    "publishedAt": "2019-08-24T14:15:22Z",
    "createdAt": "2019-08-24T14:15:22Z"
  },
  "metrics_by_account": [
    {
      "social_account": {
        "id": "un7ME",
        "nickname": "string",
        "network": "string",
        "username": "string"
      },
      "platform_post_id": "string",
      "platform_post_url": "string",
      "published_at": "2019-08-24T14:15:22Z",
      "metrics": {
        "likes": 0,
        "comments": 0,
        "shares": 0,
        "views": 0,
        "total_plays": 0,
        "replays": 0,
        "followers_gained": 0,
        "approx_completion_rate": 0,
        "retention": [
          {
            "t": 0,
            "pct": 0
          }
        ],
        "impressions": 0,
        "reach": 0,
        "engagement_rate": 0,
        "engagement_total": 0,
        "media_product_type": "FEED",
        "replies": 0,
        "profile_visits": 0,
        "follows": 0,
        "link_clicks": 0,
        "reposts": 0,
        "total_interactions": 0,
        "average_watch_time_ms": 4210,
        "total_watch_time_ms": 982000,
        "skip_rate": 37.5,
        "navigation": {
          "tap_forward": 0,
          "tap_back": 0,
          "tap_exit": 0,
          "swipe_forward": 0
        },
        "platform_specific": {
          "property1": null,
          "property2": null
        }
      },
      "metrics_error": {
        "code": "token_expired",
        "message": "string"
      }
    }
  ],
  "aggregated_metrics": {
    "total_likes": 0,
    "total_comments": 0,
    "total_shares": 0,
    "total_views": 0,
    "total_impressions": 0,
    "total_reach": 0,
    "average_engagement_rate": 0
  }
}
{
  "success": false,
  "error": "Invalid payload",
  "code": "idempotency_key_reuse",
  "details": {
    "content": {
      "_errors": [
        "Required"
      ]
    }
  }
}
{
  "success": false,
  "error": "Invalid payload",
  "code": "idempotency_key_reuse",
  "details": {
    "content": {
      "_errors": [
        "Required"
      ]
    }
  }
}
{
  "success": false,
  "error": "Invalid payload",
  "code": "idempotency_key_reuse",
  "details": {
    "content": {
      "_errors": [
        "Required"
      ]
    }
  }
}
{
  "success": false,
  "error": "Internal server error",
  "code": "idempotency_recovery_failed",
  "message": "Database connection failed"
}