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

# Get a tweet

> Fetches detailed information about a specific tweet by its ID. Returns a parsed TwitterTweet object with author information, media, metrics, and any referenced tweets (replies, quotes, retweets).

When `expanded=true`, the endpoint returns enhanced data including:
- Complete full text for long-form tweets
- Article content with rich formatting, media, and embedded components (if the tweet contains an article)
- Community information (if the tweet belongs to a community)
- Enhanced structured content

When `expanded=false` or omitted, returns the standard tweet data format.



## OpenAPI

````yaml GET /v1/data/tweet/{id}
openapi: 3.1.0
info:
  title: UTrack API
  version: 1.0.0
  description: API for fetching Twitter/X tweet data and managing WebSocket connections
servers:
  - url: https://api.utrack.club
    description: Production server
security: []
tags:
  - name: Health
    description: Health check endpoints
  - name: Tweets
    description: Twitter/X tweet data endpoints
paths:
  /v1/data/tweet/{id}:
    get:
      tags:
        - Tweets
      summary: Get tweet by ID
      description: >-
        Fetches detailed information about a specific tweet by its ID. Returns a
        parsed TwitterTweet object with author information, media, metrics, and
        any referenced tweets (replies, quotes, retweets).


        When `expanded=true`, the endpoint returns enhanced data including:

        - Complete full text for long-form tweets

        - Article content with rich formatting, media, and embedded components
        (if the tweet contains an article)

        - Community information (if the tweet belongs to a community)

        - Enhanced structured content


        When `expanded=false` or omitted, returns the standard tweet data
        format.
      operationId: getTweetById
      parameters:
        - name: id
          in: path
          required: true
          description: The tweet ID (snowflake ID)
          schema:
            type: string
          example: '1234567890123456789'
        - name: expanded
          in: query
          required: false
          description: >-
            When set to true, returns enhanced tweet data including full text
            for long-form tweets and complete article content with rich
            formatting. When false or omitted, returns standard tweet data.
            Default: false
          schema:
            type: string
            enum:
              - 'true'
              - 'false'
            default: 'false'
          example: 'false'
      responses:
        '200':
          description: Tweet data retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TwitterTweet'
              example:
                id: '1234567890123456789'
                type: TWEET
                created_at: 1609459200000
                author:
                  id: '987654321'
                  handle: example_user
                  private: false
                  verified: true
                  sensitive: false
                  restricted: false
                  joined_at: 1262304000000
                  profile:
                    name: Example User
                    location: San Francisco, CA
                    avatar: https://pbs.twimg.com/profile_images/example.jpg
                    banner: https://pbs.twimg.com/profile_banners/example.jpg
                    pinned: []
                    url:
                      name: example.com
                      url: https://example.com
                      tco: https://t.co/example
                    description:
                      text: Example bio text
                      urls: []
                  metrics:
                    likes: 100
                    media: 50
                    tweets: 1000
                    friends: 200
                    followers: 5000
                    following: 300
                subtweet: null
                reply: null
                quoted: null
                body:
                  text: This is an example tweet
                  urls: []
                  mentions: []
                  components: []
                media:
                  images: []
                  videos: []
                  thumbnails: []
                  proxied: null
                grok: null
                card: null
                poll: null
                article: null
                community: null
                metrics:
                  likes: 10
                  quotes: 2
                  replies: 5
                  retweets: 3
                  advanced: null
        '400':
          description: Bad request - Invalid tweet data or ID mismatch
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: Invalid tweet data
        '401':
          description: Unauthorized - Invalid or missing authentication token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                status: 401
                error: Unauthorized
                message: Invalid or missing token in Authorization header
        '404':
          description: Tweet not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: Couldn't locate this tweet
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                status: 429
                error: Rate Limit Exceeded
                message: Rate limit of 5 requests per second exceeded
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: Internal server error
      security:
        - bearerAuth: []
        - apiKeyQuery: []
