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

> ## Agent Instructions
> Base URL: https://api.social-api.ai/v1. Send your API key in the Authorization header: Authorization: Bearer <your API key>.
> Every error response from /v1 is JSON: { "error": { "code", "message", "meta" (optional) }, "request_id" }. Branch on error.code; use error.message only for logs.
> A 429 response carries a Retry-After header, in seconds, when the limit has a known wait. Authenticated responses can carry X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset for the per-minute request budget your SocialAPI account shares across every API key (see /guides/rate-limits).
> Paginated list endpoints return next_cursor, at the top level or inside pagination (see /guides/pagination). Pass it as the cursor query parameter to get the next page. An absent or empty next_cursor means you have the last page.
> Treat every ID as an opaque string: do not parse it or assume a format.
> Support differs by platform and by operation. Check /platforms/overview before assuming an operation works on a platform. An unsupported operation returns 501 with error.code resource.not_supported.

# Get analytics overview

> Summarises how the posts published in a range performed: totals against the previous range of equal length, engagement per publish day, breakdowns by platform and media type, the top posts, the hours your posts did best in, and the daily replies, DMs and moderation SocialAPI performed. Covers every account the key can read, or one account, brand, or platform.
Engagements are likes + comments + shares + saves. Views are reported apart, by the platforms that publish them. Counters are the ones SocialAPI last synced (see metrics_synced_at), so this makes no platform call and costs no credits. Accounts without the analytics.read permission are left out and counted in accounts_excluded.



## OpenAPI

````yaml /api-reference/openapi.json get /analytics/overview
openapi: 3.0.0
info:
  description: >-
    Unified social media inbox API. Read and respond to comments, DMs, reviews,
    and mentions across Instagram, Facebook, Threads, Google Business Profile,
    TikTok, LinkedIn, and YouTube through a single REST API. X/Twitter and
    Trustpilot coming soon.
  title: SocialAPI.AI
  contact:
    name: SocialAPI.AI Support
    email: support@social-api.ai
  license:
    name: MIT
  version: '1.0'
servers:
  - url: https://api.social-api.ai/v1
