RapidAPI logo

Sign Up

Log In

IBMWatsonToneAnalyzer

FREE
By dimashirokov
Updated 3 months ago
Text Analysis
3.3/10
Popularity Score
217ms
Latency
100%
Success Rate

IBMWatsonToneAnalyzer API Documentation

Identify emotions, social propensities and writing styles.

View API Details
POSTanalyzeToneFromHtml
POSTanalyzeToneFromText
POSTanalyzeToneFromHtml

Analyzes the tone of a piece of html. The message is analyzed for several tones - social, emotional, and language. For each tone, various traits are derived. For example, conscientiousness, agreeableness, and openness.

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Required Parameters
usernameCREDENTIALS
REQUIREDUsername obtained from IBM Bluemix.
htmlSTRING
REQUIRED HTML document that contains the content to be analyzed. The Tone Analyzer Service supports up to 128KB of text, or about 1000 sentences. Sentences with less than three words cannot be analyzed.
passwordCREDENTIALS
REQUIREDPassword obtained from IBM Bluemix.
Optional Parameters
sentencesSELECT
OPTIONALFilter your response to remove the sentence level analysis. Valid values for sentences are true and false. This parameter defaults to true when it's not set, which means that a sentence level analysis is automatically provided. Change `sentences=false` to filter out the sentence level analysis.
tonesSELECT
OPTIONALFilter the results by a specific tone. Valid values for tones are `emotion`, `language`, and `social`.
Request Snippet
unirest.post("https://IBMWatsonToneAnalyzerdimashirokovV1.p.rapidapi.com/analyzeToneFromHtml")
.header("X-RapidAPI-Host", "IBMWatsonToneAnalyzerdimashirokovV1.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/x-www-form-urlencoded")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
Log inSign up

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://IBMWatsonToneAnalyzerdimashirokovV1.p.rapidapi.com/analyzeToneFromHtml")
.header("X-RapidAPI-Host", "IBMWatsonToneAnalyzerdimashirokovV1.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/x-www-form-urlencoded")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication