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

# Best posts

> Posts published in the period, best first by sort (views when left out). A post that went to two accounts can appear twice. Needs analytics:read.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/analytics/posts
openapi: 3.1.1
info:
  title: Postinger API
  description: >-
    Schedule and publish posts, upload media and read analytics for one
    workspace. Authenticate with an API key from API Keys in the app:
    Authorization: Bearer pst_live_…
  version: v1
servers:
  - url: https://api.postinger.dev
    description: Production
security:
  - apiKey: []
tags:
  - name: Accounts
  - name: Analytics
  - name: Workspace
  - name: Media
  - name: Posts
paths:
  /v1/analytics/posts:
    get:
      tags:
        - Analytics
      summary: Best posts
      description: >-
        Posts published in the period, best first by sort (views when left out).
        A post that went to two accounts can appear twice. Needs analytics:read.
      parameters:
        - name: from
          in: query
          description: >-
            When the period starts: ISO 8601 with an offset. At most a year
            before to.
          required: true
          schema:
            type: string
            format: date-time
        - name: to
          in: query
          description: 'When it ends, not included: ISO 8601 with an offset.'
          required: true
          schema:
            type: string
            format: date-time
        - name: accounts
          in: query
          description: 'Only these accounts; repeat the parameter for more. Missing: all.'
          schema:
            type: array
            items:
              type: string
              format: uuid
        - name: sort
          in: query
          schema:
            enum:
              - views
              - reach
              - likes
              - comments
              - shares
              - saves
              - engagements
              - avgWatchSeconds
            type: string
        - name: limit
          in: query
          description: 'How many: 1 to 50, 10 by default.'
          schema:
            type: integer
            format: int32
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TopPostsResponse'
components:
  schemas:
    TopPostsResponse:
      required:
        - posts
      type: object
      properties:
        posts:
          type: array
          items:
            $ref: '#/components/schemas/TopPostResponse'
    TopPostResponse:
      required:
        - postId
        - socialAccountId
        - platform
        - format
        - publishedAt
        - externalUrl
        - content
        - thumbnailUrl
        - metrics
        - lastSyncedAt
      type: object
      properties:
        postId:
          type: string
          format: uuid
        socialAccountId:
          type: string
          format: uuid
        platform:
          enum:
            - instagram
            - facebook
            - youtube
            - tiktok
          type: string
        format:
          type: string
        publishedAt:
          type: string
          format: date-time
        externalUrl:
          type:
            - 'null'
            - string
        content:
          type: string
        thumbnailUrl:
          type:
            - 'null'
            - string
        metrics:
          $ref: '#/components/schemas/PostValuesResponse'
        lastSyncedAt:
          type:
            - 'null'
            - string
          format: date-time
    PostValuesResponse:
      required:
        - views
        - reach
        - likes
        - comments
        - shares
        - saves
        - engagements
        - avgWatchSeconds
      type: object
      properties:
        views:
          type:
            - 'null'
            - integer
          format: int64
        reach:
          type:
            - 'null'
            - integer
          format: int64
        likes:
          type:
            - 'null'
            - integer
          format: int64
        comments:
          type:
            - 'null'
            - integer
          format: int64
        shares:
          type:
            - 'null'
            - integer
          format: int64
        saves:
          type:
            - 'null'
            - integer
          format: int64
        engagements:
          type:
            - 'null'
            - integer
          format: int64
        avgWatchSeconds:
          type:
            - 'null'
            - number
          format: double
  securitySchemes:
    apiKey:
      type: http
      description: A workspace API key (pst_live_…).
      scheme: bearer

````

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