The Sentiment Analysis API is a powerful tool for conducting comprehensive sentiment analysis on textual data. Designed to meet the needs of developers, businesses, and researchers, this API leverages state-of-the-art natural language processing techniques to provide accurate and nuanced insights into the sentiment expressed within text.
Sentiment Classification: The API can classify text into one of three categories: positive, negative, or neutral sentiment. This classification allows for a quick understanding of the emotional tone of the text.
Multi-Language Support: The API supports multiple languages, ensuring it can be utilized in a global context to analyze sentiment in text from various regions (currently supporting English, Spanish and Portuguese).
Real-Time Analysis: With low latency, the API can provide real-time sentiment analysis, making it suitable for live chat, social media monitoring, and other time-sensitive applications.
The Sentiment Analysis API only supports one GET
endpoint. Send the following request to validate an email:
curl -X 'GET' 'https://anyapi.io/api/v1/sentiment?input=I%27m%20feeling%20great%20today&apiKey=<YOUR_API_KEY>'
which returns this payload:
{ "sentiment": "positive", "score": 0.8, "language": "English", "tokens": [ "I", "m", "feeling", "great", "today" ] }
Note: the field score
in the response is a decimal number between 1 and 0.
Another example to run sentiment analysis on a Portuguese input where the language is detected automatically:
curl -X 'GET' 'https://anyapi.io/api/v1/sentiment?input=O%20sol%20brilha%20intensamente%20no%20céu%20azul&apiKey=<YOUR_API_KEY>'
{ "sentiment": "positive", "score": 0.25, "language": "Portuguese", "tokens": [ "O", "sol", "brilha", "intensamente", "no", "c", "u", "azul" ] }
Or pass in the language explicitly to run the classifier:
curl -X 'GET' 'https://anyapi.io/api/v1/sentiment?input=El%20sol%20brilla%20intensamente%20en%20el%20cielo%20azul&language=Spanish&apiKey=<YOUR_API_KEY>'
{ "sentiment": "positive", "score": 0.5, "language": "Spanish", "tokens": [ "El", "sol", "brilla", "intensamente", "en", "el", "cielo", "azul" ] }
This API provides the following endpoints:
Check out the Sentiment Analysis API Docs for more details.