DEV Community

Olly
Olly

Posted on

Sentiment, language, keywords and readability in a single API call

Triage support tickets, tag reviews or score blog drafts without spinning up a model. TextKit's /analyze returns everything in one response.

Request

import requests
H = {"X-RapidAPI-Key": KEY, "X-RapidAPI-Host": "textkit-sentiment-language-readability-keywords.p.rapidapi.com"}
r = requests.get("https://textkit-sentiment-language-readability-keywords.p.rapidapi.com/sentiment",
                 params={"text": "Terrible service, I want a refund."}, headers=H)
print(r.json())
Enter fullscreen mode Exit fullscreen mode
{"label": "negative", "compound": -0.4215, "negative": 0.369, "neutral": 0.476, "positive": 0.155}
Enter fullscreen mode Exit fullscreen mode

Route anything below -0.3 to a human first.

Endpoints

Endpoint Returns
/sentiment label + scores
/language ISO language code + confidence
/keywords ranked keywords
/readability Flesch, Flesch-Kincaid, SMOG, reading time
/summarize extractive summary
/profanity flag + censored text
/slugify, /stats URL slugs, word and sentence counts
/analyze all of the above in one call

It's fast and deterministic (no LLM), so it's cheap enough to run on every message. Free tier: 500 calls/month. TextKit on RapidAPI

Top comments (0)