Detect the emotional tone and sentiment of text (positive, negative, neutral). Optionally get detailed analysis with emotional indicators, confidence scores, and aspect-based sentiment.
$0.02 per request| Parameter | Type | Required | Description |
|---|---|---|---|
| text | string | Yes | Text to analyze (1-10,000 characters) |
| options.detailed | boolean | No | Include emotional indicators and key phrases |
| options.aspects | array | No | Specific topics for aspect-based sentiment (e.g., ["price", "quality"]) |
POST /api/sentiment
Headers:
Content-Type: application/json
PAYMENT-SIGNATURE: [x402 payment signature via Faremeter SDK]
{
"text": "I absolutely love this product! It has exceeded all my expectations and the customer service was outstanding.",
"options": {
"detailed": true
}
}
{
"result": {
"sentiment": "positive",
"confidence": 0.96,
"score": 0.88,
"emotional_indicators": ["love", "exceeded", "outstanding"],
"key_phrases": ["absolutely love", "exceeded expectations", "customer service"]
},
"tokens_used": {
"prompt_tokens": 89,
"completion_tokens": 45,
"total_tokens": 134
}
}
Classification: positive, negative, or neutral
Confidence score from 0.0 to 1.0 (higher = more certain)
Sentiment score from -1.0 (very negative) to +1.0 (very positive)
Array of emotion words found in the text (detailed mode only)
Phrases contributing to sentiment (detailed mode only)
curl https://textmerchant.xyz/api/sentiment/docs/schema