Serverless AI Text Sentiment Analysis
AI powered sentiment analysis service that evaluates text sentiment with confidence scores for positive, negative, and neutral sentiments.
Endpoint
Text sentiment analysis with confidence scoring for multiple sentiment labels
POSThttps://api.xtartapp.com/text/sentiment-analysis
*Authentication
You must use a Bearer token provided by the dashboard to use for authentication. Add the token to the Authorization header.
Request body
Name | Type | Required | Max | Description |
---|---|---|---|---|
text | string | Yes | 2500 | The text to analyze for sentiment |
Response
Name | Type | Description |
---|---|---|
data | object | Object containing the sentiment analysis results |
data[].label | string | The sentiment label (Positive, Negative, or Neutral) |
data[].confidence | number | Confidence score for the sentiment label (0-1) |
metadata | object | Metadata about the sentiment analysis process |
metadata.cost | number | The cost of the sentiment analysis request |
Errors
{
"error": "string",
"code": "string"
}
HTTP Status | Error Code | Message |
---|---|---|
400 | INVALID_PAYLOAD | Occurs when the payload is invalid. |
400 | INVALID_REQUEST | Ex.: The request is invalid. |
400 | TEXT_SENTIMENT_ANALYSIS_ERROR | Ex: could not analyze the text sentiment | parsing error |
400 | HARM_CONTENT | Ex.: The content is harmful and cannot be processed. |
400 | INSUFFICIENT_BALANCE | The user has insufficient balance |
401 | UNAUTHORIZED | Ex.: The token is invalid. |
429 | TOO_MANY_REQUESTS | Ex.: The request limit has been reached. |