Skip to main content
GET
/
api
/
v2
/
analytics
/
sentiments
Get sentiment analytics
curl --request GET \
  --url https://app.livechatai.com/api/v2/analytics/sentiments \
  --header 'Authorization: Bearer <token>'
{
  "status": "success",
  "data": [
    {
      "date": "2024-01-15",
      "POSITIVE": 45,
      "NEGATIVE": 8,
      "NEUTRAL": 22,
      "UNSPECIFIED": 5
    }
  ],
  "keys": [
    "POSITIVE",
    "NEGATIVE",
    "NEUTRAL",
    "UNSPECIFIED"
  ],
  "allSentimentsCounts": [
    {
      "name": "POSITIVE",
      "count": 1250
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

agentId
string
required

The ID of the agent/chatbot

Example:

"clx1234567890abcdef"

startDate
string<date>
required

Start date for analytics (ISO 8601 format)

Example:

"2024-01-01"

endDate
string<date>
required

End date for analytics (ISO 8601 format)

Example:

"2024-01-31"

timezone
string

Timezone for date calculations (defaults to system timezone)

Example:

"America/New_York"

Response

Successfully retrieved sentiment analytics data

status
string
Example:

"success"

data
object[]

Daily sentiment breakdown

keys
string[]

Available sentiment types

Example:
[
"POSITIVE",
"NEGATIVE",
"NEUTRAL",
"UNSPECIFIED"
]
allSentimentsCounts
object[]

Total counts for each sentiment type across the entire period