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

# Sentiment Analysis

> Sentiment Analysis, 50 credits per call.



## OpenAPI

````yaml /api-reference/openapi.json post /twitter/tweets/sentiment
openapi: 3.1.0
info:
  title: Twitter API Service
  description: |2-

            A comprehensive Twitter API service that provides various Twitter operations including:
            
            * **Search Operations**: Advanced search, hashtags, cashtags
            * **Tweet Operations**: Post, like, retweet, quote, bookmark, delete
            * **User Operations**: Batch user information retrieval
            * **Influencer Operations**: Get tweets from top influencers
            
            All endpoints return standardized responses in the format:
            ```json
            {
                "code": 200,
                "msg": "success", 
                "data": {...}
            }
            ```
            
            ## Authentication
            
            This API uses Bearer token authentication. Include your token in the Authorization header:
            ```
            Authorization: Bearer your_token_here
            ```
            
  contact:
    name: API Support
    email: support@twitterxapi.com
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.twexapi.io
    description: Development server
security: []
paths:
  /twitter/tweets/sentiment:
    post:
      tags:
        - Sentiment Analysis Endpoints
      summary: Sentiment Analysis
      description: Sentiment Analysis, 50 credits per call.
      operationId: sentiment_analysis_endpoint_twitter_tweets_sentiment_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SentimentAnalysisQuery'
        required: true
      responses:
        '200':
          description: A sentiment object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SentimentAnalysisResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    SentimentAnalysisQuery:
      properties:
        text:
          type: string
          title: Text
          description: The text to analyze.
      type: object
      required:
        - text
      title: SentimentAnalysisQuery
    SentimentAnalysisResponse:
      properties:
        code:
          type: integer
          title: Code
          description: The status code of the response.
        msg:
          type: string
          title: Msg
          description: The message of the response.
        data:
          $ref: '#/components/schemas/SentimentAnalysisModel'
          description: The sentiment analysis model.
      type: object
      required:
        - code
        - msg
        - data
      title: SentimentAnalysisResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SentimentAnalysisModel:
      properties:
        tone:
          anyOf:
            - type: string
            - type: 'null'
          title: Tone
          description: >-
            The tone of the text. Positive, Negative, Neutral, Humorous,
            Sarcastic, Enthusiastic, Angry, or Informative
        sentiment:
          anyOf:
            - type: string
            - type: 'null'
          title: Sentiment
          description: The sentiment of the text. Positive, Negative, or Neutral
      type: object
      title: SentimentAnalysisModel
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````