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

> ## Agent Instructions
> PostQueen's hosted API is https://api.postqueen.ai. The public API base is https://api.postqueen.ai/public/v1 and takes the raw API key in the Authorization header, with no Bearer prefix.
> The MCP server for posting is https://api.postqueen.ai/mcp/YOUR_API_KEY (or /mcp with Authorization: Bearer YOUR_API_KEY). docs.postqueen.ai/mcp only searches these docs and cannot post.
> The API key is under Connections > API Keys in the app, and only workspace admins can see it.

# List post analytics

> Your published posts in a range with their latest metrics, sorted and paged.

Where [Get post analytics](/public-api/analytics/post) asks the network about one post, this reads the metrics PostQueen has already stored for all your published posts. It answers fast, and it can sort and page them.

* `date` picks posts **by publish date**: the last 1 to 90 days, 30 by default.
* The numbers are each post's latest lifetime totals, not growth inside the range. `null` means the network does not report that metric, not zero.
* Only networks with post metrics are included: Instagram, Facebook, Threads, X, LinkedIn Page, TikTok, YouTube and Pinterest. Facebook reports no comments, and Pinterest no reactions or comments. None of the networks Available on PostQueen today is among them.
* Stored numbers older than an hour start a refresh in the background. The answer still comes at once, with `syncing: true`: ask again a little later for newer numbers.

Narrow the list with `integrationIds` (comma separated), `platform` or `q` (text in the content or the channel name). Sort with `sort` (`reactions`, `comments`, `impressions`, `engagement` or `published`) and `dir`. `topReactions` and `topComments` always hold the five best posts of the whole filtered range, whatever page you ask for.

For totals instead of a list, use [Get an analytics summary](/public-api/analytics/summary).


## OpenAPI

````yaml GET /analytics/posts
openapi: 3.1.0
info:
  title: PostQueen Public API
  version: 1.0.0
  license:
    name: MIT
    identifier: MIT
  description: >-
    Schedule posts, upload media, read analytics and manage the channels of your
    PostQueen workspace.


    ## Authentication


    Send your API key in the `Authorization` header exactly as it is, with no
    prefix:


    ```

    Authorization: YOUR_API_KEY

    ```


    The key is under **Connections > API Keys** in the app. Only a workspace
    Admin or Super Admin can reveal or rotate it. An app your users sign in to
    with OAuth sends its `pos_` access token in the same header, also with no
    prefix. The workspace needs a subscription, and the free trial counts.


    ## Rate limits


    A workspace can send 30 `POST /posts` requests an hour, and a request
    refused with `400` counts too. `POST /upload` and `POST /upload-from-url`
    allow 300 requests an hour each, per workspace. Nothing else is limited. A
    limited endpoint answers with `X-RateLimit-Limit`, `X-RateLimit-Remaining`
    and `X-RateLimit-Reset` headers, and over the limit with `429` and
    `Retry-After` (seconds).


    ## Terminology


    The app says channel, the API says integration. They are the same thing: a
    connected account on a network.
servers:
  - url: https://api.postqueen.ai/public/v1
    description: PostQueen
security:
  - ApiKeyAuth: []
tags:
  - name: Channels
    description: Connected channels. The API calls them integrations.
  - name: Posts
    description: Create, list, change and delete posts
  - name: Media
    description: Upload files to the media library
  - name: Clipping
    description: >-
      Turn a YouTube video into short vertical clips. Not available on PostQueen
      yet
  - name: AI video
    description: Generate a video with AI into the media library
  - name: Analytics
    description: Channel and post metrics
  - name: Notifications
    description: The workspace's notifications
  - name: OAuth
    description: Sign-in for apps that act for other PostQueen workspaces
