The Sentiment API is a hosted GoEmotions API: send text, get a score for each of the 28 GoEmotions labels, the top emotion and a valence score from -1 to 1. It works in Arabic, English, French, Spanish, German and Turkish, takes up to 10,000 texts per batch request, and costs $0.00089 per short message with no subscription. You pay from prepaid credit, topped up by card.
GoEmotions is Google's fine-grained emotion taxonomy: 27 emotions plus neutral, labelled on 58,000 Reddit comments. It is far more useful than positive/negative when the next action depends on which feeling is present. For the dataset itself, read the GoEmotions dataset explained.
The 28 labels the API returns
Every response includes a score for each of these labels:
admiration, amusement, anger, annoyance, approval, caring, confusion, curiosity, desire, disappointment, disapproval, disgust, embarrassment, excitement, fear, gratitude, grief, joy, love, nervousness, optimism, pride, realization, relief, remorse, sadness, surprise, neutral
Definitions, example sentences and easily confused pairs are on the list of 28 emotions.
Request and response
Submit text, then fetch the job. Requests carry an API key; the API docs have complete Python, JavaScript and curl clients.
POST https://emotions.togoder.click/api/analyze
Content-Type: application/json
Authorization: Bearer sent_...
{"text": "Wait, how does this even work? I'm confused."}
→ 202 {"job_id": "4275bbf5-...", "status": "queued", "cost_atomic": 890, ...}
GET https://emotions.togoder.click/api/jobs/4275bbf5-...
→ 200 {"status": "succeeded", "result": { ... }}The result object, exactly as returned for that text (first four of 28 predictions shown):
{
"text": "Wait, how does this even work? I'm confused.",
"top_emotion": "confusion",
"top_score": 0.9673,
"valence": -0.0841,
"predictions": [
{ "label": "confusion", "score": 0.9673 },
{ "label": "surprise", "score": 0.0596 },
{ "label": "excitement", "score": 0.0522 },
{ "label": "curiosity", "score": 0.0518 }
]
}For volume, POST /api/analyze/batch takes {"texts": [...]} with up to 10,000 entries and returns one job per text.
Real outputs
These are unedited results from the production API on 1 November 2026, one per language family. Scores are rounded to three decimals.
| Text | Language | Top scores | Valence |
|---|---|---|---|
| Wait, how does this even work? I'm confused. | English | confusion 0.967, surprise 0.060, excitement 0.052 | -0.08 |
| Ürünü çok beğendim, teşekkürler! | Turkish | gratitude 0.953, love 0.870, sadness 0.053 | 1.00 |
| انتظرت ساعتين ولم يرد أحد، هذا مخيب للآمال جداً | Arabic | disappointment 0.978, caring 0.052, neutral 0.051 | -0.46 |
The Turkish example shows why multi-label matters: the model gives both gratitude and love high scores, because the text expresses both. A single-label classifier would have to drop one.
Turning scores into labels
Scores are independent sigmoid outputs in [0, 1], not a probability distribution. Common ways to use them:
- Top emotion: use
top_emotionwhen you need exactly one label per text, and keeptop_scoreto filter out uncertain cases. - Threshold per label: treat every label above a cut off (0.3 to 0.5 is a common starting point) as present. Tune the threshold per label on a few hundred of your own labelled texts, because rare labels such as
grieforreliefbehave differently from frequent ones. - Aggregate: average a label's score across many texts (per product, per week) to track trends without thresholds.
- Polarity: use
valencewhere you would use a positive/negative score.
Hosted API vs. self-hosting a GoEmotions model
GoEmotions models are open. You can download a checkpoint from Hugging Face and run it with transformers; many popular ones are English-only. The trade-off is infrastructure, not access:
| Self-hosted model | Sentiment API | |
|---|---|---|
| Cost | Free weights; you pay for GPU or CPU time, even when idle | $0.00089 per short message, nothing when idle |
| Setup | Model serving, batching, scaling, monitoring | One HTTP call |
| Languages | Depends on the checkpoint; many are English-only | ar, en, fr, es, de, tr |
| Control | Full: fine-tune, change thresholds, run offline | Fixed model; you threshold the scores |
| Best for | Steady high volume, private or offline data | Low or bursty volume, agents, prototypes |
If you already run GPUs with steady load, self-hosting is usually cheaper per message. If you don't, the hosted API saves you running inference for a workload that may be a few thousand messages a month. The Python guide shows both approaches side by side.
The model behind it
The API serves AnasAlokla/multilingual_go_emotions_V1.1, an mBERT model fine-tuned for the 28 GoEmotions labels, on serverless GPUs. Scores use a sigmoid head, so labels are independent. Inputs are truncated at 512 tokens. Valence is computed from the emotion scores with fixed weights listed on the emotions page, clamped to [-1, 1].
We do not publish accuracy figures of our own. Results vary by domain and language, so test on a sample of your text before relying on it. See also the comparison of emotion detection APIs.
Frequently asked questions
Is there an API that detects the 28 GoEmotions emotions?
Yes. The Sentiment API runs a multilingual model fine-tuned on the GoEmotions taxonomy and returns a score for each of the 28 labels (27 emotions plus neutral) for every message, along with the top emotion and a valence score from -1 to 1. It is paid per message with no subscription.
Does the API return only the top emotion?
No. Every response contains all 28 labels with their scores, sorted from highest to lowest, plus top_emotion and top_score for convenience. Scores are independent sigmoid outputs, so several emotions can be high at once and they do not sum to 1.
Which languages does the GoEmotions API support?
Arabic, English, French, Spanish, German and Turkish. There is no language parameter; the same endpoint handles all six. The original GoEmotions dataset is English Reddit comments; the model used here is a multilingual (mBERT) variant.
How many texts can I send at once?
Up to 10,000 texts in one POST /api/analyze/batch request, billed as one debit. Each text may be up to 10,000 characters, and the model reads the first 512 tokens.
Can I self-host a GoEmotions model instead?
Yes. GoEmotions checkpoints are freely available on Hugging Face and run with the transformers library. Self-hosting is usually cheapest at steady high volume if you already run GPUs. A hosted API makes sense when volume is low or irregular, or when you do not want to run and scale inference yourself.