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

# X post analytics

> Retrieve post analytics for an X profile within a date range. When a post was published from Ordinal, the response includes an ordinalPost object with the linked post's id, title, labels, and campaign.



## OpenAPI

````yaml /api/openapi.json get /analytics/x/{profileId}/posts
openapi: 3.1.0
info:
  title: Ordinal API
  version: 1.0.0
  description: API to create and manage Ordinal workspaces, posts, profiles, and analytics
servers:
  - url: https://app.tryordinal.com/api/v1
    description: Production server
security:
  - bearerAuth: []
tags:
  - name: Analytics
    description: Social media analytics data
  - name: Approvals
    description: Post approval workflows
  - name: Comments
    description: >-
      Post comments for team collaboration. Supports @mentions using the format
      @[Display Name](userId).
  - name: Engagements
    description: Auto-engagements for posts (likes, comments, reposts)
  - name: Invites
    description: Workspace invitations for adding new users
  - name: Labels
    description: Labels for organizing posts
  - name: Instagram
    description: Instagram utilities for location search and tagging
  - name: LinkedIn
    description: LinkedIn utilities for profile lookups, tagging, and mentions
  - name: Posts
    description: Create and manage posts
  - name: Profiles
    description: List connected social profiles
  - name: Slack Boosts
    description: >-
      List connected Slack channels (webhooks), then create and manage slack
      boosts so teams get notified in Slack when posts publish. Requires Slack
      connected with marketing boost channels.
  - name: Subscribers
    description: Post subscribers for notifications
  - name: File Uploads
    description: >-
      Upload files from URLs for use in posts. Supports images (JPEG, PNG, GIF,
      WebP) up to 10 MB and videos (MP4, MOV) up to 350 MB.
  - name: Ideas
    description: >-
      Create and manage content ideas. Ideas are draft posts without scheduled
      dates that can be converted to calendar posts.
  - name: Inline Comments
    description: >-
      Text-anchored comments on specific post content. Read-only API for
      retrieving inline comments across channels.
  - name: Users
    description: Workspace users
  - name: Webhooks
    description: >-
      Create, list, get, update, and delete webhooks to receive real-time event
      notifications
  - name: Workspaces
    description: Workspace information
paths:
  /analytics/x/{profileId}/posts:
    get:
      tags:
        - Analytics
      summary: X post analytics
      description: >-
        Retrieve post analytics for an X profile within a date range. When a
        post was published from Ordinal, the response includes an ordinalPost
        object with the linked post's id, title, labels, and campaign.
      operationId: analytics-x-posts
      parameters:
        - name: profileId
          in: path
          required: true
          description: X profile ID (UUID)
          schema:
            type: string
            format: uuid
        - name: startDate
          in: query
          description: Start date for analytics (defaults to 30 days ago)
          schema:
            type: string
            format: date
        - name: endDate
          in: query
          description: End date for analytics (defaults to today)
          schema:
            type: string
            format: date
      responses:
        '200':
          description: X post analytics
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TwitterPostAnalytics'
              example:
                - id: 550e8400-e29b-41d4-a716-446655440700
                  url: https://x.com/acme/status/1234567890123456789
                  text: >-
                    Excited to share our latest product update! 🚀


                    After months of development, we're launching three new
                    features that will transform how you work.


                    Thread 🧵👇
                  publishedAt: '2024-12-10T14:00:00.000Z'
                  likeCount: 342
                  replyCount: 28
                  retweetCount: 89
                  quoteCount: 15
                  bookmarkCount: 67
                  impressionCount: 45200
                  engagement: 0.01
                  emv: 452
                  ordinalPost:
                    id: 11111111-1111-4111-a111-111111111111
                    title: My Ordinal Post
                    labels:
                      - name: Marketing
                        labelId: 22222222-2222-4222-a222-222222222222
                    campaign:
                      id: 33333333-3333-4333-a333-333333333333
                      name: Q1 Campaign
                - id: 550e8400-e29b-41d4-a716-446655440701
                  url: https://x.com/acme/status/1234567890123456790
                  text: >-
                    5 lessons learned from scaling our startup from 0 to 10k
                    users 📈


                    A thread:
                  publishedAt: '2024-12-05T09:30:00.000Z'
                  likeCount: 1256
                  replyCount: 94
                  retweetCount: 312
                  quoteCount: 48
                  bookmarkCount: 234
                  impressionCount: 89300
                  engagement: 0.019
                  emv: 893
                  ordinalPost: null
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    TwitterPostAnalytics:
      type: object
      required:
        - id
        - url
      properties:
        id:
          type: string
          format: uuid
        url:
          type: string
          format: uri
          description: Twitter post URL
        text:
          type: string
          nullable: true
          description: Tweet text content
        publishedAt:
          type: string
          format: date-time
          nullable: true
        likeCount:
          type: integer
          nullable: true
        replyCount:
          type: integer
          nullable: true
        retweetCount:
          type: integer
          nullable: true
        quoteCount:
          type: integer
          nullable: true
        bookmarkCount:
          type: integer
          nullable: true
        impressionCount:
          type: integer
          nullable: true
        engagement:
          type: number
          nullable: true
          description: >-
            Engagement rate (total engagements / impressions), typically between
            0 and 1
        emv:
          type: number
          nullable: true
          description: Earned Media Value calculated as (impressionCount / 1000) * CPM
        ordinalPost:
          oneOf:
            - $ref: '#/components/schemas/OrdinalPostReference'
            - type: 'null'
          description: >-
            Linked Ordinal post when this external post was published from
            Ordinal, null otherwise
    OrdinalPostReference:
      type: object
      description: Reference to the Ordinal post linked to an external social post
      required:
        - id
        - title
        - labels
      properties:
        id:
          type: string
          format: uuid
          description: Ordinal post ID
        title:
          type: string
          description: Ordinal post title
        labels:
          type: array
          items:
            type: object
            required:
              - name
              - labelId
            properties:
              name:
                type: string
                description: Label name
              labelId:
                type: string
                format: uuid
                description: Label ID
        campaign:
          type: object
          nullable: true
          properties:
            id:
              type: string
              format: uuid
            name:
              type: string
    Error:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
  responses:
    Unauthorized:
      description: Unauthorized - Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: UNAUTHORIZED
            message: Invalid or unauthorized API key
    Forbidden:
      description: Forbidden - Insufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: FORBIDDEN
            message: Engagement profiles cannot be used for analytics
    NotFound:
      description: Not Found - Resource does not exist
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: NOT_FOUND
            message: Post not found or does not belong to this workspace
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authentication. Generate an API key from your workspace
        settings.

````