paths:
  /analytics/posts:
    get:
      tags:
        - Analytics
      summary: List post analytics
      description: >-
        Your published posts in a date range with their latest stored metrics,
        sorted and paged. The numbers come from snapshots PostQueen stores for
        the networks that report per-post metrics (Instagram, Facebook, Threads,
        X, LinkedIn Page, TikTok, YouTube, Pinterest); a request starts a
        background refresh when they are more than an hour old, and `syncing`
        says so.
      operationId: listPostAnalytics
      parameters:
        - name: date
          in: query
          required: false
          description: Days to look back by publish date, 1 to 90. Default 30
          schema:
            type: integer
            minimum: 1
            maximum: 90
            default: 30
        - name: integrationIds
          in: query
          required: false
          description: Comma-separated channel ids to limit the report to
          schema:
            type: string
        - name: q
          in: query
          required: false
          description: Text to match in the post content, channel name or platform
          schema:
            type: string
            maxLength: 200
        - name: platform
          in: query
          required: false
          description: The network's identifier, such as x or instagram
          schema:
            type: string
            maxLength: 64
        - name: sort
          in: query
          required: false
          description: Sort field. Default reactions
          schema:
            type: string
            enum:
              - reactions
              - comments
              - impressions
              - engagement
              - published
            default: reactions
        - name: dir
          in: query
          required: false
          description: Sort direction. Default desc
          schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
        - name: page
          in: query
          required: false
          description: Page number, 0-indexed
          schema:
            type: integer
            minimum: 0
            default: 0
        - name: limit
          in: query
          required: false
          description: Posts per page, 1 to 100. Default 20
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
      responses:
        '200':
          description: A page of posts with their metrics
          content:
            application/json:
              schema:
                type: object
                properties:
                  syncing:
                    type: boolean
                    description: >-
                      A background refresh was started; ask again shortly for
                      newer numbers
                  date:
                    type: integer
                  total:
                    type: integer
                  page:
                    type: integer
                  limit:
                    type: integer
                  notes:
                    type: object
                    description: >-
                      Fixed reading notes: the range filters posts by publish
                      date, numbers are current lifetime totals, null means
                      unknown rather than zero, Facebook returns no comments,
                      Pinterest no reactions or comments, Google Business no
                      post metrics
                  columns:
                    type: object
                    description: >-
                      Which metrics any post in the range has at all: comments,
                      reactions, impressions, engagement
                  posts:
                    type: array
                    items:
                      $ref: '#/components/schemas/AnalyticsPostRow'
                  top:
                    type: array
                    items:
                      $ref: '#/components/schemas/AnalyticsPostRow'
                    description: Same as topReactions
                  topReactions:
                    type: array
                    items:
                      $ref: '#/components/schemas/AnalyticsPostRow'
                    description: Up to 5 posts with the most reactions
                  topComments:
                    type: array
                    items:
                      $ref: '#/components/schemas/AnalyticsPostRow'
                    description: Up to 5 posts with the most comments
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    AnalyticsPostRow:
      type: object
      properties:
        id:
          type: string
        group:
          type: string
        content:
          type: string
        thumbnail:
          type:
            - string
            - 'null'
        publishDate:
          type: string
          format: date-time
        releaseURL:
          type:
            - string
            - 'null'
        integrationId:
          type: string
        platform:
          type: string
        channelName:
          type: string
        channelPicture:
          type:
            - string
            - 'null'
        impressions:
          type:
            - integer
            - 'null'
        reactions:
          type:
            - integer
            - 'null'
        comments:
          type:
            - integer
            - 'null'
        shares:
          type:
            - integer
            - 'null'
        engagementRate:
          type:
            - number
            - 'null'
          description: (reactions + comments) / impressions x 100, when all three are known
        previous:
          type:
            - object
            - 'null'
          description: 'The snapshot before the latest one: impressions, reactions, comments'
    NestError:
      type: object
      description: >-
        The standard error shape: validation errors, not-found errors and rate
        limits
      properties:
        statusCode:
          type: integer
        message:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        error:
          type: string
    MessageError:
      type: object
      description: The error shape of most checks written into the public API itself
      properties:
        msg:
          type: string
  responses:
    ValidationError:
      description: The body or query failed validation. `message` lists every problem
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NestError'
          example:
            message:
              - startDate must be a valid ISO 8601 date string
            error: Bad Request
            statusCode: 400
    Unauthorized:
      description: >-
        `No API Key found`, `Invalid API key`, `Invalid OAuth token`, or `No
        subscription found` when the workspace has no subscription
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MessageError'
          example:
            msg: Invalid API key
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Your API key from Connections > API Keys, or an OAuth access token
        (`pos_...`). Send it as it is, with no `Bearer` prefix.

````