security: []
paths:
  /analytics/overview:
    get:
      tags:
        - Analytics
      summary: Get analytics overview
      description: >-
        Summarises how the posts published in a range performed: totals against
        the previous range of equal length, engagement per publish day,
        breakdowns by platform and media type, the top posts, the hours your
        posts did best in, and the daily replies, DMs and moderation SocialAPI
        performed. Covers every account the key can read, or one account, brand,
        or platform.

        Engagements are likes + comments + shares + saves. Views are reported
        apart, by the platforms that publish them. Counters are the ones
        SocialAPI last synced (see metrics_synced_at), so this makes no platform
        call and costs no credits. Accounts without the analytics.read
        permission are left out and counted in accounts_excluded.
      parameters:
        - example: '2026-10-07'
          description: First day, YYYY-MM-DD, in tz. Defaults to 29 days before to.
          name: from
          in: query
          schema:
            type: string
        - example: '2026-11-05'
          description: Last day, YYYY-MM-DD, in tz. Defaults to today in tz.
          name: to
          in: query
          schema:
            type: string
        - example: Europe/Paris
          description: IANA time zone that days and hours are cut in. Defaults to UTC.
          name: tz
          in: query
          schema:
            type: string
        - description: Narrow to one connected account
          name: account_id
          in: query
          schema:
            type: string
        - description: Narrow to one brand
          name: brand_id
          in: query
          schema:
            type: string
        - example: instagram
          description: Narrow to one platform
          name: platform
          in: query
          schema:
            type: string
        - description: >-
            Order of top_posts: engagements (default), likes, comments, shares,
            or views
          name: sort
          in: query
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/api_endpoints.AnalyticsOverviewResponseWrapper
        '400':
          description: >-
            Malformed or inverted range, a range wider than 400 days, an unknown
            tz, or an unknown sort
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api_endpoints.ErrorResponse'
        '401':
          description: Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api_endpoints.ErrorResponse'
        '404':
          description: Account or brand not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api_endpoints.ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    api_endpoints.AnalyticsOverviewResponseWrapper:
      type: object
      properties:
        data:
          $ref: >-
            #/components/schemas/social-api_ai_core_api_service.AnalyticsOverview
    api_endpoints.ErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/api_endpoints.ErrorBody'
        request_id:
          description: >-
            RequestID matches the X-Request-ID response header. Include it when
            contacting support.
          type: string
          example: 01HZ9X3Q4R5M6N7P8V2K0W1J
    social-api_ai_core_api_service.AnalyticsOverview:
      type: object
      properties:
        accounts_excluded:
          description: |-
            AccountsExcluded is how many accounts in scope were left out because
            they lack the analytics.read permission.
          type: integer
          example: 0
        activity:
          description: |-
            Activity is the daily count of replies, DMs and moderation SocialAPI
            performed for the accounts in scope, the same series shape as the
            history routes.
          type: array
          items:
            $ref: '#/components/schemas/social-api_ai_core_api_service.MetricSeries'
        best_times:
          $ref: >-
            #/components/schemas/social-api_ai_core_api_service.OverviewBestTimes
        by_day:
          type: array
          items:
            $ref: '#/components/schemas/social-api_ai_core_api_service.OverviewDay'
        by_format:
          type: array
          items:
            $ref: '#/components/schemas/social-api_ai_core_api_service.OverviewFormat'
        by_platform:
          type: array
          items:
            $ref: >-
              #/components/schemas/social-api_ai_core_api_service.OverviewPlatform
        from:
          type: string
          example: '2026-10-07'
        metrics_synced_at:
          description: >-
            MetricsSyncedAt is the most recent counter refresh among the posts
            in

            range. Absent when none has been refreshed yet.
          type: string
          example: '2026-11-05T08:00:00Z'
        previous:
          description: >-
            Previous is the same figures for the window of equal length that
            ends

            the day before from.
          allOf:
            - $ref: >-
                #/components/schemas/social-api_ai_core_api_service.OverviewTotals
        to:
          type: string
          example: '2026-11-05'
        top_posts:
          type: array
          items:
            $ref: >-
              #/components/schemas/social-api_ai_core_api_service.OverviewTopPost
        totals:
          $ref: '#/components/schemas/social-api_ai_core_api_service.OverviewTotals'
        tz:
          type: string
          example: Europe/Paris
    api_endpoints.ErrorBody:
      type: object
      properties:
        code:
          type: string
          example: resource.not_found
        message:
          type: string
          example: Account not found
        meta:
          type: object
          additionalProperties: {}
    social-api_ai_core_api_service.MetricSeries:
      type: object
      properties:
        day_tz:
          description: >-
            DayTZ names the boundary these days were cut on, or mixed when a
            rollup

            combines platforms that cut differently. A Brand rollup genuinely
            mixes

            boundaries: up to eight hours of activity sits on the wrong side of
            a day

            edge for Meta platforms next to a UTC-cut platform in the same sum.
            The

            error is bounded and does not compound, and this field is how a
            reader

            tells it from a real discrepancy.
          type: string
          example: America/Los_Angeles
        kind:
          description: Kind is gauge (a level, diff it) or flow (a per-day count, sum it).
          type: string
          example: gauge
        metric:
          description: Metric is the platform's own name for a platform Metric.
          type: string
          example: page_follows
        points:
          description: Points are ordered oldest first.
          type: array
          items:
            $ref: '#/components/schemas/social-api_ai_core_api_service.AnalyticsPoint'
        source:
          description: >-
            Source is reported, sampled, owned, or mixed when a rollup combines
            more

            than one.
          type: string
          example: reported
    social-api_ai_core_api_service.OverviewBestTimes:
      type: object
      properties:
        cells:
          type: array
          items:
            $ref: >-
              #/components/schemas/social-api_ai_core_api_service.OverviewBestTimeCell
        posts_considered:
          type: integer
          example: 42
    social-api_ai_core_api_service.OverviewDay:
      type: object
      properties:
        day:
          type: string
          example: '2026-10-14'
        engagements:
          type: integer
          example: 290
        posts:
          type: integer
          example: 3
    social-api_ai_core_api_service.OverviewFormat:
      type: object
      properties:
        engagements:
          type: integer
          example: 1900
        media_type:
          description: >-
            MediaType is the platform's own media kind, lowercased (image,
            video,

            reel, carousel_album, ...), or unknown when the platform did not
            say.
          type: string
          example: reel
        posts:
          type: integer
          example: 12
    social-api_ai_core_api_service.OverviewPlatform:
      type: object
      properties:
        comments:
          type: integer
          example: 412
        engagements:
          type: integer
          example: 3810
        likes:
          type: integer
          example: 3120
        platform:
          type: string
          example: instagram
        posts:
          type: integer
          example: 42
        saves:
          type: integer
          example: 77
        shares:
          type: integer
          example: 201
        views:
          type: integer
          example: 58200
    social-api_ai_core_api_service.OverviewTotals:
      type: object
      properties:
        comments:
          type: integer
          example: 412
        engagements:
          type: integer
          example: 3810
        likes:
          type: integer
          example: 3120
        posts:
          type: integer
          example: 42
        saves:
          type: integer
          example: 77
        shares:
          type: integer
          example: 201
        views:
          type: integer
          example: 58200
    social-api_ai_core_api_service.OverviewTopPost:
      type: object
      properties:
        account_id:
          type: string
          example: acc_01HZ9X3Q4R5M6N7P8V2K0W1J
        media_type:
          type: string
          example: reel
        metrics:
          $ref: >-
            #/components/schemas/social-api_ai_core_api_service.OverviewPostMetrics
        permalink:
          type: string
          example: https://www.instagram.com/p/C1a2b3c4d5/
        platform:
          type: string
          example: instagram
        post_id:
          type: string
          example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
        published_at:
          type: string
          example: '2026-10-14T09:30:00Z'
        text:
          type: string
          example: Our autumn menu is here
        thumbnail:
          type: string
          example: https://scontent.cdninstagram.com/v/t51.29350-15/456_n.jpg
    social-api_ai_core_api_service.AnalyticsPoint:
      type: object
      properties:
        change:
          description: >-
            Change is the difference from the previous point in this series.
            Present

            on gauges only, and absent on the first point of a range, which has
            no

            predecessor to diff against.
          type: integer
          example: 18
        day:
          description: Day is YYYY-MM-DD, cut on the boundary named by the series' day_tz.
          type: string
          example: '2026-09-19'
        days_spanned:
          description: >-
            DaysSpanned is how many days Change covers. It is 1 in the normal
            case

            and larger when a day is missing from the series. A chart must
            divide by

            it and style the segment as interpolated: otherwise a gap draws a
            spike

            that never happened.
          type: integer
          example: 1
        subjects_counted:
          description: >-
            SubjectsCounted is how many Subjects contributed to this point's
            summed

            value. Always at least 1. Read it before charting: a day on which
            not

            every Subject reported sums lower, and without the count that reads
            as a

            decline instead of a gap.
          type: integer
          example: 3
        value:
          description: |-
            Value is the figure for that day, verbatim from the platform for a
            reported point.
          type: integer
          example: 12430
    social-api_ai_core_api_service.OverviewBestTimeCell:
      type: object
      properties:
        avg_engagements:
          description: >-
            AvgEngagements is the mean engagements of the posts published in
            this

            hour. It describes your past posts, not when your audience is
            online.
          type: number
          example: 118.4
        hour:
          description: Hour is 0 to 23.
          type: integer
          example: 9
        posts:
          type: integer
          example: 5
        weekday:
          description: Weekday is 1 (Monday) to 7 (Sunday).
          type: integer
          example: 4
    social-api_ai_core_api_service.OverviewPostMetrics:
      type: object
      properties:
        comments:
          type: integer
          example: 52
        engagements:
          type: integer
          example: 512
        likes:
          type: integer
          example: 430
        saves:
          type: integer
          example: 9
        shares:
          type: integer
          example: 21
        views:
          type: integer
          example: 10400
  securitySchemes:
    BearerAuth:
      description: >-
        Prefix your API key with "Bearer ". Example: `Authorization: Bearer
        sapi_key_...`
      type: apiKey
      name: Authorization
      in: header

````

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