Reddit Toxicity Detection API. On each item you fetch.
How likely the item is rude, insulting, harassing, hateful, threatening or profane toward someone (0 to 1). Add analysis=toxicity to any of 7 Reddit endpoints that offer it.
GET /v1/reddit/post?analysis=toxicity
One param on the request. Toxicity on each item.
The Reddit Post API returns each post with analysis.toxicity beside its fields.
curl -G 'https://socialtap.dev/v1/reddit/post' \
--data-urlencode 'url=https://www.reddit.com/r/IAmA/comments/z1c9z/i_am_barack_obama_president_of_the_united_states/' \
--data-urlencode 'analysis=toxicity' \
-H "x-api-key: $SOCIALTAP_API_KEY"// Node 18+: save this as app.mjs (an ES module) and run: node app.mjs
const params = new URLSearchParams({
url: "https://www.reddit.com/r/IAmA/comments/z1c9z/i_am_barack_obama_president_of_the_united_states/",
analysis: "toxicity",
});
const res = await fetch(`https://socialtap.dev/v1/reddit/post?${params}`, {
headers: { "x-api-key": process.env.SOCIALTAP_API_KEY ?? "" },
});
const body = await res.json();
if (!res.ok) throw new Error(`${body.error.code}: ${body.error.message}`);
const { data, meta } = body;
console.log(data, meta.credits_charged);import os
import requests
res = requests.get(
"https://socialtap.dev/v1/reddit/post",
params={"url": "https://www.reddit.com/r/IAmA/comments/z1c9z/i_am_barack_obama_president_of_the_united_states/", "analysis": "toxicity"},
headers={"x-api-key": os.environ["SOCIALTAP_API_KEY"]},
)
body = res.json()
if not res.ok:
raise RuntimeError(f"{body['error']['code']}: {body['error']['message']}")
data, meta = body["data"], body["meta"]
print(data, meta["credits_charged"]){
"toxicity": 0.85
}Values are examples.
GET https://socialtap.dev/v1/reddit/postDocs What the value means.
A number from 0 to 1.
How likely the item is rude, insulting, harassing, hateful, threatening or profane toward someone (0 to 1).
Keep only what matches.
On a list, where keeps the items that pass. Every item judged is charged whether or not it passes, so a page can be short.
https://socialtap.dev/v1/reddit/posts?handle=https://www.reddit.com/user/spez/&analysis=toxicity&where=analysis.toxicity>=0.77 Reddit endpoints offer it.
Each adds the analysis to the posts and comments it returns. Text analyses cost one flat amount per request, or per page on a list, however many you ask for.
-
Post
Reddit Post API
Upvotes, comment count, media and flair
1 credit$0.75–$1.97 per 1,000 requestsGET /v1/reddit/post -
Post
Reddit User Posts API
Submissions sorted New, Top or Hot, with scores
1 credit / page$0.75–$1.97 per 1,000 pagesGET /v1/reddit/posts -
Post
Reddit Search API
Posts by keyword, with Reddit's search operators
1 credit / page$0.75–$1.97 per 1,000 pagesGET /v1/reddit/search_posts -
Post
Reddit Subreddit Posts API
Hot, New, Top or Rising, with exact scores
1 credit / page$0.75–$1.97 per 1,000 pagesGET /v1/reddit/subreddit_posts -
Comment
Reddit Comments API
Post comments and replies, in thread order
1 credit / page$0.75–$1.97 per 1,000 pagesGET /v1/reddit/comments -
Comment
Reddit User Comments API
Comment history of a user, sorted New or Top
1 credit / page$0.75–$1.97 per 1,000 pagesGET /v1/reddit/profile_comments -
Comment
Reddit Comment Search API
Comments by keyword, sitewide or in a subreddit
1 credit / page$0.75–$1.97 per 1,000 pagesGET /v1/reddit/search_comments
| Endpoint | Adds |
|---|---|
| Reddit Post API | +2 credits per request |
| Reddit User Posts API | +44 credits per page of 25 |
| Reddit Search API | +13 credits per page of 7 |
| Reddit Subreddit Posts API | +44 credits per page of 25 |
| Reddit Comments API | +320 credits per page of 200 |
| Reddit User Comments API | +40 credits per page of 25 |
| Reddit Comment Search API | +16 credits per page of 10 |
More analyses on Reddit and beyond.
The same answer on other platforms, and other answers here.
Questions about Reddit toxicity detection
The analyses guide has the rest.
Which Reddit endpoints offer toxicity detection?
How much does an analysis cost?
Do I pay when an analysis can't answer?
Can I get only the items that match?
Which languages do analyses answer in?
Can I use my own categories or questions?
Send your first request in a minute.
Get a key, send a link you already have and see what comes back. The same key works on every platform.
- No credit card
- Failed requests are free
- Works on all 319 endpoints