POST /api/analyze
Analyze the sentiment of any given text. Returns a JSON object containing the sentiment score, label, and matched words.
Request Format
{
"text": "Your text here"
}
Example Usage (cURL)
curl -X POST https://commentanalyzer.pages.dev/api/analyze \
-H "Content-Type: application/json" \
-d '{"text":"This is an amazing and wonderful API!"}'
Response Format
{
"text": "This is an amazing and wonderful API!",
"label": "POSITIVE",
"score": 1.2,
"confidence": 0.24,
"matched_tokens": [
["amazing", 0.6],
["wonderful", 0.6]
]
}