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

# Get account analytics history

> Returns daily history for a connected account: follower levels, reach, and the other metrics the platform publishes. For the account's current figures, use the live insights routes instead.
Each series names its metric kind (gauge for a level you may diff, flow for a per-day count you may sum) and the timezone its days were cut on. Every point also carries how many subjects contributed to that day, always present and always at least 1, even for a single-subject account.



## OpenAPI

````yaml /api-reference/openapi.json get /accounts/{id}/analytics
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:
  /accounts/{id}/analytics:
    get:
      tags:
        - Analytics
      summary: Get account analytics history
      description: >-
        Returns daily history for a connected account: follower levels, reach,
        and the other metrics the platform publishes. For the account's current
        figures, use the live insights routes instead.

        Each series names its metric kind (gauge for a level you may diff, flow
        for a per-day count you may sum) and the timezone its days were cut on.
        Every point also carries how many subjects contributed to that day,
        always present and always at least 1, even for a single-subject account.
      parameters:
        - description: Connected account ID
          name: id
          in: path
          required: true
          schema:
            type: string
        - example: '2026-08-23'
          description: First day, YYYY-MM-DD. Defaults to 29 days before to.
          name: from
          in: query
          schema:
            type: string
        - example: '2026-09-21'
          description: Last day, YYYY-MM-DD. Defaults to today (UTC).
          name: to
          in: query
          schema:
            type: string
        - description: Comma-separated metric names. Defaults to every stored metric.
          name: metrics
          in: query
          schema:
            type: string
        - description: Narrow to one page of a multi-page account
          name: page_id
          in: query
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api_endpoints.AnalyticsResponseWrapper'
        '400':
          description: Malformed or inverted range, or a range wider than 400 days
          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 not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api_endpoints.ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    api_endpoints.AnalyticsResponseWrapper:
      type: object
      properties:
        data:
          $ref: >-
            #/components/schemas/social-api_ai_core_api_service.AnalyticsResponse
    api_endpoints.ErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/api_endpoints.ErrorBody'
    social-api_ai_core_api_service.AnalyticsResponse:
      type: object
      properties:
        from:
          description: >-
            From and To are the resolved range, echoed so a caller that named
            neither

            knows what it got.
          type: string
          example: '2026-08-21'
        series:
          type: array
          items:
            $ref: '#/components/schemas/social-api_ai_core_api_service.MetricSeries'
        to:
          type: string
          example: '2026-09-19'
    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.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
  securitySchemes:
    BearerAuth:
      description: >-
        Prefix your API key with "Bearer ". Example: `Authorization: Bearer
        sapi_key_...`
      type: apiKey
      name: Authorization
      in: header

````