Analyses

Comment kind

What kind of comment it is: a genuine reaction or question, a low-effort generic one, self-promotion, spam, or a scam.

On this page
  1. Value
  2. Filter
  3. Languages
  4. Price
  5. Endpoints

Example

cURL
curl -G 'https://socialtap.dev/v1/tiktok/comment' \
  --data-urlencode 'comment_id=7047599416228234031' \
  --data-urlencode 'url=https://www.tiktok.com/@hankgreen1/video/7047596209028074758' \
  --data-urlencode 'analysis=comment_kind' \
  -H "x-api-key: $SOCIALTAP_API_KEY"
Node.js
// Node 18+: save this as app.mjs (an ES module) and run: node app.mjs
const params = new URLSearchParams({
  comment_id: "7047599416228234031",
  url: "https://www.tiktok.com/@hankgreen1/video/7047596209028074758",
  analysis: "comment_kind",
});
const res = await fetch(`https://socialtap.dev/v1/tiktok/comment?${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);
Python
import os

import requests

res = requests.get(
    "https://socialtap.dev/v1/tiktok/comment",
    params={"comment_id": "7047599416228234031", "url": "https://www.tiktok.com/@hankgreen1/video/7047596209028074758", "analysis": "comment_kind"},
    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"])
Go
package main

import (
	"encoding/json"
	"fmt"
	"log"
	"net/http"
	"net/url"
	"os"
)

func main() {
	q := url.Values{}
	q.Set("comment_id", "7047599416228234031")
	q.Set("url", "https://www.tiktok.com/@hankgreen1/video/7047596209028074758")
	q.Set("analysis", "comment_kind")
	req, err := http.NewRequest("GET", "https://socialtap.dev/v1/tiktok/comment?"+q.Encode(), nil)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("x-api-key", os.Getenv("SOCIALTAP_API_KEY"))
	res, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer res.Body.Close()
	var body struct {
		Data  json.RawMessage `json:"data"`
		Meta  map[string]any  `json:"meta"`
		Error *struct {
			Code    string `json:"code"`
			Message string `json:"message"`
		} `json:"error"`
	}
	if err := json.NewDecoder(res.Body).Decode(&body); err != nil {
		log.Fatal(err)
	}
	if body.Error != nil {
		log.Fatalf("%s: %s", body.Error.Code, body.Error.Message)
	}
	fmt.Println(string(body.Data), body.Meta["credits_charged"])
}
PHP
<?php

$query = http_build_query([
    'comment_id' => '7047599416228234031',
    'url' => 'https://www.tiktok.com/@hankgreen1/video/7047596209028074758',
    'analysis' => 'comment_kind',
]);
$ch = curl_init('https://socialtap.dev/v1/tiktok/comment?' . $query);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => ['x-api-key: ' . getenv('SOCIALTAP_API_KEY')],
]);
$body = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
    throw new RuntimeException($body['error']['code'] . ': ' . $body['error']['message']);
}
print_r($body['data']);
echo $body['meta']['credits_charged'], PHP_EOL;
Ruby
require "json"
require "net/http"

uri = URI("https://socialtap.dev/v1/tiktok/comment")
uri.query = URI.encode_www_form('comment_id' => '7047599416228234031', 'url' => 'https://www.tiktok.com/@hankgreen1/video/7047596209028074758', 'analysis' => 'comment_kind')
req = Net::HTTP::Get.new(uri)
req["x-api-key"] = ENV.fetch("SOCIALTAP_API_KEY")
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
body = JSON.parse(res.body)
raise "#{body["error"]["code"]}: #{body["error"]["message"]}" unless res.is_a?(Net::HTTPSuccess)
pp body["data"]
puts body["meta"]["credits_charged"]
Java
import java.net.URI;
import java.net.URLEncoder;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.charset.StandardCharsets;

public class Main {
    public static void main(String[] args) throws Exception {
        String query = "comment_id=" + encode("7047599416228234031")
            + "&url=" + encode("https://www.tiktok.com/@hankgreen1/video/7047596209028074758")
            + "&analysis=" + encode("comment_kind");
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://socialtap.dev/v1/tiktok/comment?" + query))
            .header("x-api-key", System.getenv("SOCIALTAP_API_KEY"))
            .GET()
            .build();
        HttpResponse<String> response = HttpClient.newHttpClient()
            .send(request, HttpResponse.BodyHandlers.ofString());
        // An error is {"error": {"code", "message", ...}}; success is {data, meta}, meta.credits_charged its price.
        if (response.statusCode() >= 400) throw new RuntimeException(response.body());
        System.out.println(response.body());
    }

    static String encode(String value) {
        return URLEncoder.encode(value, StandardCharsets.UTF_8);
    }
}
.NET
using System.Text.Json;

using var http = new HttpClient();
http.DefaultRequestHeaders.Add("x-api-key", Environment.GetEnvironmentVariable("SOCIALTAP_API_KEY"));

var query = string.Join("&",
    "comment_id=" + Uri.EscapeDataString("7047599416228234031"),
    "url=" + Uri.EscapeDataString("https://www.tiktok.com/@hankgreen1/video/7047596209028074758"),
    "analysis=" + Uri.EscapeDataString("comment_kind"));
var res = await http.GetAsync("https://socialtap.dev/v1/tiktok/comment?" + query);
using var body = JsonDocument.Parse(await res.Content.ReadAsStringAsync());
if (!res.IsSuccessStatusCode)
{
    var error = body.RootElement.GetProperty("error");
    throw new Exception($"{error.GetProperty("code")}: {error.GetProperty("message")}");
}
Console.WriteLine(body.RootElement.GetProperty("data"));
Console.WriteLine(body.RootElement.GetProperty("meta").GetProperty("credits_charged"));
Rust
// Cargo.toml: reqwest = { version = "0.12", features = ["blocking", "json"] }, serde_json = "1"
use std::env;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let res = reqwest::blocking::Client::new()
        .get("https://socialtap.dev/v1/tiktok/comment")
        .query(&[("comment_id", "7047599416228234031"), ("url", "https://www.tiktok.com/@hankgreen1/video/7047596209028074758"), ("analysis", "comment_kind")])
        .header("x-api-key", env::var("SOCIALTAP_API_KEY")?)
        .send()?;
    let ok = res.status().is_success();
    let body: serde_json::Value = res.json()?;
    if !ok {
        return Err(format!("{}: {}", body["error"]["code"], body["error"]["message"]).into());
    }
    println!("{} {}", body["data"], body["meta"]["credits_charged"]);
    Ok(())
}
Shape of data.analysis
{
  "comment_kind": "genuine",
  "comment_kind_probability": 0.85
}

Values are examples.

Value

Ask for it with analysis=comment_kind; each item's analysis object then holds it, judged from the item's words. A value is null when it is unknown, with an analysis_unavailable warning saying why (null values).

analysis.comment_kind: One of the values below. comment_kind_probability beside it: how sure the value is, from 0 to 1.

ValueMeaning
genuinea person's own reaction, opinion, joke, answer or question, short or long, even off the post's topic
low_efforta generic reaction that fits any post and says nothing specific (nice, 🔥, first, a lone tag of a name)
self_promotionpromotes the commenter's own account, channel or product
spamadvertising, links or bot-like text pasted with no part in the conversation
scama fake giveaway, investment, crypto or phishing pitch

Filter

On a list, where keeps the items that pass. Every item judged is charged whether or not it passes, so a page can hold fewer items than limit.

cURL
curl -G 'https://socialtap.dev/v1/tiktok/comments' \
  --data-urlencode 'url=https://www.tiktok.com/@scout2015/video/6718335390845095173' \
  --data-urlencode 'analysis=comment_kind' \
  --data-urlencode 'where=analysis.comment_kind=genuine' \
  -H "x-api-key: $SOCIALTAP_API_KEY"
Node.js
// Node 18+: save this as app.mjs (an ES module) and run: node app.mjs
const params = new URLSearchParams({
  url: "https://www.tiktok.com/@scout2015/video/6718335390845095173",
  analysis: "comment_kind",
  where: "analysis.comment_kind=genuine",
});
const res = await fetch(`https://socialtap.dev/v1/tiktok/comments?${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, page, meta } = body;
console.log(data, meta.credits_charged);
Python
import os

import requests

res = requests.get(
    "https://socialtap.dev/v1/tiktok/comments",
    params={"url": "https://www.tiktok.com/@scout2015/video/6718335390845095173", "analysis": "comment_kind", "where": "analysis.comment_kind=genuine"},
    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, page, meta = body["data"], body["page"], body["meta"]
print(data, meta["credits_charged"])
Go
package main

import (
	"encoding/json"
	"fmt"
	"log"
	"net/http"
	"net/url"
	"os"
)

func main() {
	q := url.Values{}
	q.Set("url", "https://www.tiktok.com/@scout2015/video/6718335390845095173")
	q.Set("analysis", "comment_kind")
	q.Set("where", "analysis.comment_kind=genuine")
	req, err := http.NewRequest("GET", "https://socialtap.dev/v1/tiktok/comments?"+q.Encode(), nil)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("x-api-key", os.Getenv("SOCIALTAP_API_KEY"))
	res, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer res.Body.Close()
	var body struct {
		Data  json.RawMessage `json:"data"`
		Page  json.RawMessage `json:"page"`
		Meta  map[string]any  `json:"meta"`
		Error *struct {
			Code    string `json:"code"`
			Message string `json:"message"`
		} `json:"error"`
	}
	if err := json.NewDecoder(res.Body).Decode(&body); err != nil {
		log.Fatal(err)
	}
	if body.Error != nil {
		log.Fatalf("%s: %s", body.Error.Code, body.Error.Message)
	}
	fmt.Println(string(body.Data), body.Meta["credits_charged"])
}
PHP
<?php

$query = http_build_query([
    'url' => 'https://www.tiktok.com/@scout2015/video/6718335390845095173',
    'analysis' => 'comment_kind',
    'where' => 'analysis.comment_kind=genuine',
]);
$ch = curl_init('https://socialtap.dev/v1/tiktok/comments?' . $query);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => ['x-api-key: ' . getenv('SOCIALTAP_API_KEY')],
]);
$body = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
    throw new RuntimeException($body['error']['code'] . ': ' . $body['error']['message']);
}
print_r($body['data']);
echo $body['meta']['credits_charged'], PHP_EOL;
Ruby
require "json"
require "net/http"

