Overview
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.
Features
- Sentiment Classification: The API for sentiment analysis 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, sentiment API can provide real-time sentiment analysis, making it suitable for live chat, social media monitoring, and other time-sensitive applications.
Getting Started
To access the Sentiment Analysis API , you need to obtain an API key from AnyAPI.io. The API key is used for authentication and should be included in the request URL as a query parameter.
Let’s Try Sign In.
Sentiment Analysis endpoint
Send a GET request to the following URL to Sentiment Analysis
curl --request GET \
--url 'https://anyapi.io/api/v1/sentiment?input=I%20am%20feeling%20great%20today&language=English&apiKey=YOUR_API_KEY'{
"sentiment": "positive",
"score": 0.8,
"language": "English",
"tokens": [
"I",
"am",
"feeling",
"great",
"today"
]
}Request parameters
Use the parameters listed below to customize your request. Mandatory parameters are indicated
Response parameters
The API returns its response in a simple, lightweight JSON format.
Response and error codes
Whenever you make a request that fails for some reason, an error is returned also in the JSON format. The errors include an error code and description, which you can find in detail below.
| Status Code | Type | Details |
|---|---|---|
| 200 | OK | The request was successful. |
| 400 | Bad Request | The request was invalid or cannot be otherwise served. |
| 401 | Unauthorized | Authentication credentials were missing or incorrect. |
| 422 | Quota reached | The request cannot be served due to the application's rate limit having been exhausted for the resource. |
| 404 | Not Found | The requested resource could not be found. |
| 429 | Too Many Requests | The request cannot be served due to the application's rate limit having been exhausted for the resource. |
| 500 | Internal Server Error | Something went wrong on the server. |
| 503 | Service Unavailable | The service is temporarily unavailable. |