Algorithmia: nlp/SentimentAnalysis

FREE
By peckjon
Updated a month ago
Machine Learning
5.7/10
Popularity Score
636ms
Latency
95%
Success Rate

Algorithmia: nlp/SentimentAnalysis API Documentation

Determine positive or negative sentiment from text

View API Details
POSTSentimentAnalysis
POSTSentimentAnalysis

Determine positive or negative sentiment from text

Authorization:

Obtain your API Key from https://algorithmia.com/user#credentials then enter it as "Simple YOURAPIKEY"

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
AuthorizationBASIC
REQUIREDObtain your API Key from https://algorithmia.com/user#credentials then enter it as "Simple YOUR_API_KEY"
Content-TypeSTRING
OPTIONAL
Required Parameters
JSON inputJSON_STRING
REQUIRED
Code Snippet
unirest.post("https://algorithmia-nlp-sentimentanalysis.p.rapidapi.com/nlp/SentimentAnalysis/")
.header("X-RapidAPI-Host", "algorithmia-nlp-sentimentanalysis.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/json")
.send({"document":"I really like eating ice cream in the morning!"})
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
General
Request URL: https://algorithmia-nlp-sentimentanalysis.p.rapidapi.com/nlp/SentimentAnalysis/
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://algorithmia-nlp-sentimentanalysis.p.rapidapi.com/nlp/SentimentAnalysis/")
.header("X-RapidAPI-Host", "algorithmia-nlp-sentimentanalysis.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/json")
.send({"document":"I really like eating ice cream in the morning!"})
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication