Analyze the sentiment of text. $0.01 per request.
Send any text — a review, a message, feedback — and get back a sentiment classification, a -1 to 1 score, confidence, and specific detected emotions.
Submitted content is processed by Anthropic's Claude API and is not otherwise stored or logged.
| Method | POST |
|---|---|
| Path | /analyze |
| Content-Type | application/json |
| field | required | description |
|---|---|---|
text | yes | The text to analyze, max 20,000 characters |
curl -X POST https://sentiment-analyzer.pdfextractapi.workers.dev/analyze \
-H "Content-Type: application/json" \
-d '{"text": "This product completely exceeded my expectations, I'"'"'m thrilled!"}'
{
"sentiment": "positive",
"score": 0.9,
"confidence": 0.95,
"emotions": ["excitement", "satisfaction"],
"summary": "Strongly positive, expressing enthusiasm and satisfaction."
}
Errors return a non-200 status with { "error": { "code": "...", "message": "..." } }. Common codes: missing_text, text_too_large.
This endpoint is paid per-request via the x402 protocol (HTTP 402 + USDC). Unpaid requests receive a 402 response with payment instructions.