Spam Detector

Spam Detector

Spam Detector determines if the message is spam.

This tool is used for automatic filtering of user-generated content.

Availability 24/7

The tool is available any time, every day of the year and from anywhere to give you the opportunity to use the tool when you need it and where you need it from.

Supported Languages

At present the tool supports following languages: English, Russian, German, Ukrainian, Belarusian. If you want to use additional languages, please contact us.

Complete documentation

The tool has complete documentation to help you integrate your applications with our service as quickly as possible and get started.

Spam Detector is used successfully in applications where a user can add information, for instance internet shops, blogs, communities, chats, messengers, etc. and as a developer tool for the rapid implementation of software components related to analysis and processing of large volume of text information in real time.

Starter
Free

300 requests/day

$0.0300 per extra ₽1.5300 per extra €0.0267 per extra
API Log History
SSL support
1 IP
Text length < 300 characters
the most popular
Business
$19/month 969/month 16.91/month

1,000 requests/day

$0.0100 per extra ₽0.5100 per extra €0.0089 per extra
API Log History
SSL support
2 IPs
Text length < 1,000 characters
HTML support
Email support
Ultra
$79/month 4,029/month 70.31/month

10,000 requests/day

$0.0010 per extra ₽0.0510 per extra €0.0009 per extra
API Log History
SSL support
5 IPs
Text length < 10,000 characters
HTML support
Priority email support

For custom pricing, features and SLAs contact us.

Basic and extended responses

Parameters

ParameterBasicExtended
The confidence that a result is correct

Formats

FormatBasicExtended
JavaScript objects
JavaScript objects, with specified callback function
YAML documents
XML documents
MessagePack objects

To perform an action using the TextTemperature API, you need to send a request via HTTP to its endpoint specifying an API method, its parameters and a response format. You will then receive an API response in specified format.

Check your IPs entered correct and run a code sample:

curl -X GET "https://tt-api.tech/1.0/ping" \
        -H "Authorization: Token YOUR_API_KEY" \
        -H "Content-Type: application/json" \
        -H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "https://tt-api.tech/1.0/ping",
    "method": "GET",
    "headers": {
        "authorization": "Token YOUR_API_KEY"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});
require 'uri'
require 'net/http'

url = URI("https://tt-api.tech/1.0/ping")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Token YOUR_API_KEY'

response = http.request(request)
puts response.read_body
import requests

url = "https://tt-api.tech/1.0/ping"

headers = {'authorization': 'Token YOUR_API_KEY'}

response = requests.request("GET", url, headers=headers)

print(response.text)
var https = require("https");

var options = {
    "method": "GET",
    "hostname": "tt-api.tech",
    "path": "/1.0/ping",
    "headers": {
        "authorization": "Token YOUR_API_KEY"
    }
};

var req = https.request(options, function (res) {
    var chunks = [];

    res.on("data", function (chunk) {
        chunks.push(chunk);
    });

    res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
    });
});

req.end();
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://tt-api.tech/1.0/ping",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "authorization: Token YOUR_API_KEY"
    ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
    echo "cURL Error #:" . $err;
} else {
    echo $response;
}
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://tt-api.tech/1.0/ping"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("authorization", "Token YOUR_API_KEY")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}

{
    "result": "Welcome to TextTemperature!"
}

API authentication

To make requests include your API key in the Authorization header in every request.

Authorization: Token YOUR_API_KEY

Endpoint Definition

We support both GET and POST methods to request the API:

GET
https://tt-api.tech/1.0/spam?txt=[...]&lang=[...]

or

POST
https://tt-api.tech/1.0/spam

Request parameters

ParameterRequiredTypeDescription
txtStringAnalysed text
langStringLanguage code (ISO 639-3)

Request formats

FormatDescription
Form-DataHTML multipart form data
JSONJavaScript object

How to pass parameters:

Form Data:
curl -X POST "https://tt-api.tech/1.0/spam" \
            -H "Authorization: Token YOUR_API_KEY" \
            -H "Content-Type: application/x-www-form-urlencoded" \
            -H "Accept: application/json" \
            -d "txt=[...]&lang=[...]" 
JSON:
curl -X POST "https://tt-api.tech/1.0/spam" \
            -H "Authorization: Token YOUR_API_KEY" \
            -H "Content-Type: application/json" \
            -H "Accept: application/json" \
            -d '{"txt": "[...]","lang": "[...]"}' 
Language code (ISO 639-3)Language nameStatus
engEnglishSupported
rusRussianSupported
deuGermanSupported
ukrUkrainianSupported
belBelarusianSupported

If you want to use additional languages, please contact us.

Response parameters

ParameterTypeDescription
spam
confidenceFloat, ∈ [0.0; 1.0]The confidence that a result is correct

Response codes

CodeValueDescription
OK200Request completed successfully.
ERR_KEY_INVALID401Invalid API key.
ERR_ACCOUNT_INACTIVE403Your account is inactive.
ERR_METHOD_IS_NOT_FOUND404API Method is not found.
ERR_METHOD_IS_NOT_ALLOWED405Method is not allowed.
ERR_FORMAT_NOT_ACCEPTABLE406The specified response format is not acceptable.
ERR_PARAM_NOT_SUPPORTED412The specified parameter is not supported.
ERR_TOO_MANY_REQUESTS429Too Many Requests.

Response formats

FormatDescription
JSONJavaScript objects
JSONPJavaScript objects, with specified callback function
YAMLYAML documents
XMLXML documents
MessagePackMessagePack objects

How to get a result in different formats:

JSON:
https://tt-api.tech/1.0/spam?txt=[...]&lang=[...]
or
https://tt-api.tech/1.0/spam.json/spam?txt=[...]&lang=[...]
JSONP:
https://tt-api.tech/1.0/spam.jsonp/spam?txt=[...]&lang=[...]&callback=myCallBack
XML:
https://tt-api.tech/1.0/spam.xml/spam?txt=[...]&lang=[...]
YAML:
https://tt-api.tech/1.0/spam.yaml/spam?txt=[...]&lang=[...]
MessagePack:
https://tt-api.tech/1.0/spam.msgpack/spam?txt=[...]&lang=[...]

Example of successful request

Request parameters

{
    "txt": "Cheap shoes for sale at shoe store!", 
    "lang": "eng"
}

Response code

200 Ok / JSON Spam detector

Response

{
    "result": {
        "confidence": 0.885, 
        "spam": true
    }
}

Example of a request with error

Request parameters

{
    "txt": "Very good article indeed!"
}

Response code

412 Precondition Failed / JSON Spam detector

Response

{
    "errors": {
        "lang": [
            "This field is required."
        ]
    }
}
Processed requests
144,295
Average processing time
44 ms
Processing precision
82.5%

So, let's get started!

Start