components:
  schemas:
    TwitterTweet:
      type: object
      description: Complete detailed version of a Twitter/X post
      properties:
        id:
          type: string
          description: The tweet's snowflake ID
        type:
          type: string
          enum:
            - TWEET
            - RETWEET
            - QUOTE
            - REPLY
          description: The type of the tweet
        created_at:
          type: number
          description: UNIX timestamp of when the tweet was created in milliseconds
        author:
          $ref: '#/components/schemas/TwitterUser'
        subtweet:
          oneOf:
            - $ref: '#/components/schemas/TwitterTweet'
            - type: 'null'
          description: >-
            The subtweet (reply, quote, retweet) referenced by this tweet (if
            any)
        reply:
          oneOf:
            - $ref: '#/components/schemas/ReplyInfo'
            - type: 'null'
          description: Information about who the tweet is replying to (if any)
        quoted:
          oneOf:
            - $ref: '#/components/schemas/QuotedInfo'
            - type: 'null'
          description: Information about who the tweet is quoting (if any)
        body:
          $ref: '#/components/schemas/TweetBody'
        media:
          $ref: '#/components/schemas/TweetMedia'
        grok:
          oneOf:
            - $ref: '#/components/schemas/GrokInfo'
            - type: 'null'
          description: Embedded Grok xAI conversation preview in the tweet (if any)
        card:
          oneOf:
            - $ref: '#/components/schemas/CardInfo'
            - type: 'null'
          description: Information about an embedded card within the tweet (if any)
        poll:
          oneOf:
            - $ref: '#/components/schemas/PollInfo'
            - type: 'null'
          description: Information about a poll within the tweet (if any)
        article:
          oneOf:
            - $ref: '#/components/schemas/ArticleInfo'
            - type: 'null'
          description: Information about an article within the tweet (if any)
        community:
          oneOf:
            - $ref: '#/components/schemas/CommunityInfo'
            - type: 'null'
          description: >-
            Information about the community the tweet belongs to (if any). Only
            available when expanded=true
        metrics:
          $ref: '#/components/schemas/TweetMetrics'
      required:
        - id
        - type
        - created_at
        - author
        - body
        - media
        - metrics
    ErrorResponse:
      type: object
      properties:
        status:
          type: number
          description: HTTP status code
        error:
          type: string
          description: Error type
        message:
          type: string
          description: Error message
    TwitterUser:
      type: object
      description: Complete detailed version of a Twitter/X user profile
      properties:
        id:
          type: string
          description: The user's account ID
        handle:
          type: string
          description: The user's account handle (without @)
        private:
          type: boolean
          description: If the user's account is currently private
        verified:
          type: boolean
          description: If the user's account is blue check mark verified
        sensitive:
          type: boolean
          description: If the user's account is marked to contain sensitive information
        restricted:
          type: boolean
          description: If the user's account is currently restricted for unusual activity
        joined_at:
          type: number
          description: UNIX timestamp of when the user joined Twitter in milliseconds
        profile:
          $ref: '#/components/schemas/UserProfile'
        metrics:
          $ref: '#/components/schemas/UserMetrics'
      required:
        - id
        - handle
        - private
        - verified
        - sensitive
        - restricted
        - joined_at
        - profile
        - metrics
    ReplyInfo:
      type: object
      properties:
        id:
          type: string
          description: The account ID of the user who was replied to
        handle:
          type: string
          description: The account handle (without @) of the user who was replied to
      required:
        - id
        - handle
    QuotedInfo:
      type: object
      properties:
        id:
          type: string
          description: The account ID of the user who was quoted
        handle:
          type: string
          description: The account handle (without @) of the user who was quoted
      required:
        - id
        - handle
    TweetBody:
      type: object
      properties:
        text:
          type: string
          description: The plain text of the tweet body
        urls:
          type: array
          items:
            $ref: '#/components/schemas/UrlInfo'
          description: List of clickable URLs contained in the tweet
        mentions:
          type: array
          items:
            $ref: '#/components/schemas/MentionInfo'
          description: List of mentioned users in the tweet
        components:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/TextComponent'
              - $ref: '#/components/schemas/ImageComponent'
              - $ref: '#/components/schemas/VideoComponent'
          description: List of structured components for expanded rich/long tweets
      required:
        - text
        - urls
        - mentions
        - components
    TweetMedia:
      type: object
      properties:
        images:
          type: array
          items:
            type: string
          description: List of image URLs in the tweet
        videos:
          type: array
          items:
            type: string
          description: List of video URLs in the tweet
        thumbnails:
          type: array
          items:
            type: string
          description: List of video thumbnail URLs
        proxied:
          oneOf:
            - $ref: '#/components/schemas/ProxiedMedia'
            - type: 'null'
          description: Proxied media URLs (only available in certain scenarios)
      required:
        - images
        - videos
        - thumbnails
        - proxied
    GrokInfo:
      type: object
      properties:
        id:
          type: string
          description: The ID of the Grok conversation
        conversation:
          type: array
          items:
            $ref: '#/components/schemas/GrokMessage'
          description: Preview information of the Grok conversation
      required:
        - id
        - conversation
    CardInfo:
      type: object
      properties:
        url:
          type: string
          description: The original URL of the card
        image:
          type: string
          description: The thumbnail image URL of the card
        title:
          type: string
          description: The title text of the card
        description:
          type: string
          description: The description text of the card
      required:
        - url
        - image
        - title
        - description
    PollInfo:
      type: object
      properties:
        ends_at:
          type: number
          description: UNIX timestamp of when the poll ends in milliseconds
        updated_at:
          type: number
          description: UNIX timestamp of when the poll was last updated in milliseconds
        choices:
          type: array
          items:
            $ref: '#/components/schemas/PollChoice'
          description: List of poll choices
      required:
        - ends_at
        - updated_at
        - choices
    ArticleInfo:
      type: object
      properties:
        id:
          type: string
          description: The article's snowflake ID
        title:
          type: string
          description: The title text of the article
        thumbnail:
          oneOf:
            - type: string
            - type: 'null'
          description: The thumbnail image URL of the article
        created_at:
          type: number
          description: UNIX timestamp of when the article was created in milliseconds
        updated_at:
          type: number
          description: UNIX timestamp of when the article was last updated in milliseconds
        body:
          $ref: '#/components/schemas/ArticleBody'
      required:
        - id
        - title
        - thumbnail
        - created_at
        - updated_at
        - body
    CommunityInfo:
      type: object
      description: Information about the community the tweet belongs to
      properties:
        id:
          type: string
          description: The community's snowflake ID
        name:
          type: string
          description: The community's name
        description:
          type: string
          description: The community's description
        created_at:
          type: number
          description: UNIX timestamp of when the community was created in milliseconds
        is_nsfw:
          type: boolean
          description: If the community is marked as NSFW
        join_policy:
          type: string
          description: The join policy (e.g., "Open")
        member_count:
          type: number
          description: The number of members in the community
        moderator_count:
          type: number
          description: The number of moderators in the community
        role:
          type: string
          description: The author's role in the community (e.g., "Admin", "NonMember")
        banner:
          oneOf:
            - type: string
            - type: 'null'
          description: The community's banner image URL
        rules:
          type: array
          items:
            $ref: '#/components/schemas/CommunityRule'
          description: The list of community rules
        members_facepile:
          type: array
          items:
            $ref: '#/components/schemas/CommunityMemberFacepile'
          description: The list of member avatars shown in the facepile
      required:
        - id
        - name
        - description
        - created_at
        - is_nsfw
        - join_policy
        - member_count
        - moderator_count
        - role
        - banner
        - rules
        - members_facepile
    TweetMetrics:
      type: object
      properties:
        likes:
          type: number
          description: Number of likes on the tweet
        quotes:
          type: number
          description: Number of quotes on the tweet
        replies:
          type: number
          description: Number of replies on the tweet
        retweets:
          type: number
          description: Number of retweets on the tweet
        advanced:
          oneOf:
            - $ref: '#/components/schemas/AdvancedMetrics'
            - type: 'null'
          description: Advanced metrics (may be null, requires expanded version)
      required:
        - likes
        - quotes
        - replies
        - retweets
        - advanced
    UserProfile:
      type: object
      properties:
        name:
          type: string
          description: The user's profile display name
        location:
          oneOf:
            - type: string
            - type: 'null'
          description: The user's profile location
        avatar:
          oneOf:
            - type: string
            - type: 'null'
          description: The user's custom profile avatar URL
        banner:
          oneOf:
            - type: string
            - type: 'null'
          description: The user's custom profile banner URL
        pinned:
          type: array
          items:
            type: string
          description: List of pinned tweet IDs
        url:
          oneOf:
            - $ref: '#/components/schemas/ProfileUrl'
            - type: 'null'
          description: The user's profile custom link information
        description:
          $ref: '#/components/schemas/ProfileDescription'
      required:
        - name
        - location
        - avatar
        - banner
        - pinned
        - url
        - description
    UserMetrics:
      type: object
      properties:
        likes:
          type: number
          description: Number of liked tweets by the user
        media:
          type: number
          description: Number of media (images, videos, gifs) posted by the user
        tweets:
          type: number
          description: Number of tweets posted by the user
        friends:
          type: number
          description: Number of friends (mutual follows)
        followers:
          type: number
          description: Number of followers
        following:
          type: number
          description: Number of accounts followed by the user
      required:
        - likes
        - media
        - tweets
        - friends
        - followers
        - following
    UrlInfo:
      type: object
      properties:
        name:
          type: string
          description: The display name of the URL
        url:
          type: string
          description: The original URL value
        tco:
          type: string
          description: The Twitter t.co wrapped URL variant
      required:
        - name
        - url
        - tco
    MentionInfo:
      type: object
      properties:
        id:
          type: string
          description: The mentioned user's account ID
        name:
          type: string
          description: The mentioned user's display name
        handle:
          type: string
          description: The mentioned user's account handle (without @)
      required:
        - id
        - name
        - handle
    TextComponent:
      type: object
      properties:
        type:
          type: string
          enum:
            - text
        text:
          type: string
        bold:
          type: boolean
        italics:
          type: boolean
      required:
        - type
        - text
        - bold
        - italics
    ImageComponent:
      type: object
      properties:
        type:
          type: string
          enum:
            - image
        url:
          type: string
      required:
        - type
        - url
    VideoComponent:
      type: object
      properties:
        type:
          type: string
          enum:
            - video
        url:
          type: string
      required:
        - type
        - url
    ProxiedMedia:
      type: object
      properties:
        images:
          type: array
          items:
            type: string
          description: List of proxied image URLs
        thumbnails:
          type: array
          items:
            type: string
          description: List of proxied thumbnail URLs
      required:
        - images
        - thumbnails
    GrokMessage:
      type: object
      properties:
        from:
          type: string
          enum:
            - USER
            - AGENT
          description: Who is the sender of the message
        message:
          type: string
          description: The text of the message
        images:
          type: array
          items:
            type: string
          description: List of image URLs in the message
      required:
        - from
        - message
        - images
    PollChoice:
      type: object
      properties:
        label:
          type: string
          description: The label text of the poll choice
        count:
          type: number
          description: The number of votes for the poll choice
        image:
          oneOf:
            - type: string
            - type: 'null'
          description: Image URL for the poll choice (if available)
      required:
        - label
        - count
    ArticleBody:
      type: object
      properties:
        text:
          type: string
          description: The plain text of the article body
        components:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/ArticleDivider'
              - $ref: '#/components/schemas/ArticleText'
              - $ref: '#/components/schemas/ArticleMedia'
              - $ref: '#/components/schemas/ArticleTweet'
          description: >-
            List of components representing rich structured content within the
            article
      required:
        - text
        - components
    CommunityRule:
      type: object
      properties:
        id:
          type: string
          description: The rule's ID
        name:
          type: string
          description: The rule's name
      required:
        - id
        - name
    CommunityMemberFacepile:
      type: object
      properties:
        id:
          type: string
          description: The user's account ID
        handle:
          type: string
          description: The user's account handle (without @)
        name:
          type: string
          description: The user's display name
        avatar:
          oneOf:
            - type: string
            - type: 'null'
          description: The user's avatar URL
      required:
        - id
        - handle
        - name
        - avatar
    AdvancedMetrics:
      type: object
      properties:
        views:
          type: number
          description: Number of views on the tweet
      required:
        - views
    ProfileUrl:
      type: object
      properties:
        name:
          type: string
          description: The display name of the link
        url:
          type: string
          description: The original URL of the link
        tco:
          type: string
          description: The Twitter t.co wrapped URL variant
      required:
        - name
        - url
        - tco
    ProfileDescription:
      type: object
      properties:
        text:
          type: string
          description: The plain text of the description
        urls:
          type: array
          items:
            $ref: '#/components/schemas/UrlInfo'
          description: List of clickable URLs contained in the description
      required:
        - text
        - urls
    ArticleDivider:
      type: object
      properties:
        type:
          type: string
          enum:
            - divider
      required:
        - type
    ArticleText:
      type: object
      properties:
        type:
          type: string
          enum:
            - text
        variant:
          type: string
          enum:
            - header-one
            - header-two
            - paragraph
            - blockquote
            - ordered-list
            - unordered-list
            - latex-box
            - markdown-box
        lines:
          type: array
          items:
            $ref: '#/components/schemas/ArticleLine'
      required:
        - type
        - variant
        - lines
    ArticleMedia:
      type: object
      properties:
        type:
          type: string
          enum:
            - media
        variant:
          type: string
          enum:
            - image
            - gif
            - video
        url:
          type: string
        thumbnail:
          type: string
        caption:
          oneOf:
            - type: string
            - type: 'null'
      required:
        - type
        - variant
        - url
        - thumbnail
        - caption
    ArticleTweet:
      type: object
      properties:
        type:
          type: string
          enum:
            - tweet
        tweet:
          type: object
          properties:
            id:
              type: string
            url:
              type: string
            object:
              oneOf:
                - $ref: '#/components/schemas/TwitterTweet'
                - type: 'null'
          required:
            - id
            - url
            - object
      required:
        - type
        - tweet
    ArticleLine:
      type: object
      properties:
        text:
          type: string
        styles:
          type: array
          items:
            $ref: '#/components/schemas/TextStyle'
        urls:
          type: array
          items:
            $ref: '#/components/schemas/TextUrl'
      required:
        - text
        - styles
        - urls
    TextStyle:
      type: object
      properties:
        from:
          type: number
        to:
          type: number
        text:
          type: string
          enum:
            - bold
            - italics
            - strikethrough
      required:
        - from
        - to
        - text
    TextUrl:
      type: object
      properties:
        from:
          type: number
        to:
          type: number
        url:
          type: string
      required:
        - from
        - to
        - url
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Authentication token passed in the Authorization header as 'Bearer
        <token>'
    apiKeyQuery:
      type: apiKey
      in: query
      name: token
      description: >-
        Authentication token passed as a query parameter (less secure, prefer
        Authorization header)

````