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

# Get one post's analytics

> Current views, likes, comments, shares and saves for each platform copy of one post that is published on TikTok, Instagram, YouTube or Facebook. Numbers are cached for up to an hour; `last_updated` says when each was read from the platform. Targets on other platforms, or not published yet, are left out. Works for posts created through the API or dashboard and for workflow posts.



## OpenAPI

````yaml /openapi/public-api.yaml get /v1/posts/{id}/analytics
openapi: 3.1.0
info:
  title: PostOnce Public API
  version: 1.0.0-alpha
  description: Public API for PostOnce paid users
servers:
  - url: https://postonce.to/api/public
security:
  - bearerAuth: []
paths:
  /v1/posts/{id}/analytics:
    get:
      summary: Get one post's analytics
      description: >-
        Current views, likes, comments, shares and saves for each platform copy
        of one post that is published on TikTok, Instagram, YouTube or Facebook.
        Numbers are cached for up to an hour; `last_updated` says when each was
        read from the platform. Targets on other platforms, or not published
        yet, are left out. Works for posts created through the API or dashboard
        and for workflow posts.
      parameters:
        - $ref: '#/components/parameters/postId'
      responses:
        '200':
          description: Post analytics returned successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/PostTargetAnalytics'
        '400':
          description: Post ID must be a valid UUID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing, invalid, revoked, or expired API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthErrorResponse'
        '404':
          description: Post not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    postId:
      name: id
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Aggregate post ID.
  schemas:
    PostTargetAnalytics:
      type: object
      properties:
        id:
          type: string
        media_url:
          type:
            - string
            - 'null'
          description: The video or image file PostOnce published.
        targets:
          type: array
          items:
            type: object
            properties:
              account_id:
                type: string
              platform:
                type: string
              platform_post_id:
                type:
                  - string
                  - 'null'
              url:
                type:
                  - string
                  - 'null'
              published_at:
                type: string
                format: date-time
              metrics_status:
                type: string
                description: >-
                  ok, reconnect, limited or unavailable, as in GET
                  /v1/analytics.
              views:
                type:
                  - integer
                  - 'null'
              likes:
                type:
                  - integer
                  - 'null'
              comments:
                type:
                  - integer
                  - 'null'
              shares:
                type:
                  - integer
                  - 'null'
              saves:
                type:
                  - integer
                  - 'null'
              engagement_rate:
                type:
                  - number
                  - 'null'
                description: >-
                  (likes + comments + shares + saves) / views. null without
                  views.
              last_updated:
                type:
                  - string
                  - 'null'
                format: date-time
                description: >-
                  When these numbers were read from the platform; null when the
                  platform returned none.
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              example: workflow_limit_reached
            message:
              type: string
              example: You have reached the maximum number of workflows for your plan.
            hint:
              type: string
              description: Suggested action to resolve the error.
    AuthErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: invalid_api_key
            message:
              type: string
              example: Invalid API key.
            hint:
              type: string
              description: Suggested action to resolve the error.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Scoped API key issued in PostOnce Settings. OAuth authorization grants
        are not currently supported.
      x-scopes:
        accounts:read: List and read connected accounts.
        accounts:write: Connect and disconnect social accounts.
        media:read: Read uploaded media.
        media:write: Upload media.
        posts:read: Read posts and unpublished drafts.
        posts:write: Create, update, publish, cancel, retry, and delete posts and drafts.
        workflows:read: List and read crossposting workflows.
        workflows:write: Create, update, and delete crossposting workflows.

````

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