This endpoint is available if you regularly use our moderation systems of any type.

Request - Lifetime Stats

GET https://api.chatsight.ai/stats/moderation

HEADER x-chatsight-api-auth: <API-TOKEN>

Response

Lifetime usage counter.

{
    "api": "chatsight-lang-text",
    "success": true,
    "response": {
        "commentsPassed": "2002887",
        "commentsTotal": "2021398",
        "commentsDeleted": "11191",
        "commentsFlagged": "1102"
    }
}

Request - Search Historical Records

POST https://api.chatsight.ai/stats/moderation/search

HEADER x-chatsight-api-auth: <API-TOKEN>

curl --location --request POST 'https://api.chatsight.ai/stats/moderation/search' \
--header 'x-chatsight-api-auth: <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{"timefrom":"2021-05-10 20:27:00","timeto":"2021-05-11 21:30:00"}'

Time ranges are rounded to the nearest hour. For example, setting a time between 20:27:00 and 21:30:00, will be parsed instead as 20:00:00 and 22:00:00.

You can request up to 1440 records per request (24 hours worth), and can request this endpoint once every two minutes.

Each record represents approximately 60 seconds. Each records stops recording at the 55 second mark, and may take up to 10 seconds before it is timestamped and processed. For all intensive purposes, each record is committed at 0:55 of any minute.

KeyValueDescription
timefromSTRINGTime to search from.

A UTC formatted datetime string.

YYYY-MM-DD HH:MM:SS
timetoSTRINGTime to search until and up to.

A UTC formatted datetime string.

YYYY-MM-DD HH:MM:SS

Response

{
    "api": "chatsight-lang-text",
    "success": true,
    "response": [
        {
            "commentsPassed": 6, // Comments allowed.
            "commentsTotal": 6, // Total comments (denied or allowed).
            "commentsDeleted": 0, // Comments deleted.
            "commentsFlagged": 0, // Comments flagged for your platforms review.
            "requestTime": {
                "value": "2021-05-10T20:31:55.000Z" // ISO 8601 UTC String
            }
        },
        {
            "commentsPassed": 4,
            "commentsTotal": 4,
            "commentsDeleted": 0,
            "commentsFlagged": 0,
            "requestTime": {
                "value": "2021-05-10T20:42:55.000Z"
            }
        }
    ]
}
{
    "api": "chatsight-lang-text",
    "success": false,
    "response": "Records are currently empty, try again in a little while."
}

🚧

Search Historical Records - Why only every 2 minutes?

This API directly accesses our data processing engine that is scoped to your API key. While we can certainly handle much more frequent requests, this API is not meant to be real-time. There is no guarantees that the data we process will be any different to a request two minutes prior, until the point we actually render it. This time limit to to curve the behavior of using this API for rapidly updating systems.

If you wish to integrate this API to build a historical viewer on your platform, we can remove this limit if you explain this use case. Email us, or use the messenger on the dashboard to get in touch.