uri = URI("https://socialtap.dev/v1/tiktok/comments")
uri.query = URI.encode_www_form('url' => 'https://www.tiktok.com/@scout2015/video/6718335390845095173', 'analysis' => 'comment_kind', 'where' => 'analysis.comment_kind=genuine')
req = Net::HTTP::Get.new(uri)
req["x-api-key"] = ENV.fetch("SOCIALTAP_API_KEY")
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
body = JSON.parse(res.body)
raise "#{body["error"]["code"]}: #{body["error"]["message"]}" unless res.is_a?(Net::HTTPSuccess)
pp body["data"]
puts body["meta"]["credits_charged"]
Java
import java.net.URI;
import java.net.URLEncoder;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.charset.StandardCharsets;

public class Main {
    public static void main(String[] args) throws Exception {
        String query = "url=" + encode("https://www.tiktok.com/@scout2015/video/6718335390845095173")
            + "&analysis=" + encode("comment_kind")
            + "&where=" + encode("analysis.comment_kind=genuine");
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://socialtap.dev/v1/tiktok/comments?" + query))
            .header("x-api-key", System.getenv("SOCIALTAP_API_KEY"))
            .GET()
            .build();
        HttpResponse<String> response = HttpClient.newHttpClient()
            .send(request, HttpResponse.BodyHandlers.ofString());
        // An error is {"error": {"code", "message", ...}}; success is {data, meta}, meta.credits_charged its price.
        if (response.statusCode() >= 400) throw new RuntimeException(response.body());
        System.out.println(response.body());
    }

    static String encode(String value) {
        return URLEncoder.encode(value, StandardCharsets.UTF_8);
    }
}
.NET
using System.Text.Json;

using var http = new HttpClient();
http.DefaultRequestHeaders.Add("x-api-key", Environment.GetEnvironmentVariable("SOCIALTAP_API_KEY"));

var query = string.Join("&",
    "url=" + Uri.EscapeDataString("https://www.tiktok.com/@scout2015/video/6718335390845095173"),
    "analysis=" + Uri.EscapeDataString("comment_kind"),
    "where=" + Uri.EscapeDataString("analysis.comment_kind=genuine"));
var res = await http.GetAsync("https://socialtap.dev/v1/tiktok/comments?" + query);
using var body = JsonDocument.Parse(await res.Content.ReadAsStringAsync());
if (!res.IsSuccessStatusCode)
{
    var error = body.RootElement.GetProperty("error");
    throw new Exception($"{error.GetProperty("code")}: {error.GetProperty("message")}");
}
Console.WriteLine(body.RootElement.GetProperty("data"));
Console.WriteLine(body.RootElement.GetProperty("meta").GetProperty("credits_charged"));
Rust
// Cargo.toml: reqwest = { version = "0.12", features = ["blocking", "json"] }, serde_json = "1"
use std::env;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let res = reqwest::blocking::Client::new()
        .get("https://socialtap.dev/v1/tiktok/comments")
        .query(&[("url", "https://www.tiktok.com/@scout2015/video/6718335390845095173"), ("analysis", "comment_kind"), ("where", "analysis.comment_kind=genuine")])
        .header("x-api-key", env::var("SOCIALTAP_API_KEY")?)
        .send()?;
    let ok = res.status().is_success();
    let body: serde_json::Value = res.json()?;
    if !ok {
        return Err(format!("{}: {}", body["error"]["code"], body["error"]["message"]).into());
    }
    println!("{} {}", body["data"], body["meta"]["credits_charged"]);
    Ok(())
}

Languages

Answers for items in English, Spanish, Portuguese, French, German, Italian, Dutch, Indonesian, Turkish, Polish, Japanese, Korean, Chinese, Russian, Arabic and Hindi. An item in another language gets null, free, with a warning.

Price

Text. A flat extra per page, however many text analyses you ask for; a single item is a page of one. Each endpoint's reference page states it. An analysis that fails is free. How analyses are priced

Endpoints

26 endpoints offer it, on 14 platforms.

Last updated