Download Markdown

Read Sentiment, Entities & Intents

Posts, comments, reviews and other opinionated documents are analyzed automatically after ingest for three things: sentiment and emotions, mentioned entities, and the author’s intent. By the end of this page you can read results per document, sync them in bulk, and view daily statistics.

Product details, search results and rankings aren’t analyzed.

AnalysisField access neededPer-document endpoint
Sentiment and emotionsaffectGET /v1/documents/{document_id}/affect
EntitiesentitiesGET /v1/documents/{document_id}/entities
IntentsintentsGET /v1/documents/{document_id}/intents

All three work the same way:

  • They read the current version by default; add ?version_id= for another version.
  • Add ?detail=true for probabilities and confidence.
  • Without the matching access they return 403.

Read sentiment and emotions

Bash
curl -sS "$WHALE_BASE_URL/v1/documents/$DOCUMENT_ID/affect" \
  -H "Authorization: Bearer $WHALE_API_KEY"
JSON
{
  "document_id": "doc_01J...",
  "version_id": "ver_01J...",
  "sentiment": {"score": -0.82, "confidence": 0.71, "analyzed_at": "2026-10-26T08:45:43Z"},
  "emotions": {
    "scores": {"anger": 0.64, "disgust": 0.12, "fear": 0.05, "joy": 0.02, "sadness": 0.31, "surprise": 0.04, "neutral": 0.08},
    "labels": ["anger", "sadness"],
    "analyzed_at": "2026-10-26T08:45:43Z"
  }
}
FieldMeaning
sentiment.score-1 to 1; higher is more positive
sentiment.confidence0 to 1, how sure the model is. Don’t use results below 0.4 directly
emotions.scoresStrength of anger, disgust, fear, joy, sadness, surprise and neutral, 0 to 1
emotions.labelsClearly present emotions; can be several or none
  • There’s no positive/neutral/negative label; bucket the score yourself. For example above 0.3 is positive and below -0.3 negative.
  • Documents not analyzed yet have sentiment and emotions set to null.
  • Results may later be replaced by better ones, such as human review. The endpoint always returns the best available.

Read mentioned entities

Brands, products, models, people, places and prices are extracted automatically:

JSON
{
  "document_id": "doc_01J...",
  "version_id": "ver_01J...",
  "analyzed": true,
  "analyzed_at": "2026-10-29T03:48:28Z",
  "entities": [
    {"type": "brand", "text": "Huawei", "norm": "huawei", "sentiment": "positive"},
    {"type": "model", "text": "Mate 60 Pro", "norm": "mate 60 pro"},
    {"type": "location", "text": "Shenzhen", "norm": "shenzhen"},
    {"type": "price", "text": "$999", "norm": "$999"}
  ]
}

Seven type values:

typeMeaning
brandBrand
organizationCompany, institution, platform, media outlet
productProduct, app, game, book, film or show
modelModel or version
personPerson or online handle
locationPlace
priceA price with an amount

Fields:

  • text is as written; norm unifies case and full/half width and removes @, #, title brackets and quotes, for aggregation.
  • Aliases aren’t merged: “Alibaba” and “Alibaba Group” are two entities.
  • sentiment is this document’s attitude toward the brand, organization or product: positive, negative or neutral. Merely mentioning, asking, reporting or official self-promotion counts as neutral.
  • Attitude toward an entity differs from overall sentiment. A post criticizing one brand while praising another can be negative overall but positive toward the second brand.
  • analyzed: false means not analyzed yet; analyzed: true with empty entities means analyzed with no entities.

Accuracy:

  • Brand, organization and product are judged by how the name is used in that document, so the same name can differ across documents (TikTok can be a company or an app). About 85% are classified correctly among the three.
  • Attitude toward entities agrees with human review about 82% of the time. Documents analyzed before 2026-10-30 have no sentiment.
  • Documents with a detected model are reviewed again, and the reviewed result is returned afterwards.
  • ?detail=true adds type_confidence and sentiment_confidence.

Read author intent

What the author wanted to do with the post:

JSON
{
  "document_id": "doc_01J...",
  "version_id": "ver_01J...",
  "intents": {"labels": ["support", "complaint"], "analyzed_at": "2026-10-29T14:02:11Z"}
}

Up to 3 intents per document, most evident first. 14 values:

ValueMeaning
questionAsking for information, usage, rules or prices
recommendationAsking for recommendations
comparisonComparing or torn between options
purchaseWants to buy, or asks where to buy
supportReporting a problem: a fault, error, account or order issue
complaintComplaining
praisePraising
suggestionAsking for a feature or improvement
churnHas stopped or plans to stop using, unsubscribe, return or switch
reviewSharing experience: usage, reviews, tutorials, guides
sellSelling or promoting: listings, affiliate posts, ads
newsReports, launches, announcements
opinionOpinions on a topic
recruitHiring or job seeking
  • Empty labels means no clear intent, such as small talk, greetings or emoji only.
  • Documents not analyzed yet have intents set to null.
  • Intent and sentiment are different: complaints are usually negative, but negative posts aren’t always complaints.

Read in batch

When reading documents in batch, add:

  • "include_affect": true for affect
  • "include_entities": true for entities
  • "include_intents": true for intents

If a document’s analysis fails to load, you get affect_error, entities_error or intents_error; the document itself is unaffected.

Sync all results by time window

To sync analysis results into your own system:

EndpointEach record
GET /v1/affectOne version’s sentiment or emotion result
GET /v1/entitiesOne version’s entities
GET /v1/intentsOne version’s intent labels

Parameters are the same as copying snapshots by window, with analyzed_from and analyzed_to (analysis time) as the time parameters. Up to 1000 per page.

  • Each record carries source_platform, content_type, language and published_at, so you can aggregate directly.
  • Reviewed entity results appear again after review. Keep the last one received per version.
  • A page may have fewer than limit records; rely on whether there’s a next cursor.

View daily statistics

You can see daily totals without pulling every result. Days are UTC dates of analysis time.

Sentiment, emotions and intents

Bash
curl -sS "$WHALE_BASE_URL/v1/stats/affect?source_platform=reddit,x&days=30" \
  -H "Authorization: Bearer $WHALE_API_KEY"
JSON
{
  "from": "2026-10-01",
  "to": "2026-10-30",
  "totals": {
    "sentiment": {"results": 182340, "mean_score": 0.06, "labels": {"negative": 41210, "neutral": 88420, "positive": 52710}},
    "emotion": {"results": 182340, "labels": {"anger": 9120, "joy": 30210, "none": 70110}},
    "intent": {"results": 91200, "labels": {"complaint": 7340, "question": 9810, "none": 41020}}
  },
  "days": [{"date": "2026-10-01", "sentiment": {}, "emotion": {}, "intent": {}}],
  "platforms": [{"platform": "reddit", "sentiment": {}, "emotion": {}, "intent": {}}]
}
  • days: the most recent days including today; default 7, up to 90.
  • source_platform: defaults to all platforms in your access.
  • results is the number of analyzed documents; none is the number with no clear emotion or intent.
  • A document can have several emotions and intents, so labels can add up to more than results.
  • days has an entry for every day, including days without data.
  • sentiment and emotion need affect access; intent needs intents. With only one, you get only that part.

Entity mentions

Bash
curl -sS "$WHALE_BASE_URL/v1/stats/entities?source_platform=reddit&days=30&type=brand&limit=50" \
  -H "Authorization: Bearer $WHALE_API_KEY"
JSON
{
  "from": "2026-10-01",
  "to": "2026-10-30",
  "type": "brand",
  "totals": {"mentions": {"brand": 52310, "product": 80240, "person": 120330}, "versions_without_entities": 301200},
  "days": [{"date": "2026-10-01", "mentions": {"brand": 1720, "product": 2610, "person": 3980}, "versions_without_entities": 9840}],
  "platforms": [{"platform": "reddit", "mentions": {"brand": 30120, "product": 41020, "person": 70110}, "versions_without_entities": 160200}],
  "top": [{"type": "brand", "norm": "xiaomi", "mentions": 1840}]
}
  • Returns daily and per-platform mention counts by type, plus the most-mentioned entities in top.
  • type only affects top. limit defaults to 50, up to 200.

To follow one entity, add entity=brand:Xiaomi (a name alone matches any type). Brands, organizations and products also return entity:

JSON
"entity": {
  "type": "brand",
  "norm": "xiaomi",
  "totals": {"versions": 17188, "sentiments": {"results": 5929, "labels": {"positive": 1180, "negative": 950, "neutral": 3799}}, "intents": {"results": 12327, "labels": {"opinion": 5857, "question": 1944, "complaint": 1210, "none": 3020}}},
  "days": [{"date": "2026-10-29", "versions": 11259, "intents": {"results": 6399, "labels": {"opinion": 2890}}}]
}
  • versions is the number of documents mentioning it each day.
  • sentiments is these documents’ attitude toward it; intents is the intent distribution (needs intents access). For shares, divide by each part’s own results.
  • This part updates every 30 minutes.
  • Statistics use the automatic extraction; later reviews don’t change them.

Statistics limits

  • Statistics are split by platform only. Access limited by language, region or publish time can’t use these two endpoints and returns 403.
  • Sentiment and emotion data starts 2026-10-26; entities and intents start 2026-10-29.

When something fails

See Error codes.