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

# Get sentiment analytics

> Get sentiment analysis breakdown with daily data for positive, negative, neutral, and unspecified sentiments



## OpenAPI

````yaml get /api/v2/analytics/sentiments
openapi: 3.0.1
info:
  title: LiveChatAI API v2
  description: >-
    LiveChatAI API v2 - Build powerful AI-powered customer support experiences.
    This API follows REST principles with predictable, resource-oriented URLs,
    JSON responses, and standard HTTP methods.
  version: 2.0.0
servers:
  - url: https://app.livechatai.com
    description: Production server
security:
  - bearerAuth: []
paths:
  /api/v2/analytics/sentiments:
    get:
      tags:
        - Analytics
      summary: Get sentiment analytics
      description: >-
        Get sentiment analysis breakdown with daily data for positive, negative,
        neutral, and unspecified sentiments
      parameters:
        - in: query
          name: agentId
          required: true
          schema:
            type: string
            example: clx1234567890abcdef
          description: The ID of the agent/chatbot
        - in: query
          name: startDate
          required: true
          schema:
            type: string
            format: date
            example: '2024-01-01'
          description: Start date for analytics (ISO 8601 format)
        - in: query
          name: endDate
          required: true
          schema:
            type: string
            format: date
            example: '2024-01-31'
          description: End date for analytics (ISO 8601 format)
        - in: query
          name: timezone
          schema:
            type: string
            example: America/New_York
          description: Timezone for date calculations (defaults to system timezone)
      responses:
        '200':
          description: Successfully retrieved sentiment analytics data
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: success
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        date:
                          type: string
                          example: '2024-01-15'
                          description: Date of the sentiment data
                        POSITIVE:
                          type: number
                          example: 45
                          description: Number of positive sentiments
                        NEGATIVE:
                          type: number
                          example: 8
                          description: Number of negative sentiments
                        NEUTRAL:
                          type: number
                          example: 22
                          description: Number of neutral sentiments
                        UNSPECIFIED:
                          type: number
                          example: 5
                          description: Number of unspecified sentiments
                    description: Daily sentiment breakdown
                  keys:
                    type: array
                    items:
                      type: string
                    example:
                      - POSITIVE
                      - NEGATIVE
                      - NEUTRAL
                      - UNSPECIFIED
                    description: Available sentiment types
                  allSentimentsCounts:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                          example: POSITIVE
                          description: Sentiment type
                        count:
                          type: number
                          example: 1250
                          description: Total count for this sentiment type
                    description: >-
                      Total counts for each sentiment type across the entire
                      period
        '400':
          description: Bad request - Missing or invalid parameters
        '401':
          description: Unauthorized - Invalid API token
        '403':
          description: Forbidden - API access not available for plan
        '404':
          description: Chatbot not found or access denied
        '500':
          description: Internal server error
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````