> ## Documentation Index
> Fetch the complete documentation index at: https://api.onlysocial.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get the analytics of a post

> How a post did on each account it went out to. Accounts it did not go out to are left out, so a post that is not published yet has an empty `summary` and `accounts`. Trashed posts can still be read. Trends are daily; a post tracked for 60 days or more is grouped by week (each point dated with its Monday), and one tracked for 180 days or more by month (`YYYY-MM`).

Read-only. Personal access tokens may call it with any workspace role, viewers included.

**Required permission:** `publishing:analytics:read`



## OpenAPI

````yaml /api-reference/publishing.openapi.json get /{workspace}/posts/{post}/analytics
openapi: 3.1.0
info:
  title: Publishing API
  version: 1.0.0
  description: >-
    Social accounts, posts, scheduling, approval, tags, media and analytics for
    one workspace.
servers:
  - url: https://app.onlysocial.io/os/api
    description: OnlySocial
security:
  - bearerAuth: []
  - apiKeyHeader: []
tags:
  - name: Diagnostics
  - name: Accounts
  - name: Posts
  - name: Media
  - name: Tags
  - name: Analytics
    description: >-
      Followers, reach, engagement and post performance, as the analytics
      dashboard shows them, plus when to post. Dates are UTC days unless a
      `timezone` is sent. Figures compared with the previous period of the same
      length are `{value, change}`, where `change` is a percentage (`100` when
      the previous period was zero, `null` when both are). Time series are lists
      of `{date, value}` points; breakdowns (ages, countries, keywords) are
      lists of `{label, value}`.
paths:
  /{workspace}/posts/{post}/analytics:
    get:
      tags:
        - Analytics
      summary: Get the analytics of a post
      description: >-
        How a post did on each account it went out to. Accounts it did not go
        out to are left out, so a post that is not published yet has an empty
        `summary` and `accounts`. Trashed posts can still be read. Trends are
        daily; a post tracked for 60 days or more is grouped by week (each point
        dated with its Monday), and one tracked for 180 days or more by month
        (`YYYY-MM`).


        Read-only. Personal access tokens may call it with any workspace role,
        viewers included.


        **Required permission:** `publishing:analytics:read`
      operationId: posts.analytics
      parameters:
        - name: workspace
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Your workspace UUID. Must match the API key's workspace.
        - name: post
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Post UUID.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostAnalytics'
        '401':
          description: Missing or invalid credential.
        '403':
          description: The API key does not have `publishing:analytics:read`.
        '404':
          description: Unknown workspace, account or post.
components:
  schemas:
    PostAnalytics:
      type: object
      properties:
        summary:
          type: object
          description: Empty when the post went out to no account yet.
          properties:
            totals:
              type: object
              properties:
                views:
                  type: integer
                likes:
                  type: integer
                comments:
                  type: integer
                shares:
                  type: integer
            trends:
              type: object
              properties:
                views:
                  type: array
                  items:
                    $ref: '#/components/schemas/AnalyticsPoint'
                likes:
                  type: array
                  items:
                    $ref: '#/components/schemas/AnalyticsPoint'
                comments:
                  type: array
                  items:
                    $ref: '#/components/schemas/AnalyticsPoint'
                shares:
                  type: array
                  items:
                    $ref: '#/components/schemas/AnalyticsPoint'
            engagement_rate:
              type: number
              description: Likes, comments and shares as a percent of views.
              example: 4
            breakdown:
              type: object
              description: Empty when there was no engagement.
              properties:
                likes:
                  type: object
                  properties:
                    value:
                      type: integer
                    percentage:
                      type: number
                comments:
                  type: object
                  properties:
                    value:
                      type: integer
                    percentage:
                      type: number
                shares:
                  type: object
                  properties:
                    value:
                      type: integer
                    percentage:
                      type: number
            funnel:
              type: object
              properties:
                views:
                  type: integer
                interactions:
                  type: integer
                shares:
                  type: integer
                view_to_interaction_rate:
                  type: number
                interaction_to_share_rate:
                  type: number
            peak_day:
              type: object
              nullable: true
              properties:
                date:
                  type: string
                  format: date
                total:
                  type: integer
                views:
                  type: integer
                likes:
                  type: integer
                comments:
                  type: integer
                shares:
                  type: integer
        winner:
          type: object
          nullable: true
          description: >-
            The account with the highest engagement rate; null with fewer than
            two accounts or no engagement.
          properties:
            account_id:
              type: integer
            metrics:
              type: object
              properties:
                views:
                  type: integer
                likes:
                  type: integer
                comments:
                  type: integer
                shares:
                  type: integer
            engagement_rate:
              type: number
        accounts:
          type: array
          items:
            type: object
            properties:
              account_id:
                type: integer
              account_uuid:
                type: string
                format: uuid
              metrics:
                type: array
                description: The network's own metrics.
                items:
                  type: object
                  properties:
                    key:
                      type: string
                      example: VIEW_COUNT
                    label:
                      type: string
                      example: View count
                    value:
                      type: integer
              trends:
                type: object
                description: Keyed by metric key.
                additionalProperties:
                  type: array
                  items:
                    $ref: '#/components/schemas/AnalyticsPoint'
              engagement_rate:
                type: number
              breakdown:
                type: object
                description: Empty when there was no engagement.
                properties:
                  likes:
                    type: object
                    properties:
                      value:
                        type: integer
                      percentage:
                        type: number
                  comments:
                    type: object
                    properties:
                      value:
                        type: integer
                      percentage:
                        type: number
                  shares:
                    type: object
                    properties:
                      value:
                        type: integer
                      percentage:
                        type: number
              vs_average:
                type: object
                description: >-
                  Against that account's average post: `1.3` is 30% above. Null
                  without an average.
                properties:
                  views:
                    type: number
                    nullable: true
                  likes:
                    type: number
                    nullable: true
                  comments:
                    type: number
                    nullable: true
                  shares:
                    type: number
                    nullable: true
                  engagement:
                    type: number
                    nullable: true
              peak_day:
                type: object
                nullable: true
                properties:
                  date:
                    type: string
                    format: date
                  total:
                    type: integer
                  views:
                    type: integer
                  likes:
                    type: integer
                  comments:
                    type: integer
                  shares:
                    type: integer
    AnalyticsPoint:
      type: object
      properties:
        date:
          type: string
          example: '2026-01-15'
          description: A UTC day, or a month (`YYYY-MM`).
        value:
          type: number
          nullable: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'A workspace API key: `Authorization: Bearer osk_...`'
    apiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: The same workspace API key in the `x-api-key` header.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.