Sentiment Analysis API
Analyze sentiment in multiple languages using KrosAI’s models
Last updated
Analyze sentiment in multiple languages using KrosAI’s models
Last updated
The KrosAI Sentiment Analysis API analyzes text to determine sentiment and emotional tone, with robust support for African languages. This is particularly useful for understanding customer feedback, social media monitoring, and market research in low-resource languages.
The sentiment analysis API examines text content and returns a sentiment classification (positive, negative, neutral, or mixed) along with confidence scores and optional detailed analysis.
text
string
Yes
The text to analyze (1-5000 characters)
language
string
No
Optional language specification (e.g., "yoruba", "english", "swahili")
model
string
No
Model to use (default: "KrosMlingual2.0.1")
detailed
boolean
No
Whether to include detailed sentiment scores and emotion analysis (default: false)
For analyzing multiple texts in a single request, use the batch endpoint:
Batch Request Example
This returns an array of sentiment analysis results for each text.
The API specializes in African languages, including:
Yoruba
English
Hausa
Igbo
Swahili
Pidgin
Arabic
French
Spanish
Portuguese
Amharic
Zulu
Xhosa
Somali
Oromo
Provide longer text samples for more accurate sentiment analysis
When language is known, specify it for better accuracy
Use detailed analysis for deeper insights into sentiment
All APIs return standard HTTP status codes:
200: Success
400: Bad request (check parameters)
401: Unauthorized (check API key)
429: Rate limit exceeded
500: Server error
Error responses include a detail field with more information about the error.