RapidAPI logo

Text Classification

FREEMIUM
By twinword
Updated 5 months ago
Text Analysis
7.2/10
Popularity Score
369ms
Latency
100%
Success Rate

Text Classification API Documentation

Classify unstructured data such as articles or text into predefined categories.

View API Details
Text Classification
GETClassify (get)
POSTClassify (post)
GETClassify (get)

Classify text into product categories or contact us to customize and use your own category sets. Enter some text to find its related product categories:

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Required Parameters
textSTRING
REQUIREDEnter some text to find related categories.
Optional Parameters
titleSTRING
OPTIONALEnter title of text (optional).
setSTRING
OPTIONALEnter custom taxonomy set ID (optional). Invalid ID will default to default taxonomy set. Contact us at feedback@twinword.com to set up custom taxonomy set.
Code Snippet
unirest.get("https://twinword-text-classification.p.rapidapi.com/classify/?text=Protect+your+back+with+these+ergonomic+office+chairs.+These+adjustable+chairs+are+cushioned+and+molded+to+ensure+comfort+over+long+hours.+Some+options+feature+breathable+backs+that+let+air+flow+through+to+keep+you+cool+and+add+to+your+comfort+level+on+hot+days.")
.header("X-RapidAPI-Host", "twinword-text-classification.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
General
Request URL: https://twinword-text-classification.p.rapidapi.com/classify/
Request Method: GET
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.get("https://twinword-text-classification.p.rapidapi.com/classify/?text=Protect+your+back+with+these+ergonomic+office+chairs.+These+adjustable+chairs+are+cushioned+and+molded+to+ensure+comfort+over+long+hours.+Some+options+feature+breathable+backs+that+let+air+flow+through+to+keep+you+cool+and+add+to+your+comfort+level+on+hot+days.")
.header("X-RapidAPI-Host", "twinword-text-classification.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication