RapidAPI logo

Sentiment Analysis

FREEMIUM
By twinword
Updated 6 months ago
Text Analysis
9.4/10
Popularity Score
203ms
Latency
100%
Success Rate

Sentiment Analysis API Documentation

Is this comment positive or negative? Find out the tone.

View API Details
Sentiment Analysis
POSTAnalyze (post)
GETAnalyze (get)
POSTAnalyze (post)

Return sentiment analysis results with score for the given text.

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Required Parameters
textSTRING
REQUIREDEnter some text to analyze (maximum 100 words or 1,500 characters)
Code Snippet
unirest.post("https://twinword-sentiment-analysis.p.rapidapi.com/analyze/")
.header("X-RapidAPI-Host", "twinword-sentiment-analysis.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/x-www-form-urlencoded")
.send("text=great value in its price range!")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
General
Request URL: https://twinword-sentiment-analysis.p.rapidapi.com/analyze/
Request Method: POST
Response Headers
Response Body

Install SDK for NodeJS

Installing

To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

unirest.post("https://twinword-sentiment-analysis.p.rapidapi.com/analyze/")
.header("X-RapidAPI-Host", "twinword-sentiment-analysis.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/x-www-form-urlencoded")
.send("text=great value in its price range!")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication