Sentiment Analysis API

Sentiment Analysis API

Given a text, it can be automatically classified in categories.These categories can be user defined (positive, negative) or whichever classes you want.
Free Plan $0.00 Monthly Subscribe
300 Requests / Monthly
Free for Lifetime
No Credit Card Required
Starter Plan $29.99 Monthly Subscribe
300,000 Requests / Monthly
Standard Support
Pre-trained statistical models
Ease of use
Pro Plan $149.99 Monthly Subscribe
3,000,000 Requests / Monthly
Standard Support
Pre-trained statistical models
Ease of use
Custom Plan Volume Monthly Contact Us
Any requests volume you need
Pre-trained statistical models
Ease of use
Sentiment Analysis API Code Sample

In Natural Language Processing there is a concept known as Sentiment Analysis. Given a movie review or a tweet, it can be automatically classified in categories. These categories can be user defined (positive, negative) or whichever classes you want.

In case of sentiment analysis, even humans cannot agree on 100% of the cases due to linguistic ambiguities like sarcasm. However state of the art sentiment analysis algorithms trained by thousands of real life examples perform on par with humans.

This API comes pre-trained with tens of thousands of APIs, carefully classified as positive or negative. You don't need to deal with training any model. Just call the API and go!

This API will also identify text with HTML code in it. Just send the HTML text without any worries.


“This restaurant has a lovely atmosphere and the staff is great!” → Positive

“Had an awful time at this cafe. Never seen such rude chefs.” → Negative

“The place was O.K. I really liked the food but the decoration was outdated.” → Neutral

Use Cases for Sentiment Analysis

Brands are relying heavily on analyzing social media monitoring and Sentiment Analysis API in order to measure return on investment (ROI) of their marketing efforts. Since it’s nearly impossible to evaluate every single piece of information generated by users, automated sentiment analysis tools help them save time and money. Whether it’s a movie premier or a new product redesign, they can get real time feedback from customers and analyze the results.

Investment companies also utilize Sentiment Analysis API to sniff rising stars through news search and make automated investment decisions. It would not be possible without Sentiment Analysis API to analyze all the news information instantaneously and invest in stocks before everyone else.

You can also apply thematic analysis to determine the features on which the customers are talking about the most. Sometimes it’s not just the overall sentiment of the review but the individual product features that are important to evaluate. By using thematic categorization brands can track which features are talked about the most and the sentiment toward that specific feature.

Sentiment Analysis API Reference

This API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

Just Getting Started?

Check out our development quickstart guide.


Sentiment Analysis API uses API keys to authenticate requests. You can view and manage your API keys in the Accounts page.

Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.

All requests made to the API must hold a custom HTTP header named "apikey". Implementation differs with each programming language. Below are some samples.

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.


Given a text, it can be automatically classified in categories. These categories can be user defined (positive, negative) or whichever classes you want.


body (required)

Plain text body to process

Location: Body, Data Type: string

** A word enclosed with curly brackets "{ }" in the code means that it is a parameter and it should be replaced with your own values when executing. (also overwriting the curly brackets).

Below is a sample response from the endpoint

If you wish to play around interactively with real values and run code, see...

Rate Limiting

Each subscription has its own rate limit. When you become a member, you start by choosing a rate limit that suits your usage needs. Do not worry; You can upgrade or downgrade your plan at any time. For this reason, instead of starting with a larger plan that you do not need, we can offer you to upgrade your plan after you start with "free" or "gold plan" options and start using the API.

When you reach a rate limit (both daily and monthly), the service will stop responding and returning the HTTP 429 response status code (Too many requests) for each request with the following JSON string body text.

"message":"You have exceeded your daily\/monthly API rate limit. Please review and upgrade your subscription plan at https:\/\/\/subscriptions to continue."

A reminder email will be sent to you when your API usage reaches both 80% and 90%, so that you can take immediate actions such as upgrading your plan in order to prevent your application using the API from being interrupted.

You can also programmatically check your rate limit yourself. As a result of each request made to the APILayer, the following 4 fields provide you with all the necessary information within the HTTP Headers.

x-ratelimit-limit-month: Request limit per month
x-ratelimit-remaining-month: Request limit remaining this month
x-ratelimit-limit-day: Request limit per day
x-ratelimit-remaining-day: Request limit remaining today

You can contact our support unit if you need any assistance with your application regarding to handle the returned result by looking at the header information.

Error Codes

APILayer uses standard HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate a clientside error, which means that failed given the information provided (e.g., a missing parameter, unauthorized access etc.). Codes in the 5xx range indicate an error with APILayer's servers (normally this should'nt happen at all).

If the response code is not 200, it means the operation failed somehow and you may need to take an action accordingly. You can check the response (which will be in JSON format) for a field called 'message' that briefly explains the error reported.

Status Code Explanation
400 - Bad Request The request was unacceptable, often due to missing a required parameter.
401 - Unauthorized No valid API key provided.
404 - Not Found The requested resource doesn't exist.
429 - Too many requests API request limit exceeded. See section Rate Limiting for more info.
5xx - Server Error We have failed to process your request. (You can contact us anytime)

You can always contact for support and ask for more assistance. We'll be glad to assist you with building your product.


  • Review rating
  • Review rating
  • Review rating
  • Review rating
  • Review rating
API rating
1 months ago


  • Review rating
  • Review rating
  • Review rating
  • Review rating
  • Review rating

Verry happy this Plan