Tweet Sentiment Analysis API

Add sentiment analysis to your app in just a few lines of code

PHP Example

$text = urlencode("I'm a huge fan of Cowboy Bebop");
$url = "$text";
$response = file_get_contents($url);
# {"sentiment": "positive", "score": 0.451951011074}

Python Example

import requests, urllib, pprint
text = urllib.quote_plus("I'm a huge fan of Cowboy Bebop")
url = ""
r = requests.get(url, {"text": text})
# {'sentiment': 'positive', 'score': 0.451951011074}

How does it work?

Sentiment analysis helps you determine whether people are talking positively or negatively about a topic or brand. It's useful when applied to content on social media, where the large numbers of discussions make it almost impossible to monitor manually. With sentiment analysis you can see how people regard your brand, and how that changes over time.

The Tweet Sentiment API was produced by the team behind Chicmi and lets you send small chunks of text - for example Tweets or Facebook Posts - and returns information about whether the sentiment is probably positive, negative or neutral, along with a score indicating how strong that probability is. It does this using natural language processing, breaking the text down into component parts and comparing those parts to a massive database of human-rated historical data.

We've tried to make the sentiment analysis API as easy to implement as possible. When you sign up for a free account you will get an API key. You then just make a simple HTTP request to our website with the tweet text and your API key, and we'll return a JSON object with the sentiment information.

Sign up at Mashape

The API is managed by Mashape, which makes it easy to consume the API. Consume the API and read the documentation here:


Questions or Comments?

If you have compliments, complaints, questions or comments, please get in touch! You can email us at