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

NameTypeRequiredMaxDescription
textstringYes2500The text to analyze for sentiment

Response

NameTypeDescription
dataobjectObject containing the sentiment analysis results
data[].labelstringThe sentiment label (Positive, Negative, or Neutral)
data[].confidencenumberConfidence score for the sentiment label (0-1)
metadataobjectMetadata about the sentiment analysis process
metadata.costnumberThe cost of the sentiment analysis request

Errors

{
   "error": "string", 
   "code": "string"
}
HTTP StatusError CodeMessage
400INVALID_PAYLOADOccurs when the payload is invalid.
400INVALID_REQUESTEx.: The request is invalid.
400TEXT_SENTIMENT_ANALYSIS_ERROREx: could not analyze the text sentiment | parsing error
400HARM_CONTENTEx.: The content is harmful and cannot be processed.
400INSUFFICIENT_BALANCEThe user has insufficient balance
401UNAUTHORIZEDEx.: The token is invalid.
429TOO_MANY_REQUESTSEx.: The request limit has been reached.