Sentiment Analysis

Analyze the sentiment of any text and get back a positive, negative, or neutral classification with a confidence score and full breakdown.

Get API Key

Vue d'ensemble

Cas d'utilisation

  • Monitoring customer feedback and support tickets
  • Analyzing social media mentions and product reviews
  • Preprocessing text for NLP and ML pipelines
  • Real-time moderation of user-generated content

Fonctionnalités

Returns positive, negative, or neutral classification
Confidence score between 0.0 and 1.0
Full breakdown showing proportional scores for all three classes
Works on short phrases and long-form text

Points de terminaison de l'API

Analyze Sentiment

Analyzes the sentiment of the provided text and returns a classification, confidence score, and a full breakdown across all three sentiment classes.

POST
https://requiems.xyz/v1/text/sentiment

Paramètres

Nom Type Requis Description
text string Requis The text to analyze.

Essayez-le

Démo en direct
Requête

The text to analyze.

Champs de réponse

Champ Type Description
sentiment string The dominant sentiment class: positive, negative, or neutral
score number Confidence score for the dominant sentiment, between 0.0 and 1.0
breakdown.positive number Proportional score for positive sentiment (sums to 1.0 with other classes)
breakdown.negative number Proportional score for negative sentiment (sums to 1.0 with other classes)
breakdown.neutral number Proportional score for neutral sentiment (sums to 1.0 with other classes)

Exemples de code

curl -X POST https://requiems.xyz/v1/text/sentiment \
  -H "requiems-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "I absolutely love this product!"}'

Réponses d'erreur

422

unprocessable_entity

Analyze Sentiment (Batch)

Analyzes the sentiment of up to 50 texts in a single request. Results are returned in the same order as the input. Each text counts as one unit of usage.

POST
https://requiems.xyz/v1/text/sentiment/batch

Paramètres

Nom Type Requis Description
texts array<string> Requis The list of texts to analyze. Between 1 and 50 items.

Essayez-le

Démo en direct
Requête

The list of texts to analyze. Between 1 and 50 items.

Champs de réponse

Champ Type Description
results array<object> Sentiment results for each input text, in the same order as the input.
results[].sentiment string The dominant sentiment class: positive, negative, or neutral
results[].score number Confidence score for the dominant sentiment, between 0.0 and 1.0
results[].breakdown.positive number Proportional score for positive sentiment (sums to 1.0 with other classes)
results[].breakdown.negative number Proportional score for negative sentiment (sums to 1.0 with other classes)
results[].breakdown.neutral number Proportional score for neutral sentiment (sums to 1.0 with other classes)
total number Total number of results returned.

Exemples de code

curl -X POST https://requiems.xyz/v1/text/sentiment/batch \
  -H "requiems-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"texts": ["I love this!", "This is terrible.", "The table is there."]}'

Réponses d'erreur

400

bad_request

422

unprocessable_entity

Foire aux questions