---
title: "Get post analytics"
method: GET
path: "/v1/analytics"
---

# Get post analytics

`GET /v1/analytics`

## Request

- Base URL: `https://postonce.to/api/public`
- URL: `https://postonce.to/api/public/v1/analytics`
- Auth: HTTP bearer

Views, likes, comments, shares and saves for each post the connected TikTok, Instagram, YouTube and Facebook accounts published in the last 7, 30 or 90 days, including posts made outside PostOnce. Each platform copy is compared with its account's median views (`views_vs_account_median`: 2 means twice the account's usual views), so above- and below-average posts can be found and compared. Numbers are cached and refreshed about every 10 minutes; `refreshing` is true while some are still loading. A first report for many accounts can take longer than a few seconds: the call then returns `refreshing: true` with no posts yet and keeps building, so call again in a minute. A metric is null when the platform does not report it. Partner accounts get one end user's posts per call with `external_user_id` or `account_id`, and their own accounts (those without an end user) otherwise. For one post, use `GET /v1/posts/{id}/analytics`.

## Query parameters

- `days` integer
- `external_user_id` string
- `account_id` string

## Response `200`

Analytics returned successfully.

- object
  - `data` PostAnalytics
    - `range` object
      - `days` integer
      - `start` string, date-time
      - `end` string, date-time
    - `accounts` object[]
      - `id` string
      - `platform` string
      - `username` string, nullable
      - `metrics_status` string: ok, reconnect (reconnect the account to read its numbers), limited (some numbers need a permission the account lacks) or unavailable (the platform request failed; try later).
      - `posts_with_views` integer
      - `median_views` number, nullable: Median views of the account's posts in the range; null with fewer than 3 posts that have views.
      - `followers` integer, nullable: Latest stored follower count (YouTube subscribers). Measured when the account connects, then weekly on paid plans.
      - `followers_observed_at` string, date-time, nullable
    - `posts` object[]
      - `id` string
      - `post_id` string, nullable: The ID to pass to GET /v1/posts/{id}/analytics. null for posts made outside PostOnce.
      - `title` string: First line of the caption, at most 90 characters.
      - `caption` string: Full post text, including hashtags. For YouTube videos posted outside PostOnce, the video title.
      - `thumbnail_url` string, nullable: Cover image. Some platform links expire after a few hours.
      - `media_url` string, nullable: The video or image file PostOnce published, so an AI or tool can watch or view it. null for posts made directly on the platform.
      - `media_type` 'video' | 'photo'
      - `published_at` string, date-time
      - `origin` string: postonce when at least one copy went out through PostOnce; native when posted directly on the platform.
      - `destinations` object[]
        - `platform` string
        - `account_id` string
        - `username` string, nullable
        - `url` string, nullable
        - `published_at` string, date-time
        - `views` integer, nullable
        - `likes` integer, nullable
        - `comments` integer, nullable
        - `shares` integer, nullable
        - `saves` integer, nullable
        - `engagement_rate` number, nullable: (likes + comments + shares + saves) / views, from the numbers the platform reports. null without views.
        - `views_vs_account_median` number, nullable: This copy's views divided by its account's median views in the range.
    - `truncated` boolean: More posts existed than numbers were fetched for.
    - `refreshing` boolean
    - `updated_at` string, date-time

## Other responses

- `400`: days is not 7, 30 or 90.
- `401`: Missing, invalid, revoked, or expired API key.
- `404`: account_id is not one of your accounts (or not this end user's).

---

[API](https://skmtc.dev/postonce/apis/postonce-public-api.md) · [All operations](https://skmtc.dev/postonce/apis/postonce-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/postonce/apis/postonce-public-api/revisions/ca9dca40a543?raw)
