The Retrieve Sentiment from Text API is an advanced text analysis solution that allows you to identify the emotional tone of any written content. This tool processes a text input and returns a detailed analysis that includes the overall sentiment classification (positive, negative, or neutral), along with a confidence score and a percentage breakdown of each category.
The API response includes a sentiment field that indicates the dominant sentiment, as well as a score and confidence level that reflect how clear the emotional trend of the text is. In addition, the breakdown section breaks down the percentages of positivity, negativity, and neutrality, allowing you to understand the emotional nuances even in mixed or ambiguous texts.
Another notable feature is the extraction of emotional keywords, identified as responsible for the detected tone, which is useful for optimizing content, adjusting advertising campaigns, or tracking online reputation. The analysis also includes a component of basic emotions (joy, sadness, fear, surprise, disgust, and anger), ideal for computational psychology tasks, customer monitoring, or real-time conversation analysis.
In addition, the subjectivity of the text is calculated, indicating whether it is an opinion or an objective statement. This is useful in contexts such as media analysis, product evaluations, or open survey analysis.
With a fast and accurate response (low processingTime), this API is designed to be easily integrated into customer service, marketing, human resources, social platforms, virtual assistants, and much more. Its flexible design and multi-language support allow it to be implemented in both web and mobile applications.
In summary, the Retrieve Sentiment from Text API offers deep insight into the emotional content of language, helping businesses and developers better understand human interactions, improve the user experience, and make decisions based on accurate emotional data.
To use this endpoint, you must specify text in the parameter.
Sentiment Analyzer - Endpoint Features
| Object | Description |
|---|---|
Request Body |
[Required] Json |
{"success":true,"data":{"sentiment":"neutral","confidence":0.01,"score":0,"breakdown":{"positive":0,"negative":0,"neutral":1},"wordCount":2,"sentimentWords":{"positive":[],"negative":[]},"emotions":{"joy":0,"anger":0,"fear":0,"sadness":0,"surprise":0,"disgust":0},"subjectivity":0},"timestamp":"2025-07-28T16:55:29.762Z","processingTime":4}
curl --location --request POST 'https://zylalabs.com/api/9161/retrieve+sentiment+from+text+api/16568/sentiment+analyzer' --header 'Authorization: Bearer YOUR_API_KEY'
--data-raw '{
"text": "Hello world",
"language": "en"
}'
| Header | Description |
|---|---|
Authorization
|
[Required] Should be Bearer access_key. See "Your API Access Key" above when you are subscribed. |
No long-term commitment. Upgrade, downgrade, or cancel anytime. Free Trial includes up to 50 requests.
The Sentiment Analyzer endpoint returns a detailed analysis of the input text, including overall sentiment classification (positive, negative, neutral), a confidence score, a percentage breakdown of sentiment categories, emotional keywords, basic emotions, and subjectivity.
Key fields in the response include "sentiment" (dominant sentiment), "confidence" (certainty of the classification), "breakdown" (percentage of positivity, negativity, neutrality), "keywords" (emotional keywords), "emotions" (basic emotions detected), and "subjectivity" (opinion vs. objective).
The response data is structured in a JSON format, with top-level fields for sentiment analysis results. Each field provides specific insights, such as sentiment classification, confidence levels, and detailed breakdowns, making it easy to parse and utilize programmatically.
The primary parameter for the Sentiment Analyzer endpoint is "text," which requires the input string to be analyzed. Users can customize their requests by providing different text inputs to receive tailored sentiment analysis results.
Typical use cases include monitoring customer feedback, optimizing marketing content, analyzing social media interactions, conducting sentiment analysis in surveys, and enhancing user experience in chatbots or virtual assistants.
Data accuracy is maintained through advanced natural language processing algorithms that continuously learn from diverse text samples. Regular updates and quality checks ensure the model adapts to language nuances and evolving sentiment expressions.
Users can leverage the returned data to identify trends in customer sentiment, tailor marketing strategies based on emotional insights, and enhance product development by understanding user opinions and emotions reflected in the text.
If the input text is too short or ambiguous, the API may return lower confidence scores or incomplete analyses. Users should ensure the text is sufficiently descriptive and consider implementing fallback mechanisms for handling such cases.
Please have a look at our Refund Policy: https://zylalabs.com/terms#refund
To obtain your API key, you first need to sign in to your account and subscribe to the API you want to use. Once subscribed, go to your Profile, open the Subscription section, and select the specific API. Your API key will be available there and can be used to authenticate your requests.
You can’t switch APIs during the free trial. If you subscribe to a different API, your trial will end and the new subscription will start as a paid plan.
If you don’t cancel before the 7th day, your free trial will end automatically and your subscription will switch to a paid plan under the same plan you originally subscribed to, meaning you will be charged and gain access to the API calls included in that plan.
The free trial ends when you reach 50 API requests or after 7 days, whichever comes first.
No, the free trial is available only once, so we recommend using it on the API that interests you the most. Most of our APIs offer a free trial, but some may not include this option.
Yes, we offer a 7-day free trial that allows you to make up to 50 API calls at no cost, so you can test our APIs without any commitment.
Zyla API Hub is like a big store for APIs, where you can find thousands of them all in one place. We also offer dedicated support and real-time monitoring of all APIs. Once you sign up, you can pick and choose which APIs you want to use. Just remember, each API needs its own subscription. But if you subscribe to multiple ones, you'll use the same key for all of them, making things easier for you.
Service Level:
100%
Response Time:
20ms
Service Level:
100%
Response Time:
19ms
Service Level:
100%
Response Time:
1,884ms
Service Level:
100%
Response Time:
379ms
Service Level:
100%
Response Time:
884ms
Service Level:
100%
Response Time:
1,545ms
Service Level:
100%
Response Time:
295ms
Service Level:
100%
Response Time:
822ms
Service Level:
100%
Response Time:
336ms
Service Level:
100%
Response Time:
2,061ms
Service Level:
100%
Response Time:
1,072ms
Service Level:
40%
Response Time:
370ms
Service Level:
100%
Response Time:
10,266ms
Service Level:
100%
Response Time:
138ms
Service Level:
100%
Response Time:
1,710ms
Service Level:
100%
Response Time:
1,094ms
Service Level:
100%
Response Time:
820ms
Service Level:
100%
Response Time:
19ms
Service Level:
100%
Response Time:
95ms
Service Level:
100%
Response Time:
437ms