> ## 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 summary

> Every account in the workspace that has analytics, over one period: total followers, follower growth and posts with their change, the best-growing account and one losing followers, a leaderboard, the most and least active accounts, each account's share of followers, total followers per day, and on how many days anything was posted.

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}/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}/analytics:
    get:
      tags:
        - Analytics
      summary: Get the analytics summary
      description: >-
        Every account in the workspace that has analytics, over one period:
        total followers, follower growth and posts with their change, the
        best-growing account and one losing followers, a leaderboard, the most
        and least active accounts, each account's share of followers, total
        followers per day, and on how many days anything was posted.


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


        **Required permission:** `publishing:analytics:read`
      operationId: analytics.summary
      parameters:
        - name: workspace
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Your workspace UUID. Must match the API key's workspace.
        - name: period
          in: query
          schema:
            type: string
            enum:
              - this_week
              - last_week
              - this_month
              - last_month
              - last_3_months
              - this_year
            default: this_month
          description: >-
            In UTC. Weeks start on Monday. `this_week`, `this_month` and
            `this_year` run up to today; `last_3_months` is the three whole
            months before this one. Ignored when `date_from` and `date_to` are
            both sent.
        - name: date_from
          in: query
          schema:
            type: string
            format: date
            example: '2026-01-01'
          description: Start of a custom range (UTC day). Send with `date_to`.
        - name: date_to
          in: query
          schema:
            type: string
            format: date
            example: '2026-01-31'
          description: >-
            End of a custom range, on or after `date_from`. A range spans at
            most 366 days, both ends included.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  period:
                    $ref: '#/components/schemas/AnalyticsPeriod'
                  data:
                    $ref: '#/components/schemas/AnalyticsSummary'
        '401':
          description: Missing or invalid credential.
        '403':
          description: The API key does not have `publishing:analytics:read`.
        '404':
          description: Unknown workspace, account or post.
        '422':
          description: >-
            Invalid input. An unknown `period`, one date without the other, an
            end before the start, or more than 366 days.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
components:
  schemas:
    AnalyticsPeriod:
      type: object
      description: >-
        The range the figures cover, and the previous range of the same length
        every `change` is measured against.
      properties:
        start_date:
          type: string
          format: date
        end_date:
          type: string
          format: date
        previous_start_date:
          type: string
          format: date
        previous_end_date:
          type: string
          format: date
    AnalyticsSummary:
      type: object
      properties:
        total_followers:
          type: integer
        follower_growth:
          $ref: '#/components/schemas/AnalyticsChange'
        total_posts:
          $ref: '#/components/schemas/AnalyticsChange'
        best_account:
          $ref: '#/components/schemas/AccountStanding'
          description: Highest growth rate; null with no accounts.
        needs_attention:
          $ref: '#/components/schemas/AccountStanding'
          description: Lowest growth rate, only when negative; otherwise null.
        audience_chart:
          type: array
          items:
            $ref: '#/components/schemas/AnalyticsPoint'
          description: Total followers per day; `null` where nothing was recorded.
        leaderboard:
          type: array
          items:
            $ref: '#/components/schemas/AccountStanding'
          description: Most followers first.
        most_active:
          $ref: '#/components/schemas/AccountStanding'
          description: Most posts.
        least_active:
          $ref: '#/components/schemas/AccountStanding'
          description: Fewest posts; null when it is the most active account.
        follower_distribution:
          type: array
          items:
            type: object
            properties:
              account:
                $ref: '#/components/schemas/Account'
              followers:
                type: integer
              percentage:
                type: number
        posting_streak:
          type: object
          properties:
            active_days:
              type: integer
            total_days:
              type: integer
            percentage:
              type: number
    ValidationError:
      type: object
      properties:
        message:
          type: string
          example: The date range may span at most 366 days.
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          example:
            date_to:
              - The date range may span at most 366 days.
    AnalyticsChange:
      type: object
      properties:
        value:
          type: number
        change:
          type: number
          nullable: true
          description: >-
            Percent against the previous period: `100` when that was zero and
            this is not, `null` when both are zero.
    AccountStanding:
      type: object
      properties:
        account:
          $ref: '#/components/schemas/Account'
        followers:
          type: integer
          description: On the last day.
        follower_growth:
          type: integer
          description: Negative when followers were lost.
        growth_rate:
          type: number
          description: Percent of the followers at the start.
        posts:
          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
    Account:
      type: object
      properties:
        id:
          type: integer
          description: Use this in a post's `accounts`.
        uuid:
          type: string
          format: uuid
        name:
          type: string
        username:
          type: string
        image:
          type: string
        provider:
          type: string
          example: instagram
        data:
          type: object
        authorized:
          type: boolean
        created_at:
          type: string
        published_at:
          type: string
          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.