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

# Platform Analytics

> Get analytics data for a specific integration/channel. Returns metrics like followers, impressions, engagement, etc. depending on the platform.

## Path parameter: `integration`

The `{integration}` path parameter must be the integration's **`id`** (the UUID-shaped string returned by `GET /public/v1/integrations`).

It is **not** the platform `__type` (e.g. `x`, `linkedin`) and **not** the channel display name. Passing either of those returns `500` with the message `Invalid integration`. That is a rough edge rather than a designed status: the lookup throws a plain error. Read it as "no such integration in this organization".

```bash theme={"system"}
# Get the integration ID
curl -H "Authorization: your-api-key" \
  https://api.postqueen.ai/public/v1/integrations

# Use the returned id
curl -H "Authorization: your-api-key" \
  https://api.postqueen.ai/public/v1/analytics/<integration-id>
```

## Common errors

* `500 Invalid integration`: no integration with that id belongs to your organization. A `__type`, a display name or an id from another workspace all land here.
* **Empty array with `200`**: the channel exists but its token expired and could not be refreshed, so PostQueen disconnected it. Reconnect it from the PostQueen UI. There is no `404 Channel not found` on this endpoint.
* Empty data: some platforms (notably Google My Business) restrict analytics by date range or by profile verification status. The endpoint returns an empty payload rather than an error.


## OpenAPI

````yaml GET /analytics/{integration}
openapi: 3.1.0
info:
  title: PostQueen Public API
  description: >-
    API for managing social media posts, integrations, and media uploads in
    PostQueen.


    ## Authentication


    All endpoints require an API key passed in the `Authorization` header:


    ```

    Authorization: your-api-key

    ```


    Get your API key from PostQueen Settings.


    ## Rate Limits


    The create-post endpoint is capped per organization per hour. With
    `API_LIMIT` unset the ceiling is **90 requests per hour**; the shipped
    Compose files and PostQueen Cloud both set it to **30**. No other endpoint
    is throttled.


    ## Terminology


    The UI uses `channel`, but the API uses `integration`. They refer to the
    same thing.


    ## Supported Platforms (34)


    **Social Platforms:** X (Twitter), LinkedIn, LinkedIn Page, Facebook,
    Instagram, Instagram Standalone, Threads, Bluesky, Mastodon, Warpcast
    (Farcaster), Nostr, VK


    **Video Platforms:** YouTube, TikTok


    **Community Platforms:** Reddit, Lemmy, Discord, Slack, Telegram, Kick,
    Twitch


    **Design Platforms:** Pinterest, Dribbble


    **Blogging Platforms:** Medium, Dev.to, Hashnode, WordPress, Moltbook


    **Business:** Google My Business (GMB), Listmonk (newsletters), Whop, Skool
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.postqueen.ai/public/v1
    description: PostQueen Cloud
  - url: https://{host}/api/public/v1
    description: Self-hosted
    variables:
      host:
        default: localhost:4007
        description: Your PostQueen instance domain
security:
  - ApiKeyAuth: []
tags:
  - name: Integrations
    description: Manage connected social media channels
  - name: Posts
    description: Create, list, and delete posts
  - name: Uploads
    description: Upload media files
  - name: Notifications
    description: View organization notifications
  - name: Analytics
    description: View analytics for integrations and posts
  - name: Video Generation
    description: Generate videos with AI
  - name: OAuth
    description: Authorize third-party apps and exchange codes for access tokens
paths:
  /analytics/{integration}:
    get:
      tags:
        - Analytics
      summary: Get platform analytics
      description: >-
        Get analytics data for a specific integration/channel. Returns metrics
        like followers, impressions, engagement, etc. depending on the platform.
      operationId: getAnalytics
      parameters:
        - name: integration
          in: path
          required: true
          description: Integration ID
          schema:
            type: string
        - name: date
          in: query
          required: true
          description: Number of days to look back for analytics data (e.g. 7, 30, 90)
          schema:
            type: string
          example: '7'
      responses:
        '200':
          description: Analytics data for the integration
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AnalyticsData'
              example:
                - label: Followers
                  data:
                    - total: '1250'
                      date: '2025-01-01'
                    - total: '1280'
                      date: '2025-01-02'
                  percentageChange: 2.4
                - label: Impressions
                  data:
                    - total: '5000'
                      date: '2025-01-01'
                    - total: '5200'
                      date: '2025-01-02'
                  percentageChange: 4
components:
  schemas:
    AnalyticsData:
      type: object
      properties:
        label:
          type: string
          description: Metric label (e.g. Followers, Impressions, Likes)
        data:
          type: array
          items:
            type: object
            properties:
              total:
                type: string
                description: Metric value for this date
              date:
                type: string
                description: Date string (YYYY-MM-DD)
        percentageChange:
          type: number
          description: Percentage change over the selected period
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Your PostQueen